Solved hw.nvidiadrm.fbdev=1 + hw.nvidiadrm.modeset=1 causes a system freeze during boot

I got a recommendation for (x)wayland to enable hw.nvidiadrm.fbdev.
Using it back then on linux I got a nice performance boost in xwayland applications.
How relevant is that option for FreeBSD ?
I also noticed that the pkg of the nvidia-driver tells me to enable hw.nvidiadrm.modeset in /boot/loader.conf.
But having it commented out, and adding hw.nvidiadrm.fbdev=1 into my /boot/loader.conf works just fine for X11.
Inspecting my loaded kernel modules:
Code:
INPUT:
kldstat | grep nvidia

Output:
12    1 0xffffffff82693000    149b0 nvidia-drm.ko
18    2 0xffffffff82800000  40ac9a8 nvidia.ko
19    1 0xffffffff868ad000   1325e8 nvidia-modeset.ko

The modeset is loaded, too ?
But if I issue:
Code:
INPUT:
sysctl hw.nvidiadrm

Output:
hw.nvidiadrm.fbdev: 1
hw.nvidiadrm.modeset: 0

Does that mean that hw.nvidiadrm.modeset gets loaded implicitly by hw.nvidiadrm.fbdev ?
That would mean that modeset, and fbdev are both enabled, but cannot be both enabled during the initial boot stage ?

EDIT:
I need to have hw.nvidiadrm.modeset=1 in my loader.conf file or sway won't start with the error message 0 GPUs found.
If I set hw.nvidiadrm.modeset=0 in my loader.conf, sway won't start.
But enabling both hw.nvidiadrm.modeset, and hw.nvidiadrm.fbdev gets me stuck on boot.
My nvidia driver version is 565.77 with nvidia-drm-61-kmod.
 
I got a recommendation for (x)wayland to enable hw.nvidiadrm.fbdev.
Using it back then on linux I got a nice performance boost in xwayland applications.
How relevant is that option for FreeBSD ?
I also noticed that the pkg of the nvidia-driver tells me to enable hw.nvidiadrm.modeset in /boot/loader.conf.
But having it commented out, and adding hw.nvidiadrm.fbdev=1 into my /boot/loader.conf works just fine for X11.
Inspecting my loaded kernel modules:
Code:
INPUT:
kldstat | grep nvidia

Output:
12    1 0xffffffff82693000    149b0 nvidia-drm.ko
18    2 0xffffffff82800000  40ac9a8 nvidia.ko
19    1 0xffffffff868ad000   1325e8 nvidia-modeset.ko

The modeset is loaded, too ?
But if I issue:
Code:
INPUT:
sysctl hw.nvidiadrm

Output:
hw.nvidiadrm.fbdev: 1
hw.nvidiadrm.modeset: 0

Does that mean that hw.nvidiadrm.modeset gets loaded implicitly by hw.nvidiadrm.fbdev ?
That would mean that modeset, and fbdev are both enabled, but cannot be both enabled during the initial boot stage ?

EDIT:
I need to have hw.nvidiadrm.modeset=1 in my loader.conf file or sway won't start with the error message 0 GPUs found.
If I set hw.nvidiadrm.modeset=0 in my loader.conf, sway won't start.
But enabling both hw.nvidiadrm.modeset, and hw.nvidiadrm.fbdev gets me stuck on boot.
My nvidia driver version is 565.77 with nvidia-drm-61-kmod.
Setting tunable hw.nvidiadrm.fbdev=1 could benefit performance on Wayland "if it works". And hw.nvidiadrm.modetet=1 is mandatory for DRM driver (nvidia-drm.ko) to work.

As this is known to break X11 (x11-servers/xorg-server), this is disabled (set to 0) on ports side by default (upstream defaults it to 1 [enabled] starting from 570 series of their drivers).

And this was not enabled by default before 570 series, including your 565.77, just because it is NOT considered to work even on Wayland for FreeBSD (just my guess, though).

You need to upgrade your drivers (x11/nvidia-driver and graphics/nvidia-drm-61-kmod, but if you're installing x11/linux-nvidia-libs, upgrade it, too). Official ports tree already has 570.124.04 both on main (aka latest) and 2025Q2 (aka quarterly).
 
Sway works, but XWayland is heavily broken.
X11 works with hw.nvidiadrm.modeset=0 and hw.nvidiadrm.fbdev=1 with my current driver.
 
Sway works, but XWayland is heavily broken.
X11 works with hw.nvidiadrm.modeset=0 and hw.nvidiadrm.fbdev=1 with my current driver.
I've not tried Xwayland, as I cannot find my prerequisite (an equivalent of Mag plugin of compiz) for Wayland. So cannot comment about it.

For X11, IIUC, on setting hw.nvidiadrm.modeset=0, you can specify nvidia-drm.ko to stop functioning, thus, hw.nvidiadrm.fbdev shouldn't have any effect regardless its value. This means your X11 is running on legacy way with nvidia-modeset.ko and nvidia.ko only even if nvidia-drm.ko is kldload'ed..
 
Back
Top