[Howto] Use wayland with propietary nvidia drivers

Difficulty: ★★★☆☆

Wayland does not play well with proprietary drivers. Currently the biggest issue is that nvidia does currently not support Xwayland properly, so apps that require it get software rendering. This includes most games, which are the most common use case for proprietary nvidia drivers. This is why gnome automatically disables Wayland if you have nvidia.

However, if this does not deter you, you can use Wayland with nvidia drivers. Here is how to do it:

  1. Edit the /etc/gdm/custom.conf file and comment out the line WaylandEnable=false. The correct file will then look something like this:

    # GDM configuration storage
    daemon]
    # Uncomment the line below to force the login screen to use Xorg
    #WaylandEnable=false
    
    [security]
    
    [xdmcp]
    
    [chooser]
    
    [debug]
    # Uncomment the line below to turn on debugging
    #Enable=true
    
  2. Now for the nvidia specific part: edit the file /usr/lib/udev/rules.d/61-gdm.rules and comment out the lines that disable wayland for nvidia. Note that this file gets overwritten by updates. The correct file looks something like this:

    # disable Wayland on Hi1710 chipsets
    ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="/usr/lib/gdm-disable-wayland"
    # disable Wayland when using the proprietary nvidia driver
    #DRIVER=="nvidia", RUN+="/usr/lib/gdm-disable-wayland"
    # disable Wayland if modesetting is disabled
    #IMPORT{cmdline}="nomodeset", RUN+="/usr/lib/gdm-disable-wayland"
    
  3. Enable modesetting for nvdia drivers. Follow the instructions in the Arch wiki:

    • Add the modules nvidia , nvidia_modeset , nvidia_uvm and nvidia_drm to /etc/mkinitcpio.conf and run the command sudo mkinitcpio -P
    • Add the kernel parameter nvidia-drm.modeset=1 to /etc/default/grub and run the command sudo update-grub
  4. Reboot

  5. Profit. Congratulations, you should now be running gnome with wayland despite propietary nvidia drivers!

5 Likes

It is being worked on here

But its way above my head and no idea how long or if it will ever be a viable option

I know, I’m hoping it gets finished soon.

1 Like

Shouldn’t this be better uncommented? :wink:

Wayland for Nvidia drivers is disabled using udev rules

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

commenting the below line works for me

# disable Wayland when using the proprietary nvidia driver
DRIVER==“nvidia”, RUN+="/usr/lib/gdm-disable-wayland"

What are the benefits using Wayland on KDE?

No idea. This guide will not work with kde, it is for gnome specifically. Also, unlike gnome, kde is not necessarily usable on wayland.