[Howto] Use wayland with propietary nvidia drivers

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 5:
    • 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!

https://forum.manjaro.org/t/howto-use-wayland-with-propietary-nvidia-drivers/36130

manjaro安装配置intel+nvidia双显卡

安装驱动之前先卸载现在的驱动,否则很可能会冲突。

显示所有可安装的驱动:

mhwd -l --pci

显示当前已安装驱动:

mhwd -li --pci

卸载当前驱动:

sudo mhwd -r pci [driver-name]

安装依赖:

sudo pacman -S virtualgl lib32-virtualgl lib32-primus primus

安装nvidia闭源驱动与intel驱动混合版bumblebee:

sudo mhwd -f -i pci video-hybrid-intel-nvidia-430xx-bumblebee

启用bumblebeed服务:

sudo systemctl enable bumblebeed

将用户添加到bumblebee组:

sudo gpasswd -a $USER bumblebee

重启后遇到需要独立显卡的部分使用:

optirun [appname]