Battery Drain on Suspend/Sleep with Linux

Is there an established baseline for testing the power consumption in suspend/sleep/s2idle under Linux, e.g. a clean Fedora 39 install with BIOS defaults?

I saw a lot of unanimous opinions about what to expect from FW13 AMD sleep under Linux. Personally, i’ve experienced between to 20-40% battery drain over a 8h night (which would make to the laptop kind of unusable to me) and saw reports all the way down to 2%/night, which seems unusual low for a non-lpddr laptop in suspend. ([TRACKING] Linux battery life tuning - #538 by Mark1)

I noticed the issue first with my NixOS install and have since wiped to laptop, restored BIOS defaults, wiped the TPM and cleared all secure boot keys, installed a vanilla Fedora 39 and have removed all expansion cards for testing with the amd_s2_idle python script.

What are other users experiencing, what and how are you measuring? My current lead (at least on my device) would be ACPI gpe0B interrupts waking the device up, as i read occurences of this GPE not triggering at all, and (so far inexplicable) reasoning of the default state. ([RESPONDED] AMD FW13 -- s2idle premature wake)

My model is a Batch 10 FW 7840U (BIOS 3.03) with WD SN850 2TB and 2x16GB Crucial 5600MT memory and usually 2 USB-C in front and 2 USB-A in lower slots (as advised by FW) and the default FW USB-C charger (and mic and camera shutter closed, if that matters).

Note that my configuration is suspend-then-hibernate.
So technically it has not been in suspend all night.
Nevertheless, without changing this configuration, indeed my power consumption dropped from about 40%/night to 2%.

For me, my FW13 AMD (Fedora39) dropped 4% after a 7h15m night, so that feels consistent with @Mark1.

Thanks a bunch for your replies…

That would/should have been my next question…

IIUC, you guys have disabled Secure Boot then, as there is no way (yet [1]) to verify the hibernation image?

[1] [PATCH v2 00/10] Encrypted Hibernation - Evan Green

I’m the one who is having issues with the excessive gpe1A interrupts in the thread you linked. Currently in discussion with support on finding the root cause. One commonality is that I think we’re using the same RAM setup (2x16 Crucial 5600), but we’re getting different unexpected gpe interrupts.

Adding the kernel parameter acpi_mask_gpe=0x1A has made sleep much closer to desired with decently low battery drain overnight. Still a bit unpredictable with manual suspend where it’ll just decide to wake up instantly for some reason, but once the automatic 15 minute inactivity is hit it seems to sleep with the lid closed.

Furthermore, i’m going to guess you are running systemd-based distributions, which would then imply you’re suspending via systemd’s systemd-suspend-then-hibernate.service (perhaps using gnome or kde). The default behaviour of “HibernateDelaySec=” has changed with a recent upstream release, which i believe, they have rolled back… Would you mind pasting the contents of your “/etc/systemd/sleep.conf” file? A lot of people are running something like 30 minutes, and 4% over 30 minutes would be quite a bit, considering one would have to disable Secure Boot to achieve a hibernation state…

It would be quite interesting to know, how much power the FW13 AMD actually consumes during s2idle with “default configurations”.

According to this poll [1], this would be the most common configuration people are running their FW13 AMD’s with.

I’m not really intending to run Fedora in the long run, but would like to establish kind of a baseline, a common configuration which would help debug the issue, if there even is one, further…

The only kernel parameter i have added is “rtc_cmos.use_acpi_alarm=1” and i have installed and run “powertop --auto-tune” before measuring… Everything else is stock, i believe.

Lastly, my findings… after bit of testing and measuring, it appears that with more or less up-to-date software (current linux kernel, systemd, etc.) it evens out (very scientifically measured:) at around 1.2-1.3 percent/hour in s2idle for the above described configuration (mainly 2x16 GB SO-DIMM sticks), independent of the distribution used (i.e. Fedora and NixOS) but with “rtc_cmos.use_acpi_alarm=1” added to the kernel command line (iiuc, which will become the default in a future systemd release thanks to @Mario_Limonciello et al.) and a “powertop --auto-tune” run at boot time. Considering that refreshing memory in sleep/stand-by mode is the main consumer of energy and that soldered memory consumes around 90% less energy (with the obvious caveats, of course) in sleep than non-soldered solutions, this boils down (again, very scientifically measured) to around 0.7/0.8 watts in s2idle, which is a (very) good result, imo. This would be the first laptop with which i’ve been able to achieve acceptable suspend results now that ACPI S3 appears to have gone everywhere. Thanks a bunch, everybody…

2 Likes

I just opened my laptop after 9hours and noticed a 13% drain.

This is an AMD 7840U, latest bios, with 990 PRO 1TB and 2x16G Crucial 5600.
Fedora 39 kde spin, I put the laptop on energy saving mode just before closing the lid.
2 USB-C close to me, 1 USB-C 1 USB-A close to the screen : I’ll try swapping them around to see if there is any change.

Last week I was on KDE Neon latest and up to date and noticed a 25% battery drain during the same amount of time…

I just put together my FR 13 laptop and installed Linux mint and haven’t had a ton of time to mess around with it. After getting it all set up last night I charged it up all the way, then put it on suspend. Just now, less than 24hrs later I fired it up and it had about enough power to turn on before dying completely. I’m not a big computer person, and I’m definitely treading into unfamiliar waters with this DIY computer stuff, but this doesn’t seem right. Anybody find any solutions to this issue? Is there some code I’m supposed to put into the terminal to give it a better sleep mode?

Hi and welcome.

This is not a DIY issue.
I mainly use Windows. By suspend do you mean sleep and not hibernate.
To loose all battery in 24 hours some 55w is over 2W an hour, can you try with only USB C expansion cards?

Hi there. I was using sleep and not hibernate. I guess I have to do some configuration to install the hibernate settings with Linux, and that battery drain is common with the “suspend” setting that comes with it. I’m going to try that. Do the regular expansion cards tend to drain battery? I’ve just got USB, hdmi, and the USB C in there now.

1 Like

@Colman_Lee Also, make sure you have the expansion cards in the appropriate slots.

2 Likes

Ah, thanks I did not realise that!

1 Like

@Colman_Lee Furthermore, if that does not improve power consumption during sleep, i suggest running this [1] script for further investigation. Speaking from my own experience and from what i’ve read so far, ideally, you are looking at ~1.5W power consumption during s2idle for a system with two sticks of memory installed (2*16GB in my case).

[1] scripts/amd_s2idle.py · master · drm / amd · GitLab

Thanks Sydney. I am using the intel core not AMD Ryzen, so would that be a different code?

Yes, this script is for AMD systems specifically. Unfortunetely, i don’t know about about any equivalent for intel systems right of my head…

In case anyone here is wondering, I went down the rabbit hole trying to figure out what gpe0B is.

It’s the GPE used by the EC to tell the OS “something has changed”. It increases by the same amount each time I suspend regardless of the time I’ve been suspended (or, at least, for any “short” suspend time) so it’s probably just firing as the system suspends/resumes (because the EC state is changing).

In other words, it’s probably not your issue.