Every Wayland compositor shows a black screen

Fresh install of FreeBSD with an NVIDIA GTX 1050 ti. Starting *any* Wayland compositor gives me a black screen, no mouse, no nothing, and no way to control-C. I have to power cycle the machine to exit. I followed the FreeBSD Handbook almost to the letter.

I can't find any pertinent error messages anywhere in the logs, although I'm new at this and may not be looking in the right place.

I have installed wayland, seatd, sway, wayfire, dwl, plasma6, nvidia-drm-61-kmod, nvidia-settings, nvidia-driver-570, and nvidia-drm-kmod. Starting sway, wayfire, dwl, and plasma-wayland all give the same behavior, using something like

exec dbus-launch --exit-with-session ck-launch-session startplasma-wayland

or

exec dbus-launch --exit-with-session dwl

I have in /boot/loader.conf:

hw.nvidia.modeset="1"
hw.nvidiadrm.fbdev="1"

and in /etc/rc.conf:

kld_list="nvidia-drm nvidia-modeset linux linux64"
dbus_enable="YES"
seated_enable="YES"

X11 works fine, and the NVIDIA X11 Configuration app sees the GPU just fine.
 
You still need to load i915kms , add it to your kld_list. Also, it is seatd_enable and not seated_enable.
THanks. I added i915kms to kld_list, but it didn't change the behavior. I'm not sure I understand why it's needed, isn't it the driver for Intel GPUs?

I have seatd_enable, the above was an autocorrect typo.

What else should I check?
 
Try commenting out hw.nvidiadrm.fbdev="1" in your /boot/loader.conf.

It could improve performance IF WORKED, but known doesn't work in many cases. So disabled by default on ports side, while enabled by default in upstream tarball.

And if you can (means, if your motherboard / UEFI firmware [or even legacy BIOS] allows), try disabling iGPU.

Other thing to consider would be bus ID of your GPU matches your configuration.

For example in my case,
Code:
% pciconf -lv | fgrep -B 1 -A 3 NVIDIA
vgapci0@pci0:1:0:0:    class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1cbb subvendor=0x17aa subdevice=0x2262
    vendor     = 'NVIDIA Corporation'
    device     = 'GP107GLM [Quadro P1000 Mobile]'
    class      = display
    subclass   = VGA
hdac0@pci0:1:0:1:    class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de device=0x0fb9 subvendor=0x0000 subdevice=0x0000
    vendor     = 'NVIDIA Corporation'
    device     = 'GP107GL High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA
%

Ignore about hdac0, as it's an audio driver for HDMI.

If the problem is that BusID (in the example above, 1:0:0, while to-be-ignored hdac0 has 1:0:1) is missingly recognized, you'll need to insert BusID "PCI:1:0:0" (for the example above, yours could be different) in your /usr/local/share/X11/xorg.conf.d/20-nvidia-drm-outputclass.conf, before EndSection line.
 
OK, I removed fbdev. I added "BusID PCI:1:0:0" to 20-nvidia-drm-outputclass.conf (as that was in fact the bus ID for my card). It throws the following error:

"BusID" is not a valid keyword for this section.

So I read some and realized I had to add a new section, which I did:

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

and I now get slightly different behavior. I still have a black screen, but I have a mouse pointer.

Next step?
 
It is exactly:

Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
option "PrimaryGPU" "yes"
ModulePath "/usr/local/lib/nvidia/xorg"
ModulePath "/usr/local/lib/xorg/modules"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

The OutputClass part was already there.
 
Thanks.

For identifier, try Card0 instead.
And in driver, try making it all uppercase.
Then try again, I don't know much about Nvidia things as I'm not user of it.
 
Same behavior.
Hmm, I see. Can you try following steps in this thread's first post?

 
Hmm, I see. Can you try following steps in this thread's first post?


Just doing that kills all graphics, including X. Doing that but then running:

> sudo nvidia-xconfig

brings me back to the original result: a black screen.
 
You dont need xorg config file like 20-nvidia.conf etc - you run Wayland not Xorg.
Sometimes Wayland + nVidia is an issue.
You say every Wayland compositor - have you tried Hyprland ? Have you tried to disable integrated gpu in the bios and use dedicated only ? can you ssh into your laptop when screen blank and check logs ?
Have you tried without these parameters
Code:
hw.nvidia.modeset="1"
hw.nvidiadrm.fbdev="1"
nvidia-settings wont work with Wayland as its Xorg only.
dbus-launch --exit-with-session ck-launch-session hyprland --config ~/.config/hypr/hyprland.conf 2>~/.hyprland.err >~/.hyprland.log
I used this command to start Hyprland and get errors / log - maybe you can adjust it to your needs for sway or something similar so you can find whats going on ?
 
"You say every Wayland compositor - have you tried Hyprland ? Have you tried to disable integrated gpu in the bios and use dedicated only ? can you ssh into your laptop when screen blank and check logs ?"

I have not tried Hyprland. My impression was that it was a more complex compositor, and hence likely to fail if others also failed.

I can, in fact, ssh into the machine when it goes to the black screen. I can also hit ctrl-f3 (or whatever) and get a new terminal console.

"Have you tried without these parameters "

I removed fbdev. I haven't tried it without modeset, because everything I have read indicates that it is absolutely required for the nvidia drivers to work. Is that incorrect?

"I used this command to start Hyprland and get errors / log - maybe you can adjust it to your needs for sway or something similar so you can find whats going on ?"

Yeah, a lack of logs from Wayland is clearly an issue. I'll try hyprland with the logging as you wrote above and report back.
 
use nvidia only not nvidia-drm then.
Wayland could hesitate to run without nvidia-drm.ko.

As without it, Wayland need to be sanely configured for nvidia proprietary driver and I cannot be sure how Wayland auto-detects nvidia propriatary driver, as both xorg and Wayland are developed (IIUC) under FreeDesktop.

And nvidia-drm should want hw.nvidia.modeset="1", as nvidia-drm.ko runs over nvidia-modeset.ko, and nvidia-modeset.ko runs over nvidia.ko.

The reason nvidia-drm.ko cannot be loaded/initialized is usually version mismatches between drivers and/or kernel (including LinuxKPI).
The only way to confirm is not using official pkg repo for nvidia-related ones and building/installing from ports locally, confirming /usr/src are 100% in sync with running kernel.
 
Wayland could hesitate to run without nvidia-drm.ko.

As without it, Wayland need to be sanely configured for nvidia proprietary driver and I cannot be sure how Wayland auto-detects nvidia propriatary driver, as both xorg and Wayland are developed (IIUC) under FreeDesktop.

And nvidia-drm should want hw.nvidia.modeset="1", as nvidia-drm.ko runs over nvidia-modeset.ko, and nvidia-modeset.ko runs over nvidia.ko.

The reason nvidia-drm.ko cannot be loaded/initialized is usually version mismatches between drivers and/or kernel (including LinuxKPI).
The only way to confirm is not using official pkg repo for nvidia-related ones and building/installing from ports locally, confirming /usr/src are 100% in sync with running kernel.
Thanks for the info ! I never used Wayland with nVidia and FreeBSD.
 
More data:

I can now see a message in /var/log/messages that says:

kernel: linker_load_file: /boot/modules/nvidia-drm.ko - unsupported file type

And ideas? I installed it using the nvidia-drm-kmod package. There's nothing odd about this system. I'm running FreeBSD 14.3, and did a fresh install today. Everything should be completely current.
 
Wayland could hesitate to run without nvidia-drm.ko.

As without it, Wayland need to be sanely configured for nvidia proprietary driver and I cannot be sure how Wayland auto-detects nvidia propriatary driver, as both xorg and Wayland are developed (IIUC) under FreeDesktop.

And nvidia-drm should want hw.nvidia.modeset="1", as nvidia-drm.ko runs over nvidia-modeset.ko, and nvidia-modeset.ko runs over nvidia.ko.

The reason nvidia-drm.ko cannot be loaded/initialized is usually version mismatches between drivers and/or kernel (including LinuxKPI).
The only way to confirm is not using official pkg repo for nvidia-related ones and building/installing from ports locally, confirming /usr/src are 100% in sync with running kernel.
I built the x11/nvidia-driver from the port and installed it. This made no difference, it still says "nvidia-drm.ko - unsupported file type"

I'm not sure how to confirm that my /usr/src is in sync with my running kernel, though.
 

pkg query -x '%v-%n' '^drm-(515|61)-kmod'

whats the output
and which nvidia you installed 515 ? 510 ? 61 ?
Maybe need to try older version like 510 or 515 instead of 61 or what ever the latest one is
 

pkg query -x '%v-%n' '^drm-(515|61)-kmod'

whats the output
and which nvidia you installed 515 ? 510 ? 61 ?
Maybe need to try older version like 510 or 515 instead of 61 or what ever the latest one is

> pkg query -x '%v-%n' '^drm-(515|61)-kmod'

6.1.128.1403000_5-drm-61-kmod

> uname -aK

FreeBSD home-server 14.3-RELEASE FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC amd64 1403000

I have mostly been trying 61 but I also tried 515, and it did not change the behavior. I also tried 575-devel, but it crashed my machine.
 
Back
Top