[RESPONDED] Linux sleep/hibernate status?

In case anyone already tested:
How is sleep/hibernate functioning under Linux? Does it support S3 or S0 sleep?
What is the approximate battery drain speed in sleep?

1 Like

S3 is supported by the platform but S0 is the default. Hibernate you can get working but it’ll require hacky workarounds if you want it along with kernel lockdown mode as the kernel will disable hibernation by default. Battery drain is better with S3 than with S0.

2 Likes

Hi @Zack1 , Let us know your preferred distro, most distros supports hibernation,
but require specifics steps to undertake. Welcome to the community by the way. :slight_smile:

1 Like

Thanks, I’ll probably use Ubuntu as I’m currently using it on desktop.
I didn’t manage to setup encrypted hibernation, mostly because it’s desktop so hibernation is somewhat not a necessity.

Glad to hear both S3 and S0 works. May I ask how much % per hour is battery drain, in case you tested?

Never really bothered to switch to S3 so I can’t comment on that but suffice to say that S3 is far superior from a battery life standpoint from what I understand. The battery life on Linux is so much worse than Windows it isn’t even funny. I still think it needs improvement even on Windows (which I’m currently using because…school) as at most I get like 5 hours of battery life. I know I’ve done all the low hanging fruit to improve it and I’m not even running intense workloads, basically just a browser, some PDFs and a word processor. Whatever strengths the FW13 has, battery life ain’t it. Having said that, I’m on 12th gen, 13th gen users might tell you battery life has much improved. Or possibly Ryzen FW 13 users have a better experience, I highly encourage you to search the forum and see what people are saying about it.

1 Like

I’ve got only s2_idle. It uses 0.85w/h

2 Likes

Slept for 10.56 hours
Used 6.72 Wh, an average rate of 0.64 W
At 0.64/Wh drain you battery would be empty in 103.46 hours
For your 89.97 Wh battery this is 0.71%/hr or 16.97%/day

I have a 16 with Ryzen 7040 and dGPU, sadly it seems like S3 sleep is either not obvious to enable or unsupported. cat /sys/power/mem_sleep gives only s2idle, the deep mode does not appear. This is the same when I run either the mainline kernel or OEM. Quoting support:

As of recent updates from both AMD and Intel, we regret to inform you that they have officially discontinued support for S3 sleep mode. This means that the functionality of S3 sleep mode on systems utilizing these processors is no longer guaranteed to work as expected.

I get a 1.5%-1.7% per hour battery drain in s2idle, not pretty IMO but acceptable for me.

What is different from 12th gen to 13th gen? Can’t you just update bios to get the same benefit ??

Different core architecture on the P-Cores, BIOS updates are a mess on Framework so…no, battery life doesn’t magically improve with BIOS updates. Even the Beta BIOS that have been released make no note of improvements to battery life. Whereas Framework did note improvements when launching 13th gen

1 Like

I’ve the same setup and issue. However, while suspended, the laptop tend to drain the battery rapidly (more than 10%/h) while the temperature rise abnormally… Am I the only one getting this issue ? I believed it could be linked to the sleep status but since it cannot be switched to deep sleep, it’s a bit cumbersome…

Probably same issue than on the laptop 13 :

1 Like

For me putting it to deep sleep fixed the issue and I now have around 0.5%/h battery loss.

believed it could be linked to the sleep status but since it cannot be switched to deep sleep

Which distro are you running that you can’t go to deep sleep?

I’m on Pop!_OS 22.04 LTS, and I get the following:

$ cat /sys/power/mem_sleep
s2idle

But from what I understood from @xyx0826 answer, the issue is more related to hardware, isn’t that right ?

Can you share your HW/BIOS/distro stack that brought up deep sleep on your machine? I’m on Ubuntu 24.04 with BIOS 03.02 and never had any luck with it.

In other news I’m having trouble with hibernation as well but I suspect that might be an OS config issue.

I have Framework 13 11th gen, 3.19 BIOS (same issue with 3.17 and probably earlier versions) and using Arch (same issue with Fedora, OpenSuse).
It might be a hardware issue, but it can be fixed by changing the sleep status to deep.

Fedora:
sudo grubby --update-kernel=ALL --args=mem_sleep_default=deep

Arch with systemd-boot:
add mem_sleep_default=deep
to /boot/loader/entries/<current-conf>

Ubuntu:
Look at the first answer

Thanks, sounds like I’m out of luck with my AMD CPU on the 16 then. The deep option doesn’t appear in /sys/power/mem_sleep so setting mem_sleep_default would do nothing.

Lack of S3 sleep seems like a UEFI or hardware problem. I’ve tried enabling S3 through Universal AMD Form Browser but like this post, my OS fails to resume. (Be careful with this tool - bricking risk!)

I also tried adding --args=mem_sleep_default=deep to my boot options but as @xyx0826 mentioned it doesn’t change anything…

However, I noticed that after ~2h being idle (with lid closed) my charger was hot and my laptop burning hot in a cool room ! The battery drain is annoying but the temperature rise is really problematic and can be dangerous for the people around and the hardware.
Since the issue seems to be linked to the hardware, Framework support should probably be requested.

If you’re having high power consumption over s2idle please use this script to identify the issue:

If you’ve used any tools that modified “hidden” bios settings please reset BIOS defaults before running the tool.

I didn’t manage to install iasl and I needed to run the script as root. It seems to detect that my OS is tainted (12288) which seems to relate to :

    1. kernel issued warning
    1. externally-built (“out-of-tree”) module was loaded
    1. unsigned module was loaded

I’m not sure what those flags means. Could it be linked to my Pop_OS! install ? I followed the Ubuntu 22.04 LTS Installation on the Framework Laptop 16 - Framework Guides (with Installing Pop!_OS - System76 Support instead of Ubuntu) with the update of Framework Laptop 16 BIOS and Driver Releases, the completion guide and disabled touchpad during typing.

The script logs (with default values and the --force option):

Location of log file (default s2idle_report-2024-06-26.txt)? 
👀 ACPI extraction tool `iasl` is missing. Attempting to install.
Debugging script for s2idle on AMD systems
💻 Framework Laptop 16 (AMD Ryzen 7040 Series) (16in Laptop) running BIOS 3.3 (03.03) released 03/27/2024 and EC unknown
🐧 Pop!_OS 22.04 LTS
🐧 Kernel 6.9.3-76060903-generic
🔋 Battery BAT1 (NVT FRANDBA) is operating at 98.47% of design
Checking prerequisites for s2idle
✅ Logs are provided via systemd
✅ AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (family 19 model 74)
✅ SMT enabled
✅ LPS0 _DSM enabled
✅ ACPI FADT supports Low-power S0 idle
✅ HSMP driver `amd_hsmp` not detected (blocked: False)
✅ PMC driver `amd_pmc` loaded (Program 0 Firmware 76.82.0)
✅ USB4 driver `thunderbolt` bound to 0000:c6:00.5
✅ USB4 driver `thunderbolt` bound to 0000:c6:00.6
✅ GPU driver `amdgpu` bound to 0000:03:00.0
✅ GPU driver `amdgpu` bound to 0000:c4:00.0
✅ System is configured for s2idle
✅ NVME Sandisk Corp is configured for s2idle in BIOS
✅ GPIO driver `pinctrl_amd` available
🚦 Device firmware checks unavailable without fwupd gobject introspection
ACPI extraction tool `iasl` is missing
❌ Kernel is tainted: 12288
Your system does not meet s2idle prerequisites!
How long should suspend cycles last in seconds (default 10)? 
How long to wait in between suspend cycles in seconds (default 4)? 
How many suspend cycles to run (default 1)? 
Started at 2024-06-26 10:59:39.889433 (cycle finish expected @ 2024-06-26 10:59:53.889450)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ GPIOs active: ['84']
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe0B increased from 265 to 339
✅ Userspace suspended for 0:00:13.326155
✅ In a hardware sleep state for 0:00:06.357666 (47.71%)
🔋 Battery BAT1 (NVT FRANDBA) is operating at 98.47% of design
Explanations for your system
🚦 Kernel is tainted
	A tainted kernel may exhibit unpredictable bugs that are difficult for this script to characterize.
	If this is intended behavior run the tool with --force.

For more information on this failure see:
	https://gitlab.freedesktop.org/drm/amd/-/issues/3089