there is only one way to cause the system to go into the Suspend-To-RAM state (write
“deep” into /sys/power/mem_sleep and “mem” into /sys/power/state).
[please excuse my confused comprehension, seems I need the dummie explanation]
do I understand correctly I can edit “mem_sleep” adding “deep” after “[s2idle]” and that will suffice to cause a -suspend to ram- when I select sleep ?
I don’t have a lot of experience setting these. I use a desktop mostly and never worry about hibernation or suspend modes. The reason being is i also have mechanical keyboards that don’t work well with this and i also find graphics cards are another issue trying to resume from sleep.
Mine is the same and my desktop does go into sleep if i activate it from the menu but coming out of it is the issue. My mouse won’t work properly and sometimes i have issues also with the graphics.
Edit: If i run systemctl suspend it has issues with mouse and graphics also if not more.
I think it does on my Intel also with an Nvidia card but i haven’t tried it for a while so i may be wrong.
Edit: I just face the reality that all these products are designed to function around Windows. Unless you have a product that is 100% designed to work with Linux it’s a crap shoot.
Okay i got this working on KDE with my hardware which is Ryzen 3800X Cpu and AMD RX 590 Graphics card. So my settings are the same as @pebcak showed.
cat /sys/power/mem_sleep
[s2idle] deep
cat /sys/power/state
freeze mem disk
I added the kernel parameter to grub and updated grub.
mem_sleep_default=deep
So on KDE from the menu if i click on sleep it automatically shuts down and the power button is flashing. I am using a mechanical keyboard and mouse set that are usb. When i press the power button it comes back on and the screen is black but the mouse cursor is there. You have to wait so many seconds and then the screen comes up to the login and i do have mouse control. My system works this way normally when you boot the computer the keyboard and mouse take a bit of time before they light up as it is starting at the UEFI Bios screen. So you just have to be a little more patient.
having a bit of trouble editing “/sys/power/mem_sleep” to add “deep”
have modified grub to include:
GRUB_CMDLINE_LINUX_DEFAULT=“loglevel=3 nowatchdog nvme_load=YES mem_sleep_default=deep” – have also updated grub with “grub-mkconfig -o ~/grub.cfg”
when I try to directly edit “/sys/power/mem_sleep” with kate:
after I am asked for root privilege, I get an error message “The document could not be saved, as it was not possible to write to /sys/power/mem_sleep. Check that you have write access to this file…”
used above message as template (in nano)
did change entry to: “s2idle [deep]”
then: ctrl + o and then enter to save I see: File Name to Write: /sys/power/mem_sleep
hit enter, see: File was modified since you opened it; continue saving?
then: Y Yes
N No ^C Cancel
selecting Y gives error message of invalid argument
(hopefully my description above accurately describes my action and what I see in konsole)
Yes it seems you can’t change this file without a special way of doing it. I’m not sure what sets this file from the beginning? Mine is already set this way. Maybe someone else has the answer. You can use the echo command to add it but is only temporary as it reverts when you reboot. So I’m not sure why yours isn’t set this way.