Suspend is immediately canceld by Nvidia

Hey,

I have an Lenovo P52s and KDE and getting this Errors when trying to suspend.

Aug 28 10:08:30 BauerTop systemd-logind[579]: The system will suspend now!
Aug 28 10:08:30 BauerTop plasmashell[2725]: [2023-08-28 10:08:30.945][info] Suspend event received, disconnecting from daemon
Aug 28 10:08:30 BauerTop plasmashell[2725]: [2023-08-28 10:08:30.950][info] Suspend event received, disconnecting from daemon
Aug 28 10:08:31 BauerTop systemd[1]: Starting System Suspend...
Aug 28 10:08:31 BauerTop systemd-sleep[10880]: Entering sleep state 'suspend'...
Aug 28 10:08:31 BauerTop kernel: PM: suspend entry (deep)
Aug 28 10:08:36 BauerTop kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Aug 28 10:08:36 BauerTop kernel: NVRM: GPU 0000:02:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Mana>
Aug 28 10:08:36 BauerTop kernel: nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x30 [nvidia] returns -5
Aug 28 10:08:36 BauerTop kernel: nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -5
Aug 28 10:08:36 BauerTop kernel: nvidia 0000:02:00.0: PM: failed to suspend async: error -5
Aug 28 10:08:36 BauerTop kernel: PM: Some devices failed to suspend, or early wake event detected
Aug 28 10:08:36 BauerTop kernel: PM: suspend exit
Aug 28 10:08:36 BauerTop kernel: PM: suspend entry (s2idle)
Aug 28 10:08:38 BauerTop kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Aug 28 10:08:38 BauerTop kernel: NVRM: GPU 0000:02:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Mana>
Aug 28 10:08:38 BauerTop kernel: nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x30 [nvidia] returns -5
Aug 28 10:08:38 BauerTop kernel: nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -5
Aug 28 10:08:38 BauerTop kernel: nvidia 0000:02:00.0: PM: failed to suspend async: error -5
Aug 28 10:08:38 BauerTop kernel: PM: Some devices failed to suspend, or early wake event detected
Aug 28 10:08:38 BauerTop kernel: PM: suspend exit
Aug 28 10:08:38 BauerTop systemd[1]: systemd-suspend.service: Main process exited, code=exited, status=1/FAILURE
Aug 28 10:08:38 BauerTop systemd[1]: systemd-suspend.service: Failed with result 'exit-code'.
Aug 28 10:08:38 BauerTop systemd[1]: Failed to start System Suspend.
Aug 28 10:08:38 BauerTop systemd[1]: Dependency failed for Suspend.

Is there a fix for that?
Thank you in advance :slight_smile:

just two questions, as I might have encountered a similar situation in the past:
a. do you have a etc/modprobe.d/nvidia.conf, and if positive, what’s the content of it?
b. I do not know the laptop you have, is it a dual-gpu or there’s just the nvidia?

thanks, and welcome to Endeavour :enos:

Thanks for your answer:

# Automatically generated by EnvyControl
options nvidia-drm modeset=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
  1. It has a dual gpu: intel and nvidia

ok, I redirect to a similar issue I’ve found on Arch forum (hope it’s ok for Endeavourists)…the guy solved by deleting the lines in nvidia.conf (in your case just the NVreg_PreserveVideoMemoryAllocations) and rebooting.
If you want to try with that, naturally I suggest to backup that file before…

Moreover you can enable the drm modeset via kernel options in your initramfs, hence having it early loading (just double check, being a dual-gpu)
On the other hand, the options nvidia NVreg_PreserveVideoMemoryAllocations=1 might deal exactly with suspension/hibernation as per archwiki…and indeed, while my situation was different as I didn’t have to deal with a dual-gpu, from your logs it seems the nvidia card fails to suspend, so I think also about the services coming with the official drivers that might be called in the process and being disabled…but being this one a rough terrain for me (see another recent post dealing with nvidia and gdm suspension), I’d invite you to wait for someone else to chime in and confirm it before starting to enable those services :wink:

1 Like

Thanks, that helped.
The NVreg_PreserveVideoMemoryAllocations was the problem. Removing it and everything works fine!

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