6. Enable Xwayland with NVIDIA 535.54.03 / 530.41.03 / 525.116.03 / 515.105.01 / 470.199.02 proprietary drivers on Debian / Ubuntu / Linux Mint

This is guide, howto enable NVIDIA accelerated 3D rendering and Xwayland on Ubuntu 22.04 / 21.10 with NVIDIA 535.xx (535.54.03) / 530.xx (530.41.03) / 525.xx (525.125.06) / 515.xx (515.65.01) / 470.xx (470.199.02) proprietary drivers on GNOME 42/41/40. Tested with latest NVIDIA drivers, I assume here that you have installed NVIDIA drivers using this guide. This might work normally with any other installation methods too, but it’s not tested. Note: Do this using fully updated system and latest kernel, also NVIDIA 535.54.03 / 530.41.03 / 525.125.06 / 515.105.01 / 470.199.02 drivers installed. Check also NVIDIA’s own guide for this OpenGL and Vulkan on Xwayland.

Check video version of guide:

Before you start you will at least following packages installed:

  • Xwayland >= 21.1.1.901
  • libxcb >= 1.13
  • egl-wayland >= 1.1.7

Check your packages using following command:

dpkg -l xwayland libxcb1 libnvidia-egl-wayland1

6.1 Change root user

su -
## OR ##
sudo -i

6.2 Edit /etc/default/grub

Append ‘nvidia-drm.modeset=1’ to end of ‘GRUB_CMDLINE_LINUX=”…”‘.

## Example row with Ubuntu 22.04 / 21.10 BTRFS ##
GRUB_CMDLINE_LINUX="rhgb quiet rd.driver.blacklist=nouveau nvidia-drm.modeset=1"

6.3 Update grub2 conf

Ubuntu 22.04 / 21.10

## Update grub config ##
update-grub2

6.4 Update /usr/lib/udev/rules.d/61-gdm.rules

Comment line which starts with DRIVER==”nvidia”:

# disable Wayland on Hi1710 chipsets
ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
# disable Wayland when using the proprietary nvidia driver
#DRIVER=="nvidia", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
# disable Wayland if modesetting is disabled
IMPORT{cmdline}="nomodeset", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"

6.5 Generate initramfs

## Backup old initramfs nvidia-nomodeset image ##
mv /boot/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r)-nvidia-nomodeset.img
## Generate new initramfs image ##
dracut -q /boot/initrd.img-$(uname -r) $(uname -r)

6.6 Enable kms-modifiers through gsettings (as normal user)

gsettings set org.gnome.mutter experimental-features [\"kms-modifiers\"]

6.7 Reboot

reboot

When you system boot you should be able to select GNOME Wayland session, login using it and open terminal and type:

echo $XDG_SESSION_TYPE

Output should be Wayland.