Solved How do I get the Nvidia driver to work?

Jay F. Shachter

Member

Reaction score: 1
Messages: 63

How do I get the Nvidia driver to work? Or, alternately, since I don't care whether I'm running the Nvidia driver or not, how do I get fast graphics without it? When I try to run a GLX application I get the following:

Code:
$ /usr/local/bin/xscreensaver-hacks/juggler3d
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
juggler3d: couldn't create GL context for visual 0x21.
$

I built x11/nvidia-driver, and then I rebuilt x11-servers/xorg-server, and then I built x11/nvidia-driver again. I put
Code:
nvidia_load=YES
into /boot/loader.conf. The articles that tell me to load
Code:
nvidia-modeset
also, are either incorrect or obsolete: there is no such module, nor even any file anywhere in the system that has
Code:
nvidia-modeset
anywhere in its name, nor does there seem to be any port that installs any such file:

Code:
$ find /usr/ports -depth 3 -name pkg-plist | xargs grep nvidia-modeset
$

When I run nvidia-settings it pops up a window that says
Code:
You do not appear to be using the NVIDIA X driver.
Please edit your X configuration file (just run `nvidia-
xconfig` as root), and restart the X server.
and running nvidia-xconfig creates an /etc/X11/xorg.conf that crashes the X server, it says
Code:
No screens found
and exits.

At this point I wanted to present the contents of /var/log/Xorg.1.log (which I just created a moment ago by running xinit -- :1, so I could show it to you), but I am unable to post this message when I do so, the website says that it is too long, so I have copied the file onto my website instead, you can find it at
Code:
http://m5.chicago.il.us/Xorg.1.log
.

The nvidia module is unquestionably loaded when I reboot:
Code:
# kldstat 
Id Refs Address            Size     Name
 1   46 0xffffffff80200000 1fa7c38  kernel
 2    1 0xffffffff821a9000 b350     geom_linux_lvm.ko
 3    1 0xffffffff821b5000 1a7c8    fuse.ko
 4    1 0xffffffff821d0000 b67b50   nvidia.ko
 5    2 0xffffffff82d38000 9b748    linux.ko
 6    5 0xffffffff82dd4000 de28     linux_common.ko
 7    1 0xffffffff83021000 587b     fdescfs.ko
 8    1 0xffffffff83027000 a9f1     linprocfs.ko
 9    1 0xffffffff83032000 5862     linsysfs.ko
10    1 0xffffffff83038000 155b2    ext2fs.ko
11    1 0xffffffff8304e000 249d     ulpt.ko
12    1 0xffffffff83051000 389f4    linux64.ko
13    1 0xffffffff8308a000 1fe5a3   zfs.ko
14    1 0xffffffff83289000 811f     opensolaris.ko
#

Thank you in advance for any and all replies.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,328
Messages: 38,847

Please post your /var/log/Xorg.0.log on pastebin or a similar service.
 
H

hukadan

Guest


The articles that tell me to load
Code:
nvidia-modeset
also, are either incorrect or obsolete
That's suprising. This is a recent change and was documented in the UPDATING file :
20160829:
AFFECTS: users of x11/nvidia-driver
AUTHOR: cem@FreeBSD.org

The NVidia driver has been updated to version 367.35. Starting with
version 358.09, new kernel module was added, nvidia-modeset.ko. This
new driver component works in conjunction with the nvidia.ko kernel
module to program the display engine of the GPU.

Users that experience hangs when starting X11 server, or observe

(II) NVIDIA(0): Validated MetaModes:
(II) NVIDIA(0): "NULL"

messages in their /var/log/Xorg.0.log file should replace ``nvidia''
with ``nvidia-modeset'' in /boot/loader.conf or /etc/rc.conf files,
depending on how they prefer to load NVidia driver kernel module.

Also, have you read this thread : Thread 52311 ?
 

BSD-Kitsune

Active Member

Reaction score: 77
Messages: 185

Put this line:
Code:
kld_list="nvidia-modeset"

in /etc/rc.conf

Along with any other kernel modules you want to load. Take out the other kernel module lines from your loader.conf

Once you do that, reboot and then do this:

$ su -
# X -configure
It will make a new xorg.conf.new in your /root directory - double check it's using the nvidia driver and then:

# cp xorg.conf.new /usr/local/etc/X11
 
H

hukadan

Guest


I just had a look to your log (I was stupid err... bold enough to click on your link ;)) and read that :
Code:
[  2435.322] (II) NVIDIA GLX Module  346.96  Sun Aug 23 21:29:48 PDT 2015
When was the last time you updated your port tree ?! (At least six month) Which means before the nvidia-modeset change was introduced.
 
H

hukadan

Guest


# X -configure
It will make a new xorg.conf.new in your /root directory - double check it's using the nvidia driver and then:

# cp xorg.conf.new /usr/local/etc/X11

Please stop doing that, it is not needed. Just follow the HowTo I just linked above. If you want, compare the Xorg.conf file that has been generated by your command and the one shown in the HowTo.
 

scottro

Daemon

Reaction score: 902
Messages: 2,050

What NVidia card are you using. Some of them take the older driver, nvidia-340, rather than nvida. (And still older ones take nvidia-306, I think).
 
OP
J

Jay F. Shachter

Member

Reaction score: 1
Messages: 63

hukadan: I am using the ports tree in FreeBSD-11.0-RELEASE-amd64-dvd1.iso, which I downloaded and installed less than two weeks ago. scottro: This is taken from the output of pciconf -lBvc:
Code:
vgapci0@pci0:3:0:0:    class=0x030000 card=0x90081043 chip=0x060110de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'G92 [GeForce 9800 GT]'
    class      = display
    subclass   = VGA
    cap 01[60] = powerspec 3  supports D0 D3  current D0
    cap 05[68] = MSI supports 1 message, 64 bit
    cap 10[78] = PCI-Express 1 endpoint max data 128(128) RO NS
                 link x16(x16) speed 2.5(2.5) ASPM disabled(L0s/L1)
    ecap 0002[100] = VC 1 max VC0
    ecap 0004[128] = Power Budgeting 1
    ecap 000b[600] = Vendor 1 ID 1
 
OP
J

Jay F. Shachter

Member

Reaction score: 1
Messages: 63

I followed the advice in Thread 52311 and created the file /usr/local/etc/X11/xorg.conf.d/10-nvidia.conf with the contents
Code:
Section "Device"
        Identifier "NVIDIA Card"
        VendorName "NVIDIA Corporation"
        Driver "nvidia"
EndSection
and restarted the X server. That did not work, but it did cause an informative error message to appear in the log file, telling me for the first time exactly the same thing that hukadan had just posted, namely, that I should have installed x11/nvidia-driver-340 rather than x11/nvidia-driver. I then deinstalled x11/nvidia-driver and installed x11/nvidia-driver-340 and now things are working perfectly. I do not know whether the installation of x11/nvidia-driver-340 would have been sufficient even without creating
/usr/local/etc/X11/xorg.conf.d/10-nvidia.conf because I have not tested whether it would continue to work if I were to back out that file ("if it ain't broke, don't fix it"). I shall now mark this thread as Solved, and I thank everyone for your help. -- jfs
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,328
Messages: 38,847

I do not know whether the installation of x11/nvidia-driver-340 would have been sufficient even without creating /usr/local/etc/X11/xorg.conf.d/10-nvidia.conf because I have not tested whether it would continue to work if I were to back out that file ("if it ain't broke, don't fix it")
That file would still be needed because you have to tell Xorg to use the right driver. Although Xorg nowadays does its best to auto-detect the correct drivers it tends to fall back to the nv driver. This simply forces Xorg to use the nvidia driver.
 

BSD-Kitsune

Active Member

Reaction score: 77
Messages: 185

Please stop doing that, it is not needed. Just follow the HowTo I just linked above. If you want, compare the Xorg.conf file that has been generated by your command and the one shown in the HowTo.

My bad, it's on reflex when I see posts like this. And yeah, thanks for the how-to
 

Sevendogs

Active Member

Reaction score: 33
Messages: 168

I am curious why x11/nvidia-xconfig is not mentioned? I have been using that for some time and it seems to work fine but maybe this is not the preferred way of doing Xorg configuration? I read thread Thread 52311 and one member warns against using it but it has worked perfectly for me so not sure what the problem would be. A reference was made to a "huge and overly complicated xorg.conf file stuffed with specific nvidia-related options and settings you don't really need for a simple task of using 2 monitors with default driver-decided settings in the needed order." but I have never seen this. The only thing odd I noticed was the xorg.conf was in /etc/X11 and not under /usr/local/etc/X11 as other port configurations.
 

Phishfry

Beastie's Twin

Reaction score: 2,668
Messages: 5,588

My total guess is they are trying to herd us into the newer xorg.conf.d location for settings. The old location works but not forever...
This is what most of the Linux distros do now too. xorg.conf superseded for xorg.org.d with devices broken out into separate files.
 

Sevendogs

Active Member

Reaction score: 33
Messages: 168

Eeee gads, I am really doing this wrong. Going to go back and read the referenced thread again and see how to split up the single xorg.conf into multiples and put everything in the proper directory.
 

Sevendogs

Active Member

Reaction score: 33
Messages: 168

Sorry to hijack a solved thread but I followed everyone's guidance, split the old /etc/X11/xorg.conf into separate files per the documentation under /usr/local/etc/X11/xorg.conf.d/ and it works :) Odd thing though is it doesn't seem to matter what I named the files. Or maybe the system doesn't NEED files for the keyboard and mouse, or the "ServerLayout" section in the old config. Not sure but it still works so I am good with it.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,328
Messages: 38,847

Filenames are not relevant. As long as they end with *.conf they'll get loaded. So you can name them whatever you want.

As for keyboard and mouse, those are usually detected automatically. And unless you added AutoAddDevices no those sections will be ignored, even if you have them.
 

puretone

Member

Reaction score: 32
Messages: 85

How do I get the Nvidia driver to work? Or, alternately, since I don't care whether I'm running the Nvidia driver or not, how do I get fast graphics without it? When I try to run a GLX application I get the following:

Code:
$ /usr/local/bin/xscreensaver-hacks/juggler3d
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
juggler3d: couldn't create GL context for visual 0x21.
$

I built x11/nvidia-driver, and then I rebuilt x11-servers/xorg-server, and then I built x11/nvidia-driver again. I put
Code:
nvidia_load=YES
into /boot/loader.conf. The articles that tell me to load
Code:
nvidia-modeset
also, are either incorrect or obsolete: there is no such module, nor even any file anywhere in the system that has
Code:
nvidia-modeset
anywhere in its name, nor does there seem to be any port that installs any such file:

Code:
$ find /usr/ports -depth 3 -name pkg-plist | xargs grep nvidia-modeset
$

When I run nvidia-settings it pops up a window that says
Code:
You do not appear to be using the NVIDIA X driver.
Please edit your X configuration file (just run `nvidia-
xconfig` as root), and restart the X server.
and running nvidia-xconfig creates an /etc/X11/xorg.conf that crashes the X server, it says
Code:
No screens found
and exits.

At this point I wanted to present the contents of /var/log/Xorg.1.log (which I just created a moment ago by running xinit -- :1, so I could show it to you), but I am unable to post this message when I do so, the website says that it is too long, so I have copied the file onto my website instead, you can find it at
Code:
http://m5.chicago.il.us/Xorg.1.log
.

The nvidia module is unquestionably loaded when I reboot:
Code:
# kldstat
Id Refs Address            Size     Name
1   46 0xffffffff80200000 1fa7c38  kernel
2    1 0xffffffff821a9000 b350     geom_linux_lvm.ko
3    1 0xffffffff821b5000 1a7c8    fuse.ko
4    1 0xffffffff821d0000 b67b50   nvidia.ko
5    2 0xffffffff82d38000 9b748    linux.ko
6    5 0xffffffff82dd4000 de28     linux_common.ko
7    1 0xffffffff83021000 587b     fdescfs.ko
8    1 0xffffffff83027000 a9f1     linprocfs.ko
9    1 0xffffffff83032000 5862     linsysfs.ko
10    1 0xffffffff83038000 155b2    ext2fs.ko
11    1 0xffffffff8304e000 249d     ulpt.ko
12    1 0xffffffff83051000 389f4    linux64.ko
13    1 0xffffffff8308a000 1fe5a3   zfs.ko
14    1 0xffffffff83289000 811f     opensolaris.ko
#

Thank you in advance for any and all replies.

For posterity:
Don't do this nonsense.
Just add the following:
Code:
 kld_list="nvidia nvidia-modeset linux linux64"
to your /etc/rc.conf

(you can actually get away with just using kld_list="nvidia-modeset" as it autro-loads all that needed)

# mv /etc/X11/xorg.conf /etc/X11/backup.xorg.conf

Install /usr/ports/x11/nvidia-driver & /usr/ports/x11/nvidia-xconfig

Run nvidia-xconfig to generate a functional /etc/X11/xorg.conf

Remove all mention of "nvidia" & "linux" from /boot/loader.conf
In fact, just use a totally blank /boot/loader.conf for the moment until you correctly get all nvidia stuff working correctly.
There is literally no need to mess with anything in /usr/local/etc/X11/xorg.conf.d/, so don't, as the defaults do all that's needed. You could choose to do so if you so insist, but NVidia themselves indicate a preference for using /etc/X11/xorg.conf at all times.
You can add the following modifications after successfully setting up a working /etc/X11/xorg.conf for some added vanity:
# nvidia-xconfig --add-argb-glx-visuals
# nvidia-xconfig --composite
# nvidia-xconfig --depth=24

Rebuild /usr/ports/x11/nvidia-settings as needed.

If you feel like bleeding-edge is more your thing, you can partake in a lovely little Sunday stroll down the Valley Of Impunity along the path of the wilder side of all the things & install the latest generation nvidia-driver shenanigans from https://www.nvidia.com/en-us/drivers/unix/freebsd-x64-archive/
 
Top