Resuming from suspend issue (driver 450.57, Fedora 32, modesetting enabled, GTX 750 Ti)

I have enabled Wayland/modesetting as per Negativo17.org’s instructions It seems to run just fine, but every time it resumes from suspend, screen comes back completely corrupted, there is noise all around, round corners and fonts appear as blocks. System is still functional, though.

Was this supposed to work, or is modesetting still experimental and not intended for general use?

nvidia-bug-report.log.gz (124.5 KB)

In order for the driver to be able to save the contents of video memory during suspend & resume, you need to enable a few things. In particular, the NVreg_PreserveVideoMemoryAllocations module parameter and the nvidia-suspend, nvidia-resume, and nvidia-hibernate systemd services. Please see the README for more details: Chapter 21. Configuring Power Management Support

I’m curious to hear whether this works for you – I’m trying to track down a bug where some video memory is not preserved correctly in some cases so I’m interested to hear your feedback.

Hi @aplattner thank you very much for reaching out. Indeed, the proper configuration seems to be only partially implemented:

  • systemd nvidia service files are in place, but all services are disabled
  • /usr/bin/nvidia-sleep.sh exists
  • /lib/systemd/system-sleep/nvidia is missing, and I don’t have the samples from where to copy it (there is no /usr/share/doc/NVIDIA_GLX-1.0/samples)
  • EDIT: /usr/lib/modprobe.d/nvidia.conf contains options nvidia NVreg_DynamicPowerManagement=0x02, assuming this is right, I guess I would need to add the NVreg_PreserveVideoMemoryAllocations=1 there.

Also, /sys/power/mem_sleepcontains s2idle [deep], which got me confused whether it is or not already set to “deep”…

So, it seems understandable that it is not working properly… I will share the information you provided to negativo17.org’s maintainer so that he can address these issues. As soon as I have any additional info, I will let you know.

EDIT: In the meantime, I will be more than happy to do additional testing, I just need a little push on the right direction – more specifically, I just need to install a proper /lib/systemd/system-sleep/nvidia ;-)

BTW running with Wayland does seem to improve things, more noticeably with overlays (like volume up/down) and YouTube transitioning to/from full screen (both operations show some lag on X11, and none on Wayland). Looks promising… =)

Hi @aplattner, I finally managed some time to get back to this. Unfortunately, things seemed to have gotten worse :-(

I followed your instructions to the letter, and Wayland loads just fine. Suspend also seems to work as expected. However, it doesn’t resume. Keyboard is active (numlock and capslock are responsive), but screen remains dark – monitors remain on power save mode. After a while, keyboard becomes unresponsive. I can’t even get to run nvidia-bug-report.sh.

One thing that did not work according to the instructions was the kernel suspend mode; on my case, it shows s2idle [sleep], not sure if that’s fine. systemd services are enabled

Any help will be much appreciated. I will happily provide any additional info you need, just let me know.

Just wanted to say that I’m also trying to get suspend to work correctly on my system (some more info in this thread). I also had the problem in locating the nvidia sample scripts on my system. Apparently, when installing drivers from distribution repository they are placed somewhere else. Whoever comes across this in the future, use find / -name "nvidia-suspend.service" 2>/dev/null to locate the sampl files. On Debian Buster they are in /usr/share/doc/xserver-xorg-video-nvidia/examples. Now, there are two problems I am facing n my system:

  1. The suspend scripts don’t seem to be running at all when entering suspend. The nvidia-suspend service shows as enabled but inactive on my system. @andre.ocosta, you seem to have gotten past this stage. Any advice here?

  2. I tried running nvidia-sleep.sh suspend; nvidia-sleep.sh resume. The result is that the screen enters power saving mode and there’s nothing I can do but reboot. I assume this is the same problem as @andre.ocosta is facing after waking from suspend.

Hi @killy9999, I can’t really say I managed to have it working perfectly, sorry. IIRC the service was also enabled but inactive, and I activated it manually. And, yes, problem #2 seems to be exactly what I was also experiencing.

The truth is that I gave up insisting on this, and have been using nouveau since then. It gives me pretty acceptable performance (plain desktop use, nothing fancy), runs Wayland smoothly, and suspend works as expected. The main reason for the switch is that I realized how much better Wayland is compared to Xorg. This is not really a permanent move, I will be following Nvidia’s progress, and will migrate back once there is some solid advance. But, for the time being, I guess I’ll stay with nouveau.

I wish you luck, and, please, do post any updates here. Cheers!

I do realize this is a bit of a thread necro, but just wanted to post my findings with the latest driver since this thread was what came up in a search.

I’m doing some testing on this right now with the 470.57.02 driver and GNOME 40 on a Wayland session. Enabling the allocation preservation and enabling the services seems to be working after a quick test, but more repeated use is required to fully validate that. This is using the akmod package from RPM Fusion (currently nonfree-testing) and kernel 5.13.4. Display corruption on Wayland sessions resuming from suspension was definitely an issue prior.

cat > /etc/modprobe.d/nvidia-pwmgt.conf << EOF
# Enable VRAM Allocation preservation for system suspension
options nvidia NVreg_PreserveVideoMemoryAllocations=1
EOF

systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
systemctl is-enabled nvidia-suspend nvidia-hibernate nvidia-resume
systemctl reboot

The systemd services will be enabled but not active because they will be called when the system switches states (they’re symlinked to the /etc/systemd/system/systemd-{suspend,hibernate}.service.requires directories.

Full Stats:

  • Fedora 34
  • GNOME 40
  • Kernel 5.13.4
  • Driver 470.57.02 (RPM Fusion akmod-nvidia)
  • GTX 1070
1 Like

@mroche: I did exactly as you described and it worked perfectly with Wayland!

  • Arch Linux with Kernel 5.12.18-1-ck-skylake
  • GNOME 40.4
  • RTX 3070
  • Intel Core i9 10900k
  • Driver nvidia-dkms 470.63.01-1

I’ve set up the services and kernel parameters, and it’s fixed the corruption issues, but strangely my computer will fail to resume only after suspending for a second time after boot, if in ‘deep’ sleep mode. I’m unable to SSH into my computer in that state, and the last line logged in journalctl is PM: suspend entry (deep).

I’m using a GTX 780, on kernel 5.14.13 + driver 470.74, so perhaps it’s specific to the GTX 7** line?

I had a laptop with 740M and very similar issue. But in my case I was never able to wake up (first time too), but the solution was found. Check this thread, maybe it’ll help: Kernel 5.6: system freeze when resuming from suspend or hibernate