[FreeBSD] boot failed due to nvidia module
13 Nov 2022
Table of Contents
Brief
I recently bought a new computer and installed FreeBSD on it. But it didn’t go so well with the Nvidia module.
Hardware
As I already had a graphic card with an Nvidia chip on my previous computer, which also runned on FreeBSD. I decided to buy this one: One of the big pluses of this card is that it has 4 video outputs. Which suits me perfectly to connect my three screens (there’s no point in skimping !).
Here is my card diagnostic:
> pciconf -lv | grep -B3 display
vgapci0@pci0:7:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x2504 subvendor=0x1458 subdevice=0x4074
vendor = 'NVIDIA Corporation'
device = 'GA106 [GeForce RTX 3060 Lite Hash Rate]'
class = display
Installation
After the installation of the base system, I quickly installed Xorg
and the Nvidia drivers:
pkg add xorg
pkg add nvidia-driver
Stupidity, Setup & Problem
The issue is that I wanted so bad a graphic interface that I immediately change my /boot/loader.conf
to add:
nvidia_load="YES"
nvidia-modeset_load="YES"
I restarted FreeBSD and saw this:
Loading kernel...
/boot/kernel/kernel text=0x189e58 text=0xe16108 text=0x6bb35c data=0x140 data=0x1bc
Loading configured modules...
/boot/modules/nvidia.ko size 0x2b624f8 at 0x2353000
loading required module 'linux_common'
/boot/modules/linux_common.ko size 0x1cc10 at 0x4eb6000
loading required module 'linux'
/boot/modules/linux.ko size 0x677b8 at 0x4ed3000
loading required module 'kernel'
module 'kernel' exists but with wrong version
It would have been smarter to use kldload instead but it was too late !
Fix
To repair, I choose the option “3. Escape to loader prompt” at the startup. You can see it displayed before the error in the previous picture.
And I created a module_blacklist
variable with the two modules I wanted to remove from the loading phase:
set module_blacklist="nvidia nvidia-modeset"
To be sure of the name I needed I used the command help
to display the available commands in this loader prompt and more
to look at the content of the /boot/loader.conf
:
help
more /boot/loader.conf
After this little changes, I just had to type boot
and start over.
In fact, my install with pkg
was not ok, so I just had to remove it and re-installed with the ports.
Credits
To solve this issue, I found help here in the FreeBSD forums. Thanks for the tip mcochris.