NVIDIA 470.74 + Xwayland on Ubuntu 21.10 and Gnome 40.3

This is guide, howto enable NVIDIA accelerated 3D rendering and Xwayland on Ubuntu 21.10 with NVIDIA 470.xx (470.74) proprietary drivers on GNOME 40.2. 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 470.74 drivers installed. Check also NVIDIA’s own guide for this OpenGL and Vulkan on Xwayland.

Check video version of guide:

Watch More Videos and Subscribe to
if-not-true-then-false.com Youtube Channel

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. Enable Xwayland with NVIDIA 470.74 proprietary drivers on Fedora 34 GNOME 40.3 desktop

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 21.10 BTRFS ##
GRUB_CMDLINE_LINUX="rhgb quiet rd.driver.blacklist=nouveau nvidia-drm.modeset=1"

6.3 Update grub2 conf

Ubuntu 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.

8 comments on “NVIDIA 470.74 + Xwayland on Ubuntu 21.10 and Gnome 40.3

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close