PSA: If you have an NVIDIA Optimus laptop and upgrade to F37 Beta, Wayland is currently disabled by default

Just a quick heads-up for possible beta testers out there, like me. After updating to GNOME 43 there’s a new check for GDM to see if it’ll make the option to log in on a Wayland session available, which checks for NVIDIA Optimus laptops specifically. If it detects you have one, it’ll fall back to an X11 session, which I really don’t understand why it would do, considering having an iGPU on these laptops makes the Wayland experience as best as possible.

It lies under /usr/lib/udev/rules.d/61-gdm-rules, a file which older NVIDIA+GNOME users might be familiar with. All you have to do currently to get a Wayland session back is comment (add # to the start of each line, for those who are unfamilliar) the following lines:

# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland
LABEL="gdm_hybrid_nvidia_laptop_check" TEST!="/run/udev/gdm-machine-is-laptop", GOTO="gdm_hybrid_nvidia_laptop_check_end"
TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_hybrid_nvidia_laptop_check_end"
TEST!="/run/udev/gdm-machine-has-vendor-nvidia-driver", GOTO="gdm_hybrid_nvidia_laptop_check_end"
GOTO="gdm_disable_wayland"
LABEL="gdm_hybrid_nvidia_laptop_check_end"

So it’ll look like this:

# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland
# LABEL="gdm_hybrid_nvidia_laptop_check"
# TEST!="/run/udev/gdm-machine-is-laptop", GOTO="gdm_hybrid_nvidia_laptop_check_end"
# TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_hybrid_nvidia_laptop_check_end"
# TEST!="/run/udev/gdm-machine-has-vendor-nvidia-driver", GOTO="gdm_hybrid_nvidia_laptop_check_end"
# GOTO="gdm_disable_wayland"
# LABEL="gdm_hybrid_nvidia_laptop_check_end"

Hopefully this is just a bug and not a permanent decision, but in the meanwhile, this is the fix. Just popped here to post this so someone else doesn’t have to figure it out by themselves like I did.

1 Like

I didn’t know what caused the deactivation of Wayland on my system, your fix didn’t help. Because I’m lazy, I just brute forced it:

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

Just as an FYI, for us Silverblue users you cannot edit the gdm rules directly. Instead you first have to copy the gdm rules to /etc/udev/rules.d like so:

cp /usr/lib/udev/rules.d/61-gdm.rules /etc/udev/rules.d

And then you can edit the file that you copied to etc. Typically like:
sudo nano /etc/udev/rules.d/61-gdm.rules

Otherwise it works exactly the same as suggested. I’m really hoping they revert this decision or at the very least don’t disable Wayland by default but leave it as an option like Xorg was in Fedora 36. Wayland works way better with dual monitors for me, libadwaita applications literally freeze on my external screen while using Xorg. Also the touchpad gestures are like 80% of what makes Gnome so great on a laptop, having that disabled by default really cheapens the experience for new users.

To be fair, this is the best method to do it, ideally users shouldn’t go changing stuff around on /usr.

The “correct” fix is to replace

GOTO="gdm_disable_wayland"

with

GOTO="gdm_prefer_xorg"

as per 2128910 – NVIDIA Wayland Session Not Available in GDM 43

1 Like