Desktop freaks out when waking from sleep in Wayland on Nvidia

Hello, I’m having an issue in Plasma where my display gets messed up after waking from sleep on Wayland. I’m using the proprietary Nvidia drivers. This doesn’t happen on X11.

I’ve seen other posts that had the same problem, and a fix was to make a .conf file in /etc/modprobe.d and add the following:

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp

For some reason, this doesn’t work for me. I’ve also tried enabling the nvidia services resume, suspend, and hibernate and that didn’t help either. Is there something I’m missing? Any help would be appreciated, thanks.

Operating System: EndeavourOS
Plasma Version: 5.27.9
GPU: NVIDIA GeForce RTX 3060 Ti
Drivers: nvidia-dkms 535.113.01-2
CPU: 16 × 11th Gen Intel® Core™ i7-11700F @ 2.50GHz
Kernel: 6.5.9-arch2-1 (64-bit)
Memory: 15.5 GiB of RAM
Graphics Platform: Wayland

2 Likes

Did you enable the nVidia suspend service?

https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend

Also:

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp

Is all one line (might just be how the forum formatted it!).

Yeah, I’ve tried enabling all three as well as disabling only resume and nothing changed. When you say enable, do you just mean enable the service or also start it as well? Because when I check the status, they all say inactive (dead).

I also have the correct formatted line for the .conf file in /etc/modprobe.d.

If it helps, I’m also dual booting Endeavour with Windows 10.

At work now, so will look when I get home. I dual boot as well (Win11, but on a separate drive, Legion 5 laptop)

sudo systemctl status nvidia-suspend      
Alias tip: status nvidia-suspend
○ nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-suspend.service; enabled; preset: disabled)
     Active: inactive (dead)

Nov 02 22:30:51 xircon-legion logger[243868]: <13>Nov  2 22:30:51 suspend: nvidia-suspend.service
Nov 02 22:30:53 xircon-legion systemd[1]: nvidia-suspend.service: Deactivated successfully.
Nov 02 22:30:54 xircon-legion systemd[1]: Finished NVIDIA system suspend actions.
Nov 02 22:30:54 xircon-legion systemd[1]: nvidia-suspend.service: Consumed 1.225s CPU time.
Nov 03 08:26:28 xircon-legion systemd[1]: Starting NVIDIA system suspend actions...
Nov 03 08:26:28 xircon-legion suspend[248712]: nvidia-suspend.service
Nov 03 08:26:28 xircon-legion logger[248712]: <13>Nov  3 08:26:28 suspend: nvidia-suspend.service
Nov 03 08:26:30 xircon-legion systemd[1]: nvidia-suspend.service: Deactivated successfully.
Nov 03 08:26:30 xircon-legion systemd[1]: Finished NVIDIA system suspend actions.
Nov 03 08:26:30 xircon-legion systemd[1]: nvidia-suspend.service: Consumed 1.286s CPU time.

This is what it returns for me. How did you enable the service?

I enabled it by using systemctl

sudo systemctl enable nvidia-suspend.service      

This is what it prints how when I check the status

○ nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-suspend.service; enabled; preset: disabled)
     Active: inactive (dead)
sudo systemctl enable nvidia-suspend.service  --now 

Or reboot

When I run that command, I get a black screen and have to shut off the computer to use it again. Here’s the output of nvidia-suspend.service after waking up from sleep.

○ nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-suspend.service; enabled; preset: disabled)
     Active: inactive (dead)

Nov 03 16:47:03 ghost-endeavour systemd[1]: Starting NVIDIA system suspend actions...
Nov 03 16:47:03 ghost-endeavour suspend[2022]: nvidia-suspend.service
Nov 03 16:47:03 ghost-endeavour logger[2022]: <13>Nov  3 16:47:03 suspend: nvidia-suspend.service
Nov 03 16:47:04 ghost-endeavour systemd[1]: nvidia-suspend.service: Deactivated successfully.
Nov 03 16:47:04 ghost-endeavour systemd[1]: Finished NVIDIA system suspend actions.

Then sorry, all out of ideas :exploding_head:

Do you have all nvidia services enabled? I’m not sure, but maybe I’m not suppose to have nvidia-resume enabled as the wiki says.

What does it do when you input that command?

sudo systemctl enable nvidia-suspend.service  --now

Enables the service and runs it (saves a reboot), and yes I have nvidia-resume enabled.

Maybe it has something to do with my vram? I have 8gb of swap memory and 16gb of RAM and this post had the same kind of issue. The fix was increasing the swap memory so I could try that.

Worth a go :smiley:

Thanks for the help anyway. :slightly_smiling_face:

Increasing the vram didn’t do anything, I think it’s because that post was using an AMD card. Just out of curiosity, I noticed that when I check/var/tmp, there are some empty folders there. Is it the same thing for you? Maybe the module is loading, but my /var/tmp folder doesn’t have enough space.

I think the empty folders are used as flags for programs, /var/tmp could be as large as the free space of your disk, unless you have done something different mounting things up? What filesystem are you using?

l /var/tmp                                                                                                  
total 4.0K
drwxrwxrwt 13 root   root   4.0K Nov  4 15:08  .
drwx------  3 root   root     17 Nov  4 15:08  systemd-private-dadf7a532c574648b79dd4f6463024cd-upower.service-VwlxTi
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-colord.service-HSzZzk
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-vnstat.service-9EbRpJ
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-polkit.service-Y84Tqq
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-systemd-logind.service-2pX6VI
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-power-profiles-daemon.service-04Tz5o
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-bluetooth.service-5XvE6e
drwxr-xr-x 13 root   root    189 Nov  4 15:07  ..
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-systemd-timesyncd.service-JG6IKM
drwx------  3 root   root     17 Nov  4 15:07  systemd-private-dadf7a532c574648b79dd4f6463024cd-systemd-resolved.service-B8gEMs
drwxr-xr-x  2 xircon xircon    6 Oct 25 15:15  flatpak-cache-5320C2
drwx------  3 root   root     23 Aug 19 10:30  dracut.JqbNw0

I just formatted my partition the other day to see if that would change anything and no dice :frowning:

My root partition is formatted in ext4 and I also made a boot and swap partition. Boot is 512mb and fat32 while swap is 16gb.

Ok, I finally got it fixed and working now. :grinning:

It worked after I replaced the nvidia-dkms package with the nvidia package. I’m not certian, but I think it’s because in the .conf file was looking for the nvidia package module and I had the nvidia-dkms package installed instead. Regardless, thank you for the help.

Bloody computers! I use the dkms package :exploding_head: Current update is winding me up - can’t change the screen brightness, grrrrrrrrrrr :smiley:

Now I never change the brightness… :rofl: but grrrrrrrrr…

Ok, I might be wrong about the reason it didn’t work before because I switched back to the dkms package and it works too. It seems that switching between the two fixed it for me but I’m not certain.