Loading

Use Wayland with proprietary NVIDIA drivers

原文地址: https://forum.manjaro.org/t/howto-use-wayland-with-proprietary-nvidia-drivers/36130

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 驱动程序一起使用。操作方法如下:

:warning: If not using GNOME, skip to DE (Desktop Environment)-agnostic instructions in Step 4 :
:warning: 如果不使用 GNOME,请跳到步骤 4 中与 DE(桌面环境)无关的说明:

  1. Edit the /etc/gdm/custom.conf file and comment out the line WaylandEnable=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
    
  2. 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
    
  3. kms-modifiers must be enabled through gsettings. 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(桌面环境)无关的指令从这里开始

  4. 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 and nvidia_drm to /etc/mkinitcpio.conf and run the command sudo mkinitcpio -P
      将模块 nvidianvidia_modesetnvidia_uvmnvidia_drm 添加到 /etc/mkinitcpio.conf 并运行命令 sudo mkinitcpio -P
    • Add the kernel parameter nvidia-drm.modeset=1 to /etc/default/grub and run the command sudo update-grub
      将内核参数 nvidia-drm.modeset=1 添加到 /etc/default/grub 中并运行命令 sudo update-grub
  5. Ensure xorg-xwayland, libxcb and egl-wayland are installed:
    确保安装了 xorg-xwaylandlibxcbegl-wayland

    sudo pacman -Syu --needed xorg-xwayland libxcb egl-wayland
    
  6. Reboot 重启

  7. Profit. Congratulations, you should now be running GNOME with Wayland despite proprietary NVIDIA drivers!
    利润。恭喜,尽管有专有的 NVIDIA 驱动程序,您现在应该可以通过 Wayland 运行 GNOME!

posted @ 2024-02-15 16:29  程序设计实验室  阅读(206)  评论(0编辑  收藏  举报