Systemd's suspend-then-hibernate not working in NVIDIA Optimus laptop

My system:

  • EndeavourOS Linux x86_64
  • XPS 15 9500
  • 5.17.5-arch1-1 kernel
  • NVIDIA GeForce GTX 1650 Ti Mobile with nvidia-dkms 510.68.02-1 driver

Description of the problem:
I have an Optimus laptop with an NVIDIA Turing card and I have already configured the RTD3 power management following the Arch Wiki. I’ve also configured the system to preserve video memory after suspend and enabled nvidia-suspend, nvidia-resume, nvidia-hibernate and nvidia-persistenced service.
When I put the laptop into either suspend or hibernate state, using either systemctl suspend or systemctl hibernate, everything works as expected. However, if I use systemctl suspend-then-hibernate the system fails to enter in suspend state with the following error message:

mag 07 15:09:00 ikigai systemd[1]: Starting Suspend; Hibernate if not used for a period of time...
mag 07 15:09:00 ikigai systemd-sleep[292811]: Entering sleep state 'suspend'...
mag 07 15:09:07 ikigai systemd-sleep[292811]: Failed to put system to sleep. System resumed again: Input/output error
mag 07 15:09:09 ikigai systemd[1]: systemd-suspend-then-hibernate.service: Main process exited, code=exited, status=1/FAILURE
mag 07 15:09:09 ikigai systemd[1]: systemd-suspend-then-hibernate.service: Failed with result 'exit-code'.
mag 07 15:09:09 ikigai systemd[1]: Failed to start Suspend; Hibernate if not used for a period of time.

My guess is that there is no nvidia-suspend-then-hibernate service. Specifying NVreg_PreserveVideoMemoryAllocations=0 works, but only if the NVIDIA card is not in use: if it is, then the system sometimes goes to sleep and sometimes not, causing unexpected overheat (e.g. when I close the lid and put the laptop is in my bag).

Unfortunately my laptop does not support s3 (“deep standby”) but only s2idle (“modern standby”): thus when suspended the system still consumes a lot of power (30% in 10 hours) and for this reason I need to use the suspend-then-hibernate feature.

Am I missing something? Should I report this directly on NVIDIA forums?

Meanwhile I posted this on NVIDIA forum too and found a workaround, for those that are interested this is the link.

1 Like

Hello @nihil21 and welcome to the :enos: forum.

Generally, the post with the link should be marked as the SOLUTION, so it gets closed and other members can search for it :wink:

Helllo and thanks!
I wasn’t sure to mark it as a solution because the workaround I’ve found feels more like a hack, but you’re right, it’s better to mark it as solved so others can already benefit from it

1 Like

even though it’s your own solution :wink:

1 Like

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