14

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?

4 Answers4

17

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.

3

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.

1

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.

John Kelly
  • 11
  • 1
0

So… This is for sure a hack, but if your intention is to run Gnome with Wayland with Nvidia, why not skip the safety checks and always start Gnome with Wayland enabled?…

In this file: /lib/udev/rules.d/61-gdm.rules at or near line 84, is the logic for what to do if the tests don’t pass…

LABEL="gdm_disable_wayland"
RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
GOTO="gdm_end"

One can change it to ‘Always Enable Wayland’ by changing ‘false’ to ‘true’:

RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable true"

Save the config, do a reboot and you should be in Gnome with Wayland instead of X11.

This makes the tests/checks always pass. You can do this without loading modules, changing kernel parameters, editing grub, etc.

It’s a simple hack. A good place to start. ‘Why not’ is not to be taken literally, I don’t need a reply about the dangers… Runs great, hibernate, suspend, etc. without even needing to mess with the methods mentioned here:

https://wiki.debian.org/NvidiaGraphicsDrivers#Wayland

Also, try those methods if the hack doesn’t work, these are literally the steps to pass the tests…