Why doesn't Xorg automaticly use the NVIDIA driver?

This is a fresh installation of 12.2-RELEASE (64-bit) with the most recent ports tree as of November 27, 2020. I have x11/xorg version 7.7_3 and x11/nvidia-driver version 440.100_1 installed. According to https://www.nvidia.com/en-us/drivers/unix/, either the 440 or 390 driver is the latest driver I can use with a GTX 780 Ti. I've tried with both and have settled on 440.

These are the steps taken:

Code:
pkg install -y nvidia-driver
sysrc -f /boot/loader.conf nvidia-modeset_load="YES"

After reboot I can confirm the relevant NVIDIA kernel modules have loaded:

Code:
# dmesg | grep nvidia
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.138  Thu May 14 04:04:42 PDT 2020
nvidia0: <GeForce GTX 780 Ti> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia1: <GeForce GTX 780 Ti> on vgapci1
vgapci1: child nvidia1 requested pci_enable_io
vgapci1: child nvidia1 requested pci_enable_io
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  440.100  Fri May 29 08:11:49 UTC 2020
nvidia0: <Unknown> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia1: <Unknown> on vgapci1
vgapci1: child nvidia1 requested pci_enable_io
vgapci1: child nvidia1 requested pci_enable_io

Code:
# kldstat | grep nvidia
3    1 0xffffffff82486000   175238 nvidia-modeset.ko
6    2 0xffffffff826bd000  1b4b3d8 nvidia.ko

As a side note, the vt() screen does switch to a 1920x1080 resolution, but it looks like it's much lower. The text is stretched and very large, and also I see "VT(vga): resolution 640x480" in the logs. I'm not sure what's happening there. Anyway...

With no xorg.conf(), I run startx and it fails. In the log (that I linked to) you can see there is no attempt to load the NVIDIA driver that the port installed under /usr/local/lib/xorg/modules/drivers/nvidia_drv.so. In order to get X to load the correct driver I must tell it to do so manually using /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following contents.:

Code:
Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
        BusID "PCI:1:0:0"
EndSection

With that in place, X starts correctly.

I prefer not to mess with xorg.conf() and just let it detect the hardware. Could it be becuase I have 2 cards? I had to put the line "BusID PCI:1:0:0" in the configuration file to indicate which one to use. Without that line, X fails to start in the same exact way.

In case it's relevent, this is the contents of /etc/rc.conf (minus any unrealted network config):
Code:
sshd_enable="YES"
powerd_enable="YES"
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
hald_enable="YES"
sddm_enable="YES"
ntpd_enable="YES"
ntpd_flags="-g"
webcamd_enable="YES"
devfs_system_ruleset="devfsrules_common"

Also /boot/loader.conf:

Code:
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
opensolaris_load="YES"
zfs_load="YES"
fuse_load="YES"
tmpfs_load="YES"
aio_load="YES"
nvidia-modeset_load="YES"
libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"
snd_driver_load="YES"
cuse4bsd_load="YES"
kern.ipc.shmseg=1024
kern.ipc.shmmni=1024
kern.maxproc=100000
 

Attachments

  • Xorg Log.txt
    5.3 KB · Views: 168
  • Xorg Log (working).txt
    32.7 KB · Views: 192
Hello there! I do not have a solution per say for why xorg does not for example try the first card on the bus, but, can confirm, with a multi-videocard system, I too had to specify the BusID "PCI:1:0:0" line in my custom driver config (/usr/local/etc/X11/xorg.conf.d/20-nvidia.conf) before X would start, otherwise, it'd just give the standard "No Screens Found" error. I am using 14.0-RELEASE with latest packages as of April 04, 2024, and it was your post that reminded me to add that line whilst I was searching myself after having tried a few other possible solutions.
 
Back
Top