Compositor issue after wake from suspend on Nvidia

I’m on Wayland with an Nvidia card. After a suspend session the PC wakes with distortions on open windows and issues focussing on the right window, sometimes everything is black. I have to log out of the system and log back in to return to normal.

I’ve found the following info on the Arch wiki:
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend

Preserve Video Memory after suspend. Is that something I can safely implement and if yes can you give an instruction how to do this in CachyOS? thanks!

Hi,

Yes, suspend is problematic on wayland with NVIDIA.

Enabling the above services and adding the NVreg is fine and can be done.

ok that’s good news. I can set the enabling of systemd services myself but editing the kernel module paramater i need some help. Any steps i can follow, which file to edit?

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

and add in:

/etc/modprobe.d/nvidia-sleep.conf following content:

options nvidia NVreg_PreserveVideoMemoryAllocations=1
2 Likes

Thanks, made the changes and will test suspend and wake to see the result

unfortunately the issue persists. Back to X11 I guess

NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp

Does setting the temp file path helps?