If you are having issues running Wyaland with an Nvidia GPU, check to make sure you have all the needed settings for Wayland.
- In the
/etc/environment
file:
a. For Systems with just an Nvidia Card:
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
#This is so QT applications run properly
QT_QPA_PLATFORMTHEME="wayland;xcb"
# This is here to make nvidia play nice. Open Source your drivers.
QT_QPA_PLATFORMTHEME="wayland;xcb"
GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
ENABLE_VKBASALT=1
LIBVA_DRIVER_NAME=nvidia
# just in case you loose the hardware cursor
WLR_NO_HARDWARE_CURSORS=1
b. If you have an Optimus Laptop
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
#This is so QT applications run properly
QT_QPA_PLATFORMTHEME="wayland;xcb"
# This is here to make nvidia play nice. Open Source your drivers.
GBM_BACKEND=nvidia-drm
DRI_PRIME=pci-0000_01_00_0
__VK_LAYER_NV_optimus=NVIDIA_only
__GLX_VENDOR_LIBRARY_NAME=nvidia
ENABLE_VKBASALT=1
LIBVA_DRIVER_NAME=nvidia
__NV_PRIME_RENDER_OFFLOAD=1
# just in case you loose the hardware cursor
WLR_NO_HARDWARE_CURSORS=1
- Make sure you have the proper Modules being loaded in either
mkinitcpio.conf
or your drop in file indracut.conf.d
nvidia nvidia_modeset nvidia_uvm nvidia_drm
- Finally, make sure you have the Direct Render Manager (DRM) set to use Nvidia. In
/etc/default/grub
make sure you have the following in theGRUB_CMDLINE_LINUX_DEFAULT=
line.
nvidia-drm.modeset=1
Using the above settings, I have not had any issues running Wayland with the Nvidia Optimus setup on my Laptop. If after trying out Wayland using your Nvidia card, you want to go back to using X11, you do not need to remove these settings. X11 will ignore them because it uses a different set of configuration files. I have successfully gone back and forth between X11 and Wayland without any issues.