# nvidia-driver not working with /boot/loader.conf (but works manually via kldload)



## caolan (Aug 16, 2015)

Today I did a fresh install of FreeBSD 10.2 and installed x11/mate-desktop, x11/mate, x11/xorg, x11/slim etc. This worked fine but at a low resolution. I have a GTX 970 Nvidia card so I decided to install the x11/nvidia-driver and associated packages using:

`pkg install nvidia-driver nvidia-xconfig nvidia-settings`

Followed by generating an xorg.conf using `nvidia-xconfig`. Then, I updated /boot/loader.conf:


```
nvidia_load="YES"
```

And /etc/rc.conf:


```
hostname="caolan-freebsd.caolan.org"
keymap="uk.iso.kbd"
ifconfig_em0="DHCP"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
slim_enable="YES"
linux_enable="YES"
```

Now on boot I'm presented with a text login prompt. After logging in I've noticed that the nvidia kernel module is not loaded (using kldstat(8)) - If I load the module manually using:

`kldload nvidia`

I can then launch the MATE desktop using:

`startx`

After which, everything seems to work fine. I originally had x11/slim prompting for login successfully and launching the MATE desktop (at a lower resolution without the Nvidia driver). Now I just get text mode on boot. The only changes I recall since then is installing the x11/nvidia-driver package, generating xorg.conf (there wasn't one before), and updating the config files above to include nvidia_load="YES" in loader.conf and linux_enable="YES" in rc.conf.

I've reviewed the logs from `dmesg -a` but don't see any obvious error messages. My question is, why isn't the Nvidia driver loaded via /boot/loader.conf?

(full rc.conf, loader.conf and xorg.conf attached)


----------



## protocelt (Aug 16, 2015)

Hi.

Try the suggested workaround in Thread 51446 and see if that works for you.


----------



## caolan (Aug 16, 2015)

protocelt said:


> Hi.
> 
> Try the suggested workaround in Thread 51446 and see if that works for you.



Thanks protocelt - that seems to have worked. My searches didn't turn up that thread!


----------



## priyadarshan (Sep 12, 2015)

Interesting. Is there any difference in loading  a driver in rc.conf(5) vs loading it in loader.conf(5)?

Perhaps rc.conf is run at later time during boot?


----------

