Graphics don't work after waking system from sleep

I reinstalled the OS with the NEO ISO a few days ago. And now when i wake the system after it has gone to sleep from inactivity, everything is black except for the taskbar and i get the popup: desktop effects were restarted due to a graphics reset. So i need to restart my computer every time. I am using a NVIDIA 3070 and i have the latest ‘nvidia’ drivers installed. It might have something to do with wayland, since i haven’t used it before, but i’m not sure.
Output from neofetch:

OS: EndeavourOS Linux x86_64 
Host: X570 AORUS ELITE -CF 
Kernel: 6.11.2-arch1-1 
Uptime: 8 mins 
Packages: 1076 (pacman) 
Shell: bash 5.2.37 
Resolution: 2560x1440 
DE: Plasma 6.1.5 
WM: kwin 
Theme: Breeze-Dark [GTK2], Breeze [GTK3] 
Icons: breeze-dark [GTK2/3] 
Terminal: konsole 
CPU: AMD Ryzen 5 5600X (12) @ 4.651GHz 
GPU: NVIDIA GeForce RTX 3070 
Memory: 4006MiB / 15938MiB 

Sounds like it could be related to this

Try the fix suggested

I haven’t done any kernel module stuff before. Do i understand it correctly if I’m supposed to modprobe nvidia NVreg_PreserveVideoMemoryAllocations=1 and systemctl enable nvidia-suspend.service, nvidia-hibernate.service, and nvidia-resume.service just want to make sure i don’t mess anything up

Are you on systemd-boot? Going to assume you are!

sudo nano /etc/kernel/cmdline

I’m on GRUB, so i guess what you wrote for Grub should work, but what am i supposed to edit in the GRUB_CMDLINE_LINUX_DEFAULT line?

sudo nano /etc/default/grub  

Add the text between the quotes. I am not on a nVidia machine right now.

GRUB_CMDLINE_LINUX_DEFAULT=' nvme_load=YES quiet NVreg_PreserveVideoMemoryAllocations=1 nvidia_drm.modeset=1 nvidia-drm.fbdev=1 pci=nommconf nowatchdog rw root=UUID=1fe53a1a-6f4f-47df-a8cd-2f3d78155d7c resume=UUID=0942ac91-77f1-46a0-b31e-e10933c7b1bbv nowatchdog nvme_load=YES loglevel=3'

Something like that. This machine is on grub, my nVidia is on systemd-boot, so no real examples…

The same lines you used in the systemd example? nvme_load=YES quiet NVreg_PreserveVideoMemoryAllocations=1 nvidia_drm.modeset=1 nvidia-drm.fbdev=1 pci=nommconf nowatchdog rw root=UUID=1fe53a1a-6f4f-47df-a8cd-2f3d78155d7c resume=UUID=0942ac91-77f1-46a0-b31e-e10933c7b1bb
I assume i also need to change the UUIDs

Yes, just add text as described leave the existing text, do not change anything like UUIDs

NVreg_PreserveVideoMemoryAllocations=1 nvidia_drm.modeset=1 nvidia-drm.fbdev=1

Then start the service(s) and reboot and test.

I tested this and it didn’t work, but now I realize I forgot to change the options, so I’ll try that later.

Did you rebuild grub?

No, I’m not home right right now, but I can try when I get back in an hour or so

I created the .conf file in /etc/modprobe.d and added the options you put there, i also enabled the other services, nvidia-hibernate.service, and nvidia-resume.service. And i used grub-install to rebuild grub, idk if theres a better way to do it. But the problem is still here.
Edit: i realize rebuilding grub means sudo grub-mkconfig -o /boot/grub/grub.cfg but i tried that too, and it still doesn’t work.

Any odd drive mounts? e.g. sshfs?

grub-install is just a script that runs the same command, so not an issue. When I get back, will boot up my nvidia laptop.

Not that i know of, i edited fstab for mounting and mounted everything except /home to /mnt.

Wake from sleep is working properly now, I’m not sure exactly what fixed it, but i did install drivers as shown here https://github.com/lutris/docs/blob/master/InstallingDrivers.md#nvidia-1 and i enabled nvidia-suspend.service, nvidia-hibernate.service, and nvidia-resume.service again, even though i already did that, and it didn’t seem to work.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.