Laptop won't go to sleep (probably because of Nvidia's driver)

When I tell the laptop to go to sleep, it immediately wakes up. Same result if I wait 10 minutes.

I was suggested to check the logs. Here’s what dmesg returns:

[ 5751.941292] ata2.00: Entering standby power mode
[ 5752.737612] tpm tpm0: TPM savestate took 700ms
[ 5752.737885] NVRM: GPU 0000:06:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Management attempted without driver procfs suspend interface. Please refer to the 'Configuring Power Management Support' section in the driver README.
[ 5752.738105] e1000e: EEE TX LPI TIMER: 00000011
[ 5752.737898] nvidia 0000:06:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x30 [nvidia] returns -5
[ 5752.739469] nvidia 0000:06:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -5
[ 5752.739492] nvidia 0000:06:00.0: PM: failed to suspend async: error -5
[ 5753.005276] PM: Some devices failed to suspend, or early wake event detected

How do I fix it? I tried enabling nvidia-suspend.service and -resume.service, it says it doesn’t exist.

@BobLeRigoleur First thing is to peruse the section in the README as per the log output;
https://download.nvidia.com/XFree86/Linux-x86_64/550.40.07/README/powermanagement.html

Okay I tried to understand what I could.

In /usr/lib/modprobe.d/50-nvidia-default.conf there is the line

options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=483 NVreg_DeviceFileMode=0660 NVreg_PreserveVideoMemoryAllocations=1

Since NVreg_PreserveVideoMemoryAllocations is set to 1, I take it that the system tries to suspend (or hibernate) via the proc/driver/nvidia/suspend mechanism, is that correct?

IF that is correct, then the problem seems to be that /usr/lib/systemd/systemdoes not contain the service nvidia-suspend.service , nor -hibernate, nor -resume (in fact it does not contain any service with nvidia in the name.).

Moreover, /lib/systemd/system-sleep/nvidia and /usr/bin/nvidia-sleep.sh don’t exist either.

If this interpretation is correct, then I have two ways to solve. Either I use de default mechanism Kernel driver callback (as it is referred to in the README), or I create the services -suspend, -resume, etc. Am I correct?

(EDIT: also, there is no nvidia folder in /usr/share/doc)

@BobLeRigoleur so copy the /usr/lib/modprobe.d/50-nvidia-default.conf to /etc/modprobe.d/50-nvidia-default.conf to override the default and set to 0 and test…

2 Likes

It worked, thanks a lot! :smiley: (makes me wonder why this wasn’t the default option…)

1 Like