starting wayland (wayfire) fails using nvidia card [Found 0 GPUS]

I couldn't tell you why, but adding "hw.nvidia.fbdev=1" (obviously without the quotes) to my loader.conf file made everything all better. 🩹

It enables the framebuffer? Are there other options available I should be aware of? I would like to look into additional hw.nvidia.xyz options if they exist.

I kind of got the impression that was a linux setting? I have linux and linux64 in my kld_list. Am I doing something in a round about way?
Yes there is a way to view additional hw.nvidia options by issuing:
Code:
sysctl hw.nvidia

Interesting, that hw.nvidia.fbdev worked for you.
Yes, it enables nvidias own framebuffer device, although not recommended, I believe.
At least I have read it in the official nvidia docs.

If it does not take to much time could you please try to run an xwayland application and tell me whether you get good or bad performance ?
I had sway/wayland set up before but switched back to xorg due to poor xwayland performance.
 
Well drat. I noticed last night wayfire has not had an update in quite some time. Not sure I want to invest must more of my time for a project not actively evolving with wayland.

Does anyone know if this was just a compiz experiment that has been dropped? Or did the team just take a hiatus for a bit?
 
Yes there is a way to view additional hw.nvidia options by issuing:
Code:
sysctl hw.nvidia

Interesting, that hw.nvidia.fbdev worked for you.
Yes, it enables nvidias own framebuffer device, although not recommended, I believe.
At least I have read it in the official nvidia docs.

If it does not take to much time could you please try to run an xwayland application and tell me whether you get good or bad performance ?
I had sway/wayland set up before but switched back to xorg due to poor xwayland performance.

Do you have a pkg in mind? I'd be happy to test.

sysctl hw.nvidia = MWA HA HA HA HA - ENABLE THEM ALL AND SEE WHAT HAPPENS!
 
Example of hw.nvidia* sysctls with Quadro P1000 running 570.124.04 of the driver (not yet landed).
Code:
% sysctl -a | grep hw.nvidia           
hw.nvidiadrm.fbdev: 0
hw.nvidiadrm.modeset: 1
hw.nvidia.gpus.0.type: PCIe
hw.nvidia.gpus.0.uuid: GPU-5d89f314-e37c-da5c-74d9-438bdb801c57
hw.nvidia.gpus.0.firmware:
hw.nvidia.gpus.0.vbios: 86.07.63.00.76
hw.nvidia.gpus.0.irq: 141
hw.nvidia.gpus.0.model: Quadro P1000
hw.nvidia.registry.dwords:
hw.nvidia.registry.GrdmaPciTopoCheckOverride: 0
hw.nvidia.registry.CreateImexChannel0: 0
hw.nvidia.registry.ImexChannelCount: 2048
hw.nvidia.registry.DmaRemapPeerMmio: 1
hw.nvidia.registry.OpenRmEnableUnsupportedGpus: 1
hw.nvidia.registry.EnableDbgBreakpoint: 0
hw.nvidia.registry.RmNvlinkBandwidthLinkCount: 0
hw.nvidia.registry.EnableGpuFirmwareLogs: 2
hw.nvidia.registry.EnableGpuFirmware: 18
hw.nvidia.registry.EnableResizableBar: 0
hw.nvidia.registry.EnablePCIERelaxedOrderingMode: 0
hw.nvidia.registry.RegisterPCIDriver: 1
hw.nvidia.registry.DynamicPowerManagementVideoMemoryThreshold: 200
hw.nvidia.registry.DynamicPowerManagement: 3
hw.nvidia.registry.S0ixPowerManagementVideoMemoryThreshold: 256
hw.nvidia.registry.EnableS0ixPowerManagement: 0
hw.nvidia.registry.PreserveVideoMemoryAllocations: 0
hw.nvidia.registry.RmProfilingAdminOnly: 1
hw.nvidia.registry.NvLinkDisable: 0
hw.nvidia.registry.EnableUserNUMAManagement: 1
hw.nvidia.registry.EnableStreamMemOPs: 0
hw.nvidia.registry.IgnoreMMIOCheck: 0
hw.nvidia.registry.VMallocHeapMaxSize: 0
hw.nvidia.registry.KMallocHeapMaxSize: 0
hw.nvidia.registry.MemoryPoolSize: 0
hw.nvidia.registry.EnablePCIeGen3: 0
hw.nvidia.registry.EnableMSI: 1
hw.nvidia.registry.UsePageAttributeTable: 4294967295
hw.nvidia.registry.InitializeSystemMemoryAllocations: 1
hw.nvidia.registry.DeviceFileMode: 438
hw.nvidia.registry.DeviceFileGID: 0
hw.nvidia.registry.DeviceFileUID: 0
hw.nvidia.registry.ModifyDeviceFiles: 1
hw.nvidia.registry.RmLogonRC: 1
hw.nvidia.registry.ResmanDebugLevel: 4294967295
hw.nvidia.version: NVIDIA UNIX x86_64 Kernel Module  570.124.04  Tue Feb 25 04:12:12 UTC 2025
 
Yes, try out dolphin-emu with a gamecube or wii game please. :D

I do not think it is a good idea to enable every hw.nvidia option as the defaults should be "sane".
Agreed. I was being sarcastic.

Though for real? Why is PCIeGen3 not enabled by default? I am guessing not all the cards this driver supports uses Gen3?

Is there an auto detect tool that can look at the version of your card and say these are reasonable settings for that model?
 
I don't have any roms to play but the emulator installed fine. Font is a little janky (odd in a not good way)

If I can find any free roms I will test. I would love to play Zelda, Mega-Man or Metroid again lol
 
Note that at this moment the patches there cannot be applicable due to updated distfiles of graphics/drm-*-kmod. Would upload updated patch today or tomorrow. (Take some more time to see non-upgraded graphics/drm-510-kmod is upgraded or not.)
Updated patches at PR 285139 and review D49245.
So they can be applicabe to latest ports tree (main branch) again.
 
I don't have any roms to play but the emulator installed fine. Font is a little janky (odd in a not good way)

If I can find any free roms I will test. I would love to play Zelda, Mega-Man or Metroid again lol
What about homebrews ?
The internet archive or vimms layer should have some available, as far as I know.
 
NapoleonWils0n
I am trying to set up sway today.
I got the recommendation to set up hw.nvidiadrm.fbdev=1 so, I set it up in /boot/loader.conf.
hw.nvidiadrm.modeset is set to 0, but I cannot start sway --unsupported-gpu.
It tells me 0 GPUs found.
If I set hw.nvidiadrm.modeset=1, and hw.nvidiadrm.fbdev=1 the system freezes.
If I set hw.nvidiadrm.modeset=1, and hw.nvidiadrm.fbdev=0 the system boots, and I can start sway.
Is there a way to get both things enabled in order to start sway ?

I believe if hw.nvidiadrm.fbdev is enabled, I could get better Xwayland performance.
 
NapoleonWils0n
I am trying to set up sway today.
I got the recommendation to set up hw.nvidiadrm.fbdev=1 so, I set it up in /boot/loader.conf.
hw.nvidiadrm.modeset is set to 0, but I cannot start sway --unsupported-gpu.
It tells me 0 GPUs found.
If I set hw.nvidiadrm.modeset=1, and hw.nvidiadrm.fbdev=1 the system freezes.
If I set hw.nvidiadrm.modeset=1, and hw.nvidiadrm.fbdev=0 the system boots, and I can start sway.
Is there a way to get both things enabled in order to start sway ?

I believe if hw.nvidiadrm.fbdev is enabled, I could get better Xwayland performance.
Answered in another thread you've created.
hw.nvidiadrm.fbdev=1 works only for 570 series of drivers (and upcoming newer branches).
 
i dont add anything nvidia related to my /boot/loader.conf
Don't you have (at least one) tunable in /boot/loader.conf?

Tunables hw.nvidiadrm.modeset and hw.nvidiadrm.fbdev is defined as RDTUN (read-only tunable), means, needed to be defined BEFORE nvidia-drm.ko is loaded.
Possibly works if you've defined them in /etc/sysctl.conf. But there's a risk with race condition. If nvidia-drm.kmod is loaded BEFORE /etc/sysctl.conf is handled, the tunables cannot be recognized.

Loading modules themselves is strongly discouraged, but setting read-only tunables are not.
 
Nothing in loader.conf for Nvidia


i found setting nvidia-modeset in loader.conf didnt work for me
but setting it in the kld-list did

i have been doing it that way since December 2023 using Wayland
without any issues at all
Possibly different behavior between X11 and Wayland?

On my test (limited with X11) while creating submitted (and already landed) patch for 570.124.04, even though available source codes show hw.nvidiadrm.modeset is defaulted to 1, commenting out hw.nvidiadrm.modeset=1 in my /boot/loader.conf caused nvidia-drm.ko to stop working and the value seen via sysctl was 0.

And setting this tunable alone does not cause nvidia-drm.ko to be loaded.
adding it in kld_list in your /etc/rc.conf[.local] as you mentioned is mandatory.
 
could be a difference between X11 and Wayland

i switched back to using Freebsd using Wayland in Dec 2023

had been using Linux on my Dell xps 15 2019
because when i got it Freebsd didnt work

but got fed up with Linux wiped the drive crossed my fingers and installed Freebsd
and was amazed that Freebsd worked with Nvidia and Wayland

havent used X11 in several years so couldnt say
 
could be a difference between X11 and Wayland

i switched back to using Freebsd using Wayland in Dec 2023

had been using Linux on my Dell xps 15 2019
because when i got it Freebsd didnt work

but got fed up with Linux wiped the drive crossed my fingers and installed Freebsd
and was amazed that Freebsd worked with Nvidia and Wayland

havent used X11 in several years so couldnt say
Wayland works for me, too, but what about the X client in wayland ?
Testing today again I got a lot of error messages regarding Xwayland with Vulkan, and OpenGL backend.
I will reproduce them right now, note them and post them here.
The X on wayland problem is getting on my nerves 🥲

The first error I get when starting dolphin-emu an X application using waylands X client:
-> -avx512pf is not a recognized feature for this target (ignoring feature).
-> -avx512er is not a recognized feature for this target (ignoring feature).

Starting dolphin-emu on X11 doesn't reproduce the -avx512 problem.

After starting a game with Vulkan backend:
-> [wlr][xwayland/xwm.c:1636] xcb error: op ChangeProperty (no minor) code window.
-> [wlr][xwayland/xwm.c:1636] xcb error: op ConfigureWindow (no minor) code ...
-> [wlr][xwayland/xwm.c:1192] Failed to get window property.
I could log these errors only after quitting sway so, at least I now have a hint, why X wayland applications are slow.

On X11 dolphin-emu runs fine.
 
i havent used sway,
but i had no issues with XWayland using dwl, labwc or Wayfire

could be an issue with Sway and Xwayland
do you get issues with all X11 apps or just dolphin-emu

it may just be an issue with that one app

there was an issue with XWayland about a year ago
which caused the compositor to crash when starting X11 apps

but that has been fixed and i havent had any issue since

if you have a look in the how to section of the forum
i have tutorials on inxtall dwl, labwc and wayfire

if you like tiling window managers i would recommend dwl
its by far the best Wayland compositor on Freebsd
 
could be an issue with Sway and Xwayland
do you get issues with all X11 apps or just dolphin-emu
Yes, I get all kind of weird issues.
Not only with dolphin-emu, but with Ryujinx on linux, sway tends to lose my GPU device during a period of time.
I think it could be a compositor issue, too.
Since each compositor use wayland differently, I think.


if you like tiling window managers i would recommend dwl
its by far the best Wayland compositor on Freebsd
Yes, I will look into the how to section, then :)
 
wayland compositor tutorials



 
Since each compositor use wayland differently, I think.

thats correct different Wayland compositor support different parts of the Wayland spec
and can also use different version of wlroots

Yes, I will look into the how to section

i just posted the links above to save you some leg work

heres my Freebsd config

root dotfiles

dotfiles

bin

my tech notes
 
i would recommend these wlroots applications

tofi - as an application launcher

wlr-which-key - heads up display for running commands

tofi



wlr-which-key



 
I am going to try out dwl today.
I know C very well so, the configuration shouldn't pose a problem, but I don't know how to compile dwl outside of ports for FreeBSD since it is made with linux in mind, I believe ?
Thank you very much for the tutorials, they will help me for sure setting up dwl on FreeBSD. :)
 
here you go mate

also attached my build of dwl as a zip

dwl install

dwl files i have alterted

patches

dwl - codeberg

latest release
 

Attachments

Back
Top