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

2 Likes

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.

nexussapphire thank you very much.

Main problem was for me that with nvidia and gnome, google account login freezes.
And the best option is to enable wayland connect google account, and then switch back.

It was very hard to find, such a good and fresh manual.

Just to add for newbies like me.
With command nano, use SUDO. It was missed in one command.

sudo nano /etc/modprobe.d/nvidia-power-management.conf

Second to save changes that were made in terminal, just click ctrl+X

Thank you this worked perfectly for me!

I’m trying to get my system ready for VRR, HDR, and fractional scaling. I have a 4k display, desktop CPU, desktop GPU, and updated nvidia drivers (545) and Manjaro kept defaulting to x11.

I followed all of these arch tutorials without any luck:

GDM#Wayland_and_the_proprietary_NVIDIA_driver
GDM#GDM_ignores_Wayland_and_uses_X.Org_by_default
GNOME#Wayland_sessions
HiDPI#GNOME

I’m thrilled to say I’m now running 125% scaling on my 4k display which is a perfect compromise. 100% - the text was too small and 200% - everything felt like it was 720P again with hardly any screen real estate.

Unfortunately I’m not knowledgeable enough to know exactly what about this tutorial works and the arch tutorials don’t.

For instance, the arch tutorials call out creating a .conf file in /etc/modprobe.d however this tutorial says to inject it at grub during bootup.

cat nvidia_drm.conf                                                                                                                        ✔ 
options nvidia_drm modeset=1
options nvidia_drm fbdev=1

That said, there was one more modprobe file from the arch wiki that I think I missed looking back which this tutorial includes:

cat nvidia-power-management.conf                                                                                                          
options nvidia NVreg_PreserveVideoMemoryAllocations=1

Does anyone happen to know if we need to add options nvidia_drm fbdev=1 to the GRUB startup command as well?