I have a Dell Inspiron 7577 laptop with nVIDIA GeForce GTX 1060 with max-Q design and integrated Intel GPU, running Ubuntu 21.04. It has a HiDPI screen 3840x2160 and I use fractional scaling at 175% with Gnome. nVIDIA driver is latest 465.24.02 from https://launchpad.net/~oem-solutions-group/+archive/ubuntu/nvidia-driver-staging?field.series_filter=hirsute

What are the steps to run Wayland on 21.04 with optimus nVIDIA?

2 Answers 2


The settings I adapted are:

  • add to /etc/modprobe.d/nvidia-graphics-drivers.conf:

    options nvidia_drm modeset=1
  • ensure #WaylandEnable=false is commented in /etc/gdm3/custom.conf

  • comment all lines with # in /usr/lib/udev/rules.d/61-gdm.rules

  • reboot and select "Gnome" (not "Gnome on Xorg") with cogwheel in login screen

  • check (output should be wayland):


My experience with Wayland:

Matlab and VMWare Workstation Player complain about missing OpenGL hardware acceleration. But overall I am very happy with Wayland. No special tricks needed for many applications like Spotify and Matlab which previously did not scale in Xorg. With Wayland Matlab scales perfectly out of the box. Also resume from suspend to RAM now works for the first time on this laptop. Though it takes 1 minute 45 seconds from power button to lock screen. VLC full screen also works great, previously not possible in Xorg.

Waiting for NVIDIA 470 series to have OpenGL hardware acceleration.

Up to now I only have one issue: connecting an external monitor to the HDMI connector freezes Ubuntu completely. Nothing is shown on the external monitor and power button hard reset is the only option.

I made a post on the nVIDIA linux forum: https://forums.developer.nvidia.com/t/465-24-02-ubuntu-21-04-wayland-no-external-monitor/176747

[EDIT] I found out that the Intel GPU is driving the display and that is what most probably causes a successful resume from suspend to RAM. But nVIDIA can be used for CUDA calculations via Matlab and Mathematica and also via Jupyter Notebook and libcudnn8. So nVIDIA GPU is available but does not drive the screen and that is most probably why connecting an external monitor leads to Ubuntu freeze. Even though:

prime-select query

Does anybody know how to let Ubuntu Gnome on Wayland choose the nVIDIA GPU to drive the laptop display?

  • +1 but would like to see some explanations to the first part of your answer. (why are these settings necessary and what they do)
    – Bruni
    May 1, 2021 at 15:52
  • If you have follow-up questions, please post them as a new question instead of editing an answer
    – muru
    May 6, 2021 at 18:15
  • It doesn't seem to work in few cases. GDM3 launches into wayland but the display is still being driven by intel whereas on xorg session it is driven by nvidia. Strange Jul 12, 2021 at 16:11
  • This is essentially an alpha build of Wayland, and ubuntu is still using xwayland afaik. We're not going to see full functionality until first, waylwand figures out their security protocol to allow surfaces to communicate... Essentially we'll get another VNC... Second, xwayland just isn't going to cut it. It's good for now to give people a preview, but what is eventually going to happen is full integration, not interop. Nvidia has, though, said they are willing to support wayland.... We will see. The Vulkan community is also pretty active in getting their frameworks up and running with it. Aug 22, 2021 at 5:48
  • My GTX 1060 mobile also leads to Ubuntu freeze using 2 monitors and wayland. Also, after upgrade to 21.10 I got a white-screen after logon informing "something went wrong" and I wasn't able to logon using waylang (only gets to work setting the grub nvidia_drm modeset). Currently I'm using X11 :(
    – Beto Neto
    Oct 17, 2021 at 11:22

This is a semi-answer to the answer to the asked question but this is also part of the question.

On ArchLinux there's a utility called "nvidia-xrun" which you can launch instead of "startx" in order to run an X server with discrete Nvidia graphics, NOT Intel. Here's the source code: https://github.com/Witko/nvidia-xrun/blob/master/nvidia-xrun

I did a quick test, ran nvidia-xrun gnome-session and glxinfo|egrep "OpenGL vendor|OpenGL renderer" showed Nvidia.

It is indicative of the required steps to have NVIDIA GPU drive a display server, which is probably going to be conceptually analogous for Wayland, at least in terms of dealing with the hardware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.