Cannot run Wayland session under Nvidia proprietary drivers no matter what

Hello, i am having a really hard time trying to switch from X11 to Wayland. (even on other distros: Arch, Debian… etc). it just wouldn’t work, starting a wayland session either freezes my system or it gives me a black screen (but everything is working well under the black screen because i can still hear notifcations etc…).

I switched to Fedora because Wayland is supposed to be the default display server and i thought maybe it’s more optimized on it and will somehow fix my issue, well i guess not.

I just installed Fedora 35, then installed the proprietary Nvidia drivers (akmod-nvidia) using the RPM Fusion repository.
I made sure that Nvidia DRM, Xwayland, libxcb, egl-wayland are enabled.
But when i try to start a Wayland session from GDM, it fails and returns back to the GDM interface (but the text becomes glitched)

Here i will post my specs and configs hoping it will help debug the issue.

My GPU:

lspci |grep -E "VGA|3D"
01:00.0 VGA compatible controller: NVIDIA Corporation TU116 [GeForce GTX 1660 SUPER] (rev a1)

Driver version:
image

Wayland and its related packages are installed:

[exilvm@fedora ~]$ dnf list installed xorg-x11-server-Xwayland libxcb egl-wayland
Installed Packages
egl-wayland.x86_64                          1.1.9-3.fc35               @updates 
libxcb.x86_64                               1.13.1-8.fc35              @anaconda
xorg-x11-server-Xwayland.x86_64             21.1.4-1.fc35              @updates 

Nvidia DRM is turned on:

[exilvm@fedora ~]$ sudo cat /sys/module/nvidia_drm/parameters/modeset
Y

The Nvidia drivers package from RPM fusion added Kernel entries to blacklist the Nouveau drivers and enable DRM but as you can see it made some entries repeated twice.

[exilvm@fedora ~]$ cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rd.luks.uuid=((removed)) rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

My GDM configs (I haven’t changed anything)

[exilvm@fedora ~]$ cat nano /etc/gdm/custom.conf
cat: nano: No such file or directory
# GDM configuration storage

[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true

[exilvm@fedora ~]$ cat /etc/gdm/custom.conf
# GDM configuration storage

[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true
[exilvm@fedora ~]$ cat /usr/lib/udev/rules.d/61-gdm.rules
# disable Wayland on Hi1710 chipsets
ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", GOTO="gdm_disable_wayland"

# disable Wayland if modesetting is disabled
KERNEL!="card[0-9]*", GOTO="gdm_nomodeset_end"
SUBSYSTEM!="drm", GOTO="gdm_nomodeset_end"
# but keep it enabled for simple framebuffer drivers
DRIVERS=="simple-framebuffer", GOTO="gdm_nomodeset_end"
IMPORT{cmdline}="nomodeset", GOTO="gdm_disable_wayland"
LABEL="gdm_nomodeset_end"

# Disable wayland when nvidia modeset is disabled or when drivers are a lower
# version than 470, in any case always prefer Xorg
KERNEL!="nvidia_drm", GOTO="gdm_nvidia_drm_end"
SUBSYSTEM!="module", GOTO="gdm_nvidia_drm_end"
ACTION!="add", GOTO="gdm_nvidia_drm_end"
# disable wayland if nvidia-drm modeset is not enabled
ATTR{parameters/modeset}!="Y", GOTO="gdm_disable_wayland"
# disable wayland for nvidia drivers versions lower than 470
ATTR{version}=="4[0-6][0-9].*|[0-3][0-9][0-9].*|[0-9][0-9].*|[0-9].*", GOTO="gdm_disable_wayland"
GOTO="gdm_prefer_xorg"
LABEL="gdm_nvidia_drm_end"

GOTO="gdm_end"

LABEL="gdm_prefer_xorg"
RUN+="/usr/libexec/gdm-runtime-config set daemon PreferredDisplayServer xorg"
GOTO="gdm_end"

LABEL="gdm_disable_wayland"
RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
GOTO="gdm_end"

LABEL="gdm_end"

I appreciate your help.

Welcome to ask :fedora: community
Yes due to nvidia drivers are not open source and wayland is far more modern so it is not optimized for proprietary Nvidia drivers so i will recommend stay with x11 atleast for f36 release it and it should improve that and maybe you can use wayland with proprietary Nvidia drivers.
A lots of work has been put into making wayland stable in f36 so you have to wait for.

Edit - here is a link
https://fedoraproject.org/wiki/Releases/36/ChangeSet#Wayland_By_Default_with_NVIDIA_proprietary_Driver

Thanks for your input.
When i unplugged my second monitor, Wayland worked properly, is Wayland incompatible with multi-monitor setups?

I don’t have multi monitor setup so i don’t know but i think it works maybe

1 Like

Hi, I would like to know what connection use for external monitor? HDMI, display port, usb to HDMI/Display port, or something like dock?

DP. (and i’m using a DP to VGA adapter because my second monitor is an old model and has a single input port and that is VGA).

There a file ~/.config/monitor.xml that contain your current monitor setup. If we delete it (or move it somewhere as backup) each time we logout and login, it will create a new one. You can test it to get new config (please don’t connect your second monitor yet).

After logout and login, check if the new ~/.config/monitor.xml already created. After that, open Gnome Settings → Display then connect your second monitor.

The file does not exist, i even tried re-logging.

Open Gnome-settings → display then create some changes (like lowering the resolution) and apply. It should create the new one.

After connecting the second monitor, gnome detected it, the display worked for like 3 seconds and then gnome crashed and returned to GDM.

Can you get login again with monitor disconnected?

Unfortunately look like for multi monitors setup, you still need to use xorg. There already lot reports about same experiences as yours.

If you able to login again after disconnecting the second montor, would you like to share the content of monitor.xml and result of lsmod | grep drm?

posted in error