Enabling wayland on nvidia hardware!

This post assumes you are using proprietary Nvidia drivers and the grub bootloader that Manjaro installed. Tested on a desktop 2070 super with archlinux, Manjaro, kde, and gnome.

For anyone interested in enabling Wayland on NVIDIA. Source material can be found
* DRM kernel modesetting -ArchWiki and
** Preserve video memory after suspend -ArchWiki.

This is also where you should be able to find updated instructions in the future if manjaro maintains compatibility with the upstream distro.

First step is to enable DRM kernel mode setting. for GRUB it is in
/etc/default/grub under GRUB_CMDLINE_LINUX_DEFAULT=. Don’t delete anything just add
nvidia_drm.modeset=1

sudo nano /etc/default/grub
RUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="nvidia_drm.modeset=1 quiet <...> udev.log_priotity=3"
GRUB_CMDLINE_LINUX=""

After that you set module options for the nvidia module variable at
/etc/modprobe.d/nvidia-power-management.conf and add
options nvidia NVreg_PreserveVideoMemoryAllocations=1

nano /etc/modprobe.d/nvidia-power-management.conf
options nvidia NVreg_PreserveVideoMemoryAllocations=1

The next step is to add your modules to the initramfs by editing
/etc/mkinitcpio.conf and adding nvidia, nvidia_drm, nvidia_uvm, and nvidia_modeset to MODULES.

sudo nano /etc/mkinitcpio.conf
MODULES="crc32c nvidia nvidia_drm nvidia_uvm nvidia_modeset"

Then you generate initramfs to add the changes you have made.

sudo mkinitcpio -P

Now to generate grub.cfg

sudo grub-mkconfig -o /boot/grub/grub.cfg

Before rebooting, you need to enable the scripts that allow you to wake the system from suspend/hibernate using systemd.

nvidia-resume.service is required for gnome and its gdm display manager. It’s is strongly recommended not to use it with other desktops or display managers.
** Preserve video memory after suspend -ArchWiki for more info

sudo systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service

When you boot up you might notice the boot splash is animated for the first time and your login screen should have an option to choose Wayland if it’s not already selected.

For information on laptops with NVIDIA Optimus
hybrid graphics- Intel/AMD integrated gpu and Nvidia discreet gpu, please feel free to share your findings after exploring!
*** NVIDIA Optimus -ArchWiki

Cleaning up house, working around limitations
sorry for the mess, literally can’t do anything about this.

* DRM Kernel mode setting -ArchWiki
https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting

** Preserve video memory after suspend -ArchWiki
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend

*** Nvidia Optimus -ArchWiki
https://wiki.archlinux.org/title/NVIDIA_Optimus

1 Like

Welcome to the forum! :wave:

Did you search before posting? :male_detective: :mag_right:

If so, you would have found our existing tutorial:

There’s a reason for that. One must earn TL2 (Trust Level 2) before being able to post in certain areas of the forum. Otherwise any spammer could sign up, post garbage and create more work for our volunteer Moderators.

Note that I’ve moved your post to Feedback for better visibility and public discussion. Anything you think should be added to the existing tutorial will be considered.

With your level of enthusiasm right out of the gate, I’m sure you’ll reach TL2 in no time. One of the benefits is editing any wiki post. All Tutorials are. :wink:

1 Like

Thanks for replying, the whole reason I posted this is because that tutorial doesn’t work, atleast on my system.
I just applied the little experience I had using arch Linux on my main system to properly load kernel modules and satisfy the requirements needed for gnome and other desktops to support Wayland.

The tutorial your referencing is a sort of work around disabling checks as far as I can tell and it doesn’t seem to fix the wake from sleep video memory issue either. Not to discredit the original post, it could be the solution for other people. I’m not sure about how Nvidia optimus works for example.

I did want links to the archlinux wiki webpages in an attempt to give credit where due and allow people to find trouble shooting tips and alternative setups as well. article -section -source is where I intended to put those links.

What doesn’t work?

If what is specified in that tutorial is not done on GNOME, Wayland cannot be enabled at all due to upstream limitations for hyprid laptops. The tutorial was originally created with only GNOME in mind, but then a little more was added later.

Yes, you will need to provide links to your sources. See [HowTo] Post screenshots and links and edit your post to include them, please.