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.
Wayland 不能很好地与专有驱动程序配合使用。目前最大的问题是 NVIDIA 目前无法正确支持 Xwayland,因此需要它的应用程序将获得软件渲染。这包括大多数游戏,它们是专有 NVIDIA 驱动程序最常见的用例。这就是为什么如果您有 NVIDIA,GNOME 会自动禁用 Wayland。
However, if this does not deter you, you can use Wayland with NVIDIA drivers. Here is how to do it:
但是,如果这不妨碍您,您可以将 Wayland 与 NVIDIA 驱动程序一起使用。操作方法如下:
If not using GNOME, skip to DE (Desktop Environment)-agnostic instructions in Step 4 :
如果不使用 GNOME,请跳到步骤 4 中与 DE(桌面环境)无关的说明:
-
Edit the
/etc/gdm/custom.conf
file and comment out the lineWaylandEnable=false
. The correct file will then look something like this:
编辑/etc/gdm/custom.conf
文件并注释掉WaylandEnable=false
行。正确的文件将如下所示:# 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
-
To force-enable Wayland, disable the udev 179 rule responsible for disabling Wayland in GDM:
要强制启用 Wayland,请禁用负责在 GDM 中禁用 Wayland 的 udev179 规则:sudo ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
-
kms-modifiers
must be enabled throughgsettings
. This can be done with the following command:
kms-modifiers
必须通过gsettings
启用。这可以通过以下命令来完成:gsettings set org.gnome.mutter experimental-features '["kms-modifiers"]'
DE(Desktop Environment)-agnostic instructions begin here DE(桌面环境)无关的指令从这里开始
-
Enable modesetting for nvdia drivers. Follow the instructions in the Arch wiki 1.9k:
为 nvdia 驱动程序启用模式设置。按照 Arch wiki1.9k 中的说明进行操作:- Add the modules
nvidia
,nvidia_modeset
,nvidia_uvm
andnvidia_drm
to/etc/mkinitcpio.conf
and run the commandsudo mkinitcpio -P
将模块nvidia
、nvidia_modeset
、nvidia_uvm
和nvidia_drm
添加到/etc/mkinitcpio.conf
并运行命令sudo mkinitcpio -P
- Add the kernel parameter
nvidia-drm.modeset=1
to/etc/default/grub
and run the commandsudo update-grub
将内核参数nvidia-drm.modeset=1
添加到/etc/default/grub
中并运行命令sudo update-grub
- Add the modules
-
Ensure
xorg-xwayland
,libxcb
andegl-wayland
are installed:
确保安装了xorg-xwayland
、libxcb
和egl-wayland
:sudo pacman -Syu --needed xorg-xwayland libxcb egl-wayland
-
Reboot 重启
-
Profit. Congratulations, you should now be running GNOME with Wayland despite proprietary NVIDIA drivers!
利润。恭喜,尽管有专有的 NVIDIA 驱动程序,您现在应该可以通过 Wayland 运行 GNOME!