You are not logged in.

#1 2025-06-04 22:12:10

ganrob
Member
Registered: 2024-12-25
Posts: 36

[SOLVED] KDE suspend then hibernate not working

Hi, I set up hibernation with swapfile and finally it's work well. But unfortunately, when I close the lid of laptop, suspend then hibernate doesn't happen. Please give me some advice.

/etc/systemd/sleep.conf

[Sleep]
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
AllowHybridSleep=yes
SuspendState=mem standby freeze
HibernateMode=platform shutdown
#MemorySleepMode=
HibernateDelaySec=5min
HibernateOnACPower=yes
SuspendEstimationSec=60min

/etc/systemd/logind.conf                                                                     

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#SleepOperation=suspend-then-hibernate suspend
#HandlePowerKey=poweroff
#HandlePowerKeyLongPress=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
#HandleSuspendKeyLongPress=hibernate
#HandleHibernateKey=hibernate
#HandleHibernateKeyLongPress=ignore
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
#HandleLidSwitchDocked=ignore
#HandleSecureAttentionKey=secure-attention-key
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#StopIdleSessionSec=infinity
#DesignatedMaintenanceTime=

Last edited by ganrob (2025-06-06 15:46:09)

Offline

#2 2025-06-05 07:51:08

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,779

Re: [SOLVED] KDE suspend then hibernate not working

As mentioned in the other thread, systemd/logind will likely not be relevant if powerdevil steps in.
According to the self-promotional https://blogs.kde.org/2024/04/23/powerd … nd-beyond/ you'd find its configs in ~/.config/powerdevilrc

Online

#3 2025-06-05 13:44:12

ganrob
Member
Registered: 2024-12-25
Posts: 36

Re: [SOLVED] KDE suspend then hibernate not working

seth wrote:

As mentioned in the other thread, systemd/logind will likely not be relevant if powerdevil steps in.
According to the self-promotional https://blogs.kde.org/2024/04/23/powerd … nd-beyond/ you'd find its configs in ~/.config/powerdevilrc

I try to use this config in ~/.config/powerdevilrc, and then I shut a laptop.

[AC][Display]
DimDisplayIdleTimeoutSec=600
DisplayBrightness=50
TurnOffDisplayIdleTimeoutSec=1800
UseProfileSpecificDisplayBrightness=true

[AC][SuspendAndShutdown]
AutoSuspendAction=0
SleepMode=3
LidCloseAction=6
SuspendThenHibernateDelaySec=1800
IdleTimeSec=900
LockScreenOnResume=true

[Battery][Display]
DisplayBrightness=50
UseProfileSpecificDisplayBrightness=true

[Battery][SuspendAndShutdown]
SleepMode=3
LidCloseAction=6
SuspendThenHibernateDelaySec=1800
IdleTimeSec=600
LockScreenOnResume=true

[General]
AllowIgnoreInhibitions=true
Journal file /var/log/journal/a69c170b029b474f83e07539854380a2/user-1000@000636c3a373bf2f-091ef1324985ad6c.journal~ is truncated, ignoring file.
июн 05 13:33:29 mylaptop systemd-logind[626]: Lid closed.
июн 05 13:33:29 mylaptop systemd-logind[626]: The system will suspend and later hibernate now!
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.3603] manager: sleep: sleep requested (sleeping: no  enabled: yes)
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.3604] device (enp3s0): state change: unavailable -> unmanaged (reason 'unmanaged-sleeping', managed-type: 'full')
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.3668] device (p2p-dev-wlan0): state change: disconnected -> unmanaged (reason 'unmanaged-sleeping', managed-type: 'full')
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.3669] manager: NetworkManager state is now ASLEEP
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.3675] device (wlan0): state change: activated -> deactivating (reason 'sleeping', managed-type: 'full')
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.4702] device (wlan0): state change: deactivating -> disconnected (reason 'sleeping', managed-type: 'full')
июн 05 13:33:29 mylaptop NetworkManager[621]: <info>  [1749130409.5299] device (wlan0): state change: disconnected -> unmanaged (reason 'unmanaged-sleeping', managed-type: 'full')
июн 05 13:33:29 mylaptop systemd[1]: Reached target Sleep.
июн 05 13:33:29 mylaptop systemd[1]: Starting System Suspend then Hibernate...
июн 05 13:33:29 mylaptop systemd-sleep[5192]: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
июн 05 13:33:29 mylaptop systemd-sleep[5192]: This is not recommended, and might result in unexpected behavior, particularly
июн 05 13:33:29 mylaptop systemd-sleep[5192]: in suspend-then-hibernate operations or setups with encrypted home directories.
июн 05 13:33:29 mylaptop systemd-sleep[5192]: Performing sleep operation 'suspend'...
июн 05 13:33:30 mylaptop systemd-sleep[5192]: Failed to put system to sleep. System resumed again: Input/output error
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Main process exited, code=exited, status=1/FAILURE
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Failed with result 'exit-code'.
июн 05 13:33:30 mylaptop systemd[1]: Failed to start System Suspend then Hibernate.
июн 05 13:33:30 mylaptop systemd[1]: Dependency failed for Suspend; Hibernate if not used for a period of time.
июн 05 13:33:30 mylaptop systemd[1]: suspend-then-hibernate.target: Job suspend-then-hibernate.target/start failed with result 'dependency'.
июн 05 13:33:30 mylaptop systemd[1]: Stopped target Sleep.
июн 05 13:33:30 mylaptop systemd-logind[626]: Operation 'suspend-then-hibernate' finished.
июн 05 13:33:30 mylaptop NetworkManager[621]: <info>  [1749130410.4217] manager: sleep: wake requested (sleeping: yes  enabled: yes)
июн 05 13:33:35 mylaptop systemd-logind[626]: Lid opened.

Offline

#4 2025-06-05 14:14:09

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,779

Re: [SOLVED] KDE suspend then hibernate not working

июн 05 13:33:29 mylaptop systemd-sleep[5192]: Performing sleep operation 'suspend'...
июн 05 13:33:30 mylaptop systemd-sleep[5192]: Failed to put system to sleep. System resumed again: Input/output error
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Main process exited, code=exited, status=1/FAILURE
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Failed with result 'exit-code'.

Looks like the system wants to do the right thing…
What is the journal output? There's a suspicious lack of kernel messages.

Close the lid, get a coffee, open the lid and then please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Online

#5 2025-06-05 14:42:25

ganrob
Member
Registered: 2024-12-25
Posts: 36

Re: [SOLVED] KDE suspend then hibernate not working

seth wrote:
июн 05 13:33:29 mylaptop systemd-sleep[5192]: Performing sleep operation 'suspend'...
июн 05 13:33:30 mylaptop systemd-sleep[5192]: Failed to put system to sleep. System resumed again: Input/output error
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Main process exited, code=exited, status=1/FAILURE
июн 05 13:33:30 mylaptop systemd[1]: systemd-suspend-then-hibernate.service: Failed with result 'exit-code'.

Looks like the system wants to do the right thing…
What is the journal output? There's a suspicious lack of kernel messages.

Close the lid, get a coffee, open the lid and then please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

https://0x0.st/8gX0.txt

Offline

#6 2025-06-05 14:49:07

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,779

Re: [SOLVED] KDE suspend then hibernate not working

июн 05 13:25:29 mylaptop kernel: NVRM: GPU 0000:01: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.
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: dpm_run_callback(): pci_pm_suspend returns -5
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: failed to suspend async: error -5
июн 05 13:25:29 mylaptop kernel: ata1: SATA link down (SStatus 4 SControl 300)
июн 05 13:25:29 mylaptop kernel: PM: Some devices failed to suspend, or early wake event detected

https://wiki.archlinux.org/title/NVIDIA … er_suspend
You need to either enable those services or remove/unset the module parameter

Online

#7 2025-06-05 15:21:59

ganrob
Member
Registered: 2024-12-25
Posts: 36

Re: [SOLVED] KDE suspend then hibernate not working

seth wrote:
июн 05 13:25:29 mylaptop kernel: NVRM: GPU 0000:01: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.
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: dpm_run_callback(): pci_pm_suspend returns -5
июн 05 13:25:29 mylaptop kernel: nvidia 0000:01:00.0: PM: failed to suspend async: error -5
июн 05 13:25:29 mylaptop kernel: ata1: SATA link down (SStatus 4 SControl 300)
июн 05 13:25:29 mylaptop kernel: PM: Some devices failed to suspend, or early wake event detected

https://wiki.archlinux.org/title/NVIDIA … er_suspend
You need to either enable those services or remove/unset the module parameter

Now I have:
in /etc/default/grub

 GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=UUID=dd443ce5-9ad2-449b-87fa-3fa18c065709 resume_offset=3083762 nvidia_drm.modeset=1 NVreg_PreserveVideoMemoryAllocations=1" 

in /etc/modprobe.d/nvidia-power-management.conf

 options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp



https://0x0.st/8g8E.txt

Offline

#8 2025-06-05 15:27:34

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,779

Re: [SOLVED] KDE suspend then hibernate not working

It would be "nvidia.NVreg_PreserveVideoMemoryAllocations=1" and the parameter is set - that's the problem.
You'd have to issue "nvidia.NVreg_PreserveVideoMemoryAllocations=0" or enable the relevant services (which should™ be enabled by default anyway)

Did I already link https://deepl.com/ ?

Online

#9 2025-06-05 15:50:55

ganrob
Member
Registered: 2024-12-25
Posts: 36

Re: [SOLVED] KDE suspend then hibernate not working

seth wrote:

It would be "nvidia.NVreg_PreserveVideoMemoryAllocations=1" and the parameter is set - that's the problem.
You'd have to issue "nvidia.NVreg_PreserveVideoMemoryAllocations=0" or enable the relevant services (which should™ be enabled by default anyway)

Did I already link https://deepl.com/ ?

Ok, if I understand you correctly :

/etc/modprobe.d/nvidia-power-management.conf

 options nvidia NVreg_PreserveVideoMemoryAllocations=0 NVreg_TemporaryFilePath=/var/tmp 

sudo mkinitcpio -P   

/etc/default/grub

 GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=UUID=dd443ce5-9ad2-449b-87fa-3fa18c065709 resume_offset=3083762 nvidia_drm.modeset=1 NVreg_PreserveVideoMemoryAllocations=0" 

sudo grub-mkconfig -o /boot/grub/grub.cfg 

Then rebooting. After closing and opening lid ( do it twice because plasma not working):

https://0x0.st/8gKc.txt

Offline

#10 2025-06-05 19:20:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,779

Re: [SOLVED] KDE suspend then hibernate not working

"NVreg_PreserveVideoMemoryAllocations=0" is still nonsense - "nvidia.NVreg_PreserveVideoMemoryAllocations=0", the "nvidia." part is important. And

июн 05 15:46:20 mylaptop kernel: NVRM: GPU 0000:01: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.
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: dpm_run_callback(): pci_pm_suspend returns -5
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: failed to suspend async: error -5
июн 05 15:46:20 mylaptop kernel: PM: Some devices failed to suspend, or early wake event detected

whatever you did wrt /etc/modprobe.d/nvidia-power-management.conf didn't apply.
Most likely

июн 05 15:42:38 mylaptop sudo[2298]:   robert : TTY=pts/1 ; PWD=/home/robert ; USER=root ; COMMAND=/usr/bin/nano /etc/modprobe.d/nvidia-power-management.conf

because you edit the file on the same boot where you attempted the sleep?
The module parameter changes will not apply before a reboot.

Online

#11 2025-06-06 15:43:42

ganrob
Member
Registered: 2024-12-25
Posts: 36

Re: [SOLVED] KDE suspend then hibernate not working

seth wrote:

"NVreg_PreserveVideoMemoryAllocations=0" is still nonsense - "nvidia.NVreg_PreserveVideoMemoryAllocations=0", the "nvidia." part is important. And

июн 05 15:46:20 mylaptop kernel: NVRM: GPU 0000:01: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.
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: dpm_run_callback(): pci_pm_suspend returns -5
июн 05 15:46:20 mylaptop kernel: nvidia 0000:01:00.0: PM: failed to suspend async: error -5
июн 05 15:46:20 mylaptop kernel: PM: Some devices failed to suspend, or early wake event detected

whatever you did wrt /etc/modprobe.d/nvidia-power-management.conf didn't apply.
Most likely

июн 05 15:42:38 mylaptop sudo[2298]:   robert : TTY=pts/1 ; PWD=/home/robert ; USER=root ; COMMAND=/usr/bin/nano /etc/modprobe.d/nvidia-power-management.conf

because you edit the file on the same boot where you attempted the sleep?
The module parameter changes will not apply before a reboot.


Now it's work correct. Thanks.

Offline

Board footer

Powered by FluxBB