How to Enable Wayland for Hybrid NVIDIA Graphics on Fedora Linux 38 Workstation

Fedora Wayland

A recent upgrade to Fedora Linux 38 apparently disabled Wayland for my hybrid NVIDIA graphics machine, so here’s a quick tutorial on how to enable Wayland and also bring back the GNOME on Xorg option on the login screen.

I was a happy Wayland user for a long time now, even if I have a hybrid NVIDIA graphics system. I usually like to use the internal AMD graphics when I don’t play games for better battery life, so Wayland is my default session. I like to use Wayland because there are a few advantages over X11, such as pinch-to-zoom in Firefox.

As you may know, my main machine is a hybrid NVIDIA graphics laptop with an AMD Ryzen CPU and a dedicated NVIDIA GeForce GTX 1650 Ti GPU. Recently, I discovered that I am not using Wayland anymore as my system falls back to X11 even if I am using the integrated AMD GPU.

I didn’t even notice this change until recently when a reader expressed his opinion on my Fedora Linux system using X11 as the default session. Something must have happened after upgrading to Fedora Linux 38 during the beta phase because I was using Wayland by default on Fedora Linux 37 with GNOME 43 without issues.

On top of that, Fedora Linux 37 showed several options on the login screen (GDM), such as GNOME (Wayland), GNOME on Xorg, GNOME Classic, GNOME Classic on Xorg, and other graphical environments that I had installed like Sway. These are now all gone!

The problem

After upgrading to Fedora Linux 38 (Workstation), only the GNOME and GNOME Classic options were listed on the login screen’s sessions list, both using X11, for some reason, instead of Wayland. I should also note the fact that I’ve been always using the NVIDIA graphics drivers from RPM Fusion, not the vendor drivers.

So, I tried to find out what was going on by ensuring that I am actually using the AMD GPU, then looking into the /etc/gdm/custom.conf file to see if maybe WaylandEnable=true wasn’t enabled and if the nvidia-drm.modeset=1 kernel parameter was set in the GRUB bootloader. But the problem wasn’t there.

The solution

So I searched the Web and found a solution on the Fedora Discussion forums, which is actually very simple (at least for me). This solution not only re-enables Wayland by default but it also brings back all the graphical session options on the login screen.

All I had to do is to copy the /usr/lib/udev/rules.d/61-gdm.rules file to /etc/udev/rules.d/ and comment out a single line. To do that, open a Terminal window and paste the commands below.

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

Now, all you have to do is to comment out the entire # Check if suspend/resume services necessary for working wayland support is available section by adding an # in front of each line. It should look like this:

# Check if suspend/resume services necessary for working wayland support is available
#TEST{0711}!="/usr/bin/nvidia-sleep.sh", GOTO="gdm_disable_wayland"
#TEST{0711}!="/usr/lib/systemd/system-sleep/nvidia", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c \"sed -e 's/: /=/g' -e 's/\([^[:upper:]]\)\([[:upper:]]\)/\1_\2/g' -e 's/[[:lower:]]/\U&/g' -e 's/^/NVIDIA_/' /p>
#ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS}!="1", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_HIBERNATE=`systemctl is-enabled nvidia-hibernate`'"
#ENV{NVIDIA_HIBERNATE}!="enabled", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_RESUME=`systemctl is-enabled nvidia-resume`'"
#ENV{NVIDIA_RESUME}!="enabled", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_SUSPEND=`systemctl is-enabled nvidia-suspend`'"
#ENV{NVIDIA_SUSPEND}!="enabled", GOTO="gdm_disable_wayland"
#LABEL="gdm_nvidia_end"

Now save the file with CTRL+O and Enter, and close it with CTRL+X.

This solution is not new and it’s related to this bug from GNOME 43, which was resolved at that time. But I had to bring it back into the spotlight for other Fedora Linux 38 (Workstation) users out there experiencing the same issue as me.

It would appear that this was done intentionally on Fedora Linux 38 to prevent sleep/hibernate issues on certain systems using NVIDIA GPUs, but I never had an issue with my laptop resuming from sleep. As such, if you encounter any sleep/hibernate issues after re-enabling the Wayland session, revert the changes made to the 61-gdm.rules file.

Last updated 9 months ago

Buy Me a Coffee at ko-fi.com