Score:13

How do I enable Wayland on Ubuntu 21.10 (NVIDIA)?

cn flag

I installed Ubuntu 21.10 on my laptop today, but I'm still not seeing the option on the login screen to use Wayland instead of X11. I've really been looking forward to getting GNOME 40 with multi-touch support.

As I understand it, Ubuntu 21.10 is supposed to bring Wayland support to computers with NVIDIA drivers (I'm running version 470.74). Does anybody know how to get this functionality added?

ChanganAuto avatar
us flag
This answer https://askubuntu.com/a/1334826/1210606 may give you an idea on how to enable it and what to expect.
Score:14
cn flag

I can see in the "/lib/udev/rules.d/61-gdm.rules" file that there are still a few things that can prevent Wayland from being selectable at the login screen (GDM):

  1. the system is running on a PC with the Hi1710 chipset
  2. kernel modesetting is disabled
  3. the "nvidia-drm" modeset is disabled
  4. the system's NVIDIA driver version is lower than 470

Through manual testing, I have determined that my problem was that the "nvidia-drm" modeset was disabled. The best way I have found so far to remedy the situation is by adding the following to the "/etc/default/grub" file:

GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

Lastly, run "sudo update-grub" to write your changes out to your system's GRUB configuration file (/boot/grub/grub.cfg) and reboot.

Note: To actually use Wayland, you will need to manually select it if it isn't already the default on your system. On Ubuntu, this can be done at the login screen by first selecting the desired user and then clicking on the gear icon in the lower right-hand corner of the screen. If no gear icon is visible, Wayland is not available on your system in its current configuration. If this is the case, check to verify that none of the other issues listed above are to blame.


Although the steps above were all that was required to get hardware-accelerated Wayland running on my laptop, I later discovered that a separate Ubuntu installation on my home desktop was still using software rendering—as opposed to GPU-accelerated rendering—for programs running under XWayland (i.e. most games).

This can be fixed by adding the "universe" repository to APT (as it's not currently available in "main", the Canonoical-supported repo), and then running:

sudo apt install libnvidia-egl-wayland1

This has caused some applications to behave unexpectedly in my experience, but it has also fixed my hardware rendering issues.

BertRAMAerts avatar
ru flag
Thank you! On my Lenovo Legion 5 15IMH05H 81Y6 laptop with nVIDIA GeForce RTX 2060 running Ubuntu 21.10 with nVIDIA proprietary driver 470.74 and after setting the GRUB_CMDLINE_LINUX I could indeed start Gnome in Wayland. But according to me we are not there yet: the nVIDIA settings is an empty window and resuming from suspend to RAM is impossible: screen is not usable, I had to CTRL-ALT-F6 and type "sudo reboot now".
BertRAMAerts avatar
ru flag
Also with this nvidia-drm.modeset=1 and using Gnome on X11, the trick to enable brightness control of https://askubuntu.com/questions/1293159/lenovo-legion-5-15imh05h-brightness-control-problem no longer works. I can not change the brightness of the screen anymore. I am talking about the solution with Option "RegistryDwords" "EnableBrightnessControl=1" here.
BertRAMAerts avatar
ru flag
The brightness in X11 Gnome while kernel parameter modeset=1 is used is working again via extra kernel parameters: cd /etc/default sudo gedit grub GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1 acpi_backlight=native nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1" sudo update-grub
in flag
Doesn't work for my Ryzen 5900HX+RTX 3070 combination. When hybrid mode selected in BIOS, only Ryzen's GPU is used for Wayland. When "dGPU only" is selected, I can select wayland, but it falls back to software rendering.
jp flag
Thank you so much! Finally NVIDEA users can run stable Wayland with Pipewire. It's a great evolution for Linux World. No more X11, PulseAudio and Jack!
JustALawnGnome7 avatar
cn flag
@Piotrek M. Are you sure you’re running the latest version of NVIDIA’s proprietary driver? You need to be running at least version 470 in order to get proper Open GL hardware rendering in XWayland.
in flag
Yes – I'll answer the question, as I've already found out
nonNumericalFloat avatar
vc flag
In which ppa repository can I find this package? I still get a `has no available installation candidate`
JustALawnGnome7 avatar
cn flag
Like I said, the 'libnvidia-egl-wayland1" package is in the "universe" repository. You can add it by typing "sudo add-apt-repository universe" into a terminal.
Score:2
in flag

In my case the answer was:

sudo apt install libnvidia-egl-wayland1

For some reason this package is not installed automatically, so unless you install it manually, NVidia + Wayland won't work.

BertRAMAerts avatar
ru flag
According to nVIDIA https://us.download.nvidia.com/XFree86/Linux-x86_64/470.74/README/xwayland.html requirements this package libnvidia-egl-wayland1 is indeed needed, I also had to install it manually. It was not installed during the upgrade to Ubuntu 21.10. And this webpage also lists the fact that "NVIDIA X Server Settings" app is not working in Wayland as one of the limitations.
Score:1
cn flag

On the login screen, click on the settings icon at the bottom right-hand corner. Ensure "Ubuntu" is ticked and then log in as normal. This should log you into Wayland and not x11.

JustALawnGnome7 avatar
cn flag
Yeah, I know what the icon is you're referring to--it's just not showing up for me. I'm trying to figure out what changes I need to make to enable the option.
id flag
cmr
@JustALawnGnome7 the icon/button is only showing when you selected a user (when the password text input is active.
JustALawnGnome7 avatar
cn flag
@cmr yes, I know that the button only appears when a user is selected. The icon was ultimately not appearing for me because the "nvidia-drm" modeset was not enabled.
in flag
It did, but falled back to software rendering then.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.