nvidia drivers not working.

I am posting this from not-my-bsd machine so I will have to figure out how to get logs here.

I have a new computer, with a fresh install of freebsd 15. I have not touched FreeBSD in decades so please give me the newbie step-by-step instructions when possible.

I cannot get my Nvidia driver working. I tried first via the handbook and then I tried desktop-installer package. I just tried rebuilding from the port and now I am unsure what next.

Driver version is 580.126.09 I used the nvidia-driver pkg and port. klstat does show nvidia and nvidia-modeset loaded.

Xorg will start with scfb. If I create 10-monitor and 20-nvidia.conf files it starts to load Nvidia drivers then my system becomes unresponsive, last line in Xorg.log tells me that I can use PRIME render offload.

I tried uninstalling the nvidia packages again and going back to nvidia-drm-kmod (as per the handbook - desktop-installer doesn't use this) and now I am getting a version mismatch -modset is 580.126.09 vs -drm 580.119.02 both of which were pulled by pkg install nvidia-drm-kmod.
  • I am switching pkg back to quarterly, runniing pkg update then upgrade -f. hopefully that will fix the version mismatch. I don't expect this to fix my general problem though.
  • Finished with that and now the mismatch is modeset 580.126.09 and drm 580.95.05 I guess pkg update -f and pkg upgrade -f didn't fix that.
  • Disabling the freebsd-ports-kmods repository fixed the mismatch. rebooting now.
  • 🥵 My system now hangs on boot when it loads the nvidia driver. A new personal low.
Keep in mind there was no mismatch while the system was locking up, so once I fix the mismatch I will still probably have problems with my driver.

I don't know what to do next. Do I try an older driver? Nuke the system and try FreeBSD 14? My system is an amd epyc, my video card is a blackwell pro 4000.
 
PLS Note: ALL NVIDIA Drivers / KMODS / DRM must have the same version.
in my case im at 580.105.08

$ pkg info nvidia*
nvidia-driver-580.105.08
nvidia-drm-66-kmod-580.105.08.1600004
nvidia-drm-kmod-580.105.08
nvidia-kmod-580.105.08.1600007
nvidia-settings-580.105.08
nvidia-xconfig-580.105.08

And you need same DRM version. DRM 66 and DRM 66 Kmod.
$ pkg info drm*
drm-66-kmod-6.6.25.1600007_8

As the NVIDIA drivers is quickly being upgraded from upstream. the FreeBSD Repositories are not keeping up.
specifically the KMOD and BASE repos have not been in sync for many weeks now.
I usually solve this by deleting all the nvidia packages installed from the online repos, and then install a new Ports tree as described in the handbook.
Then :
# sysrc linux_enable="YES"
# kldload linux linux64
# cd /usr/ports/graphics/nvidia-drm-kmod
# make install

This will build and install the following komponents :

nvidia-driver
nvidia-kmod
nvidia-drm-kmod
nvidia-drm-66-kmod
drm-66-kmod.
 
x@myfreebsd:/SSD/home/x $ kldstat | grep drm
Code:
20    1 0xffffffff89a99000    8a190 drm.ko
x@myfreebsd:/SSD/home/x $ kldstat | grep nvidia
 5    1 0xffffffff83848000   1650f8 nvidia-modeset.ko
 6    1 0xffffffff83a00000  6058178 nvidia.ko

Maybe a bit too much, but this works,
Code:
cat b
drm-66-kmod-6.6.25.1500068_5   Direct Rendering Manager GPU drivers
drm-kmod-20250428              Direct Rendering Manager GPU drivers metaport
gpu-firmware-kmod-20241114,1   Firmware modules for the drm-kmod drivers
nvidia-driver-580.95.05        NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-drm-66-kmod-580.95.05.1500068 NVIDIA DRM Kernel Module
nvidia-drm-kmod-580.95.05_1    NVIDIA DRM Kernel Module
nvidia-kmod-580.95.05.1500068  kmod part of NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-settings-580.95.05      Display Control Panel for X NVidia driver
 
Thank you for your replies.

I was able to find a linux livecd that included nvidia drivers and confirmed for my own sanity that my hardware works.

As I left my machine I was at 580.126.09 which hangs my machine upon kldload.

I brought my packages back to -quarterly and did a pkg upgrade -f
Now it's that mix of 580.126.09.1500068 and 580.119.02.1500068

pkg delete nvivia*
pkg delete drm*

cd /usr/ports/graphics/nvidia-drm-kmod
make clean all install

loader.conf is okay
kldload nvidia-drm

frozen machine.


I assume I screwed up somewhere between fresh install and here.
I'm going to sit and think for awhile. Maybe nuke and reinstall?
 
Is this a laptop ? Looks so if you say there's Prime. If it is, so dual GPU (iGPU and discrete NVIDIA), make sure that drm-kmod works fine, and try to run only from i915kms (disable NVIDIA loading from rc.conf).
Remove/disable your custom xorg files, they can easily freeze X...
 
No this is a epyc 9175f on a ASRock MB TURIND8-2L2T motherboard with a blackwell 4000 gpu. There is an ASPEED BMC onboard that I have not configured or installed any specific drivers for - could that be a problem? The aspeed bmc uses a VGA out but my main monitor is a displayport device connected directly to the GPU.

Currently there are no custom xorg files. X currently starts with SCFB (?) drivers at 800x600 resolution.
 
I got it working!

I built from ports nvidia-drm-latest-kmod-devel.

I added the following to loader.conf (this might be unnecessary - I will try removing them after basking a little in my success)
hw.nvidiadrm.fbdev=0​
hw.nvidia.registry.EnableGpuFirmware=1​
At this point system behavior changed to kernel panics rather than system freezes when nvidia-drm was loaded/used.

Finally I did
pkg delete drm\*​
pkg install drm-latest-kmod drm_info​
kldload nvidia-drm​

I restarted my Xorg process and it detected everything.

Final versions:
drm-latest-kmod-6.9.1500068_1​
nvidia-drm-latest-kmod-devel-590.48.01.1500068​
Thank for your help.
 
Windows in X11 repaint poorly so I tried changing the fbdev setting.

hw.nvidiadrm.fbdev=1 makes the machine crash and/or lock up when the nvidia-drm.ko is loaded.

I have no idea where or how to report this. Now that my gui is working I have a lot of handbook to read.
 
do not forget to "pkg install nvidia-driver".

boot/loader.conf ONLY :
hw.nvidiadrm.modeset=1

/etc/rc.conf:
kld_list="nvidia-modeset"

Then you can play around with acceleartion in xorg.conf or a compositor.
 
Nice you had some progress 😄
Is it hardware acceleration problem in X, like I had...?
I don't think that hw.nvidia.registry.EnableGpuFirmware is relevant, it should only apply to 5xxx series.
One should know now that NVIDIA is a pain for the world and for Freebsd setups 😅
 
Back
Top