[TRACKING] Linux battery life tuning

Supposedly Meteor Lake comes with the really low power CPU cores and Intel Arc Alchemist Plus. Arrow Lake also uses the same low powered cores with a new Intel GPU architecture but loses hyperthreading without the new rentable units. I am unsure about the loss of hyperthreading but the new iGPU might be interesting.

If I can get my current Alder Lake to last as long as yours (8-9 hours), switching to Meteor Lake might be questionable, considering I heard now that the Iris Xe iGPU works on Davinci Resolve and that Meteor Lake battery life isnā€™t as stellar as it says it should be.

I am more excited for Nova Lake and Rentable Units for my next Desktop (from the current AMD 5900X) though. I have an Arc A770 and I wonder how is Battlemage and Celestial.

1 Like

I donā€™t think hyperthreading is going to be a big deal as it is going to move to Partitioned Thread Scheduling which they anticipate will work better and actually get rid of a number of vulnerabilities that hyper-threading caused. I agree though I am adopting a wait and see stance with the 15th gen Mobile, for me I have more performance on a laptop than I will realistically need as I offload or primarily do work on a remote workstation or server. Battery life is important to me a long with a generally snappy graphical expeience, but in general I am not compiling anything on it, or performing heavy graphics workloads. In short I can stick to a 3-5 year upgrade cycle without a problem, moving in 3 years though it needs to be compelling i.e. a massive improvement across the board.

1 Like

True true, I guess thatā€™s one of the reasons for the Royal Core project to go mainstream. Hoping by then thereā€™s a huge performance improvement especially on desktop.

Yea, snappiness with a nice battery life is always good. Though for me, some light gaming (when bringing my laptop over to a friendā€™s house) is really nice. I do sometimes do some minor edits/render videos or even compile a bit code on my laptop but not on a regular basis.

1 Like

Differences between how boost states work with intel and with amd I think are likely the cause of some of the weirdness I see with TLP on amd. amd_pstate you canā€™t fiddle the boost states/turbo directly. You can set freq limits which achieve the same result. Boost states are also how clock to 0 is handled from I can see so without them youā€™re stuck at the defined pstate freqs and C state idle for parking to 0.

Got around to try mesa git (off the aur), in idle and kodi hw accelerated video playback unfortunately no change.

With my best tweaks it still uses about 2W more for hw decoding 720p and about 3.5W more for 4k 60 than my old 8th gen intel thinkpad (with about equal idle powers).

FYI have a linux kernel branch with all the AMD 13 Framework patches I could findā€¦ seems pretty stable to me, but still around 5W idle with screen on, obviously for advanced usersā€¦ hopefully all this will be merged in soon. Based on 6.7-rc3.

5 Likes

Did you manage to find the commit that breaks als sensor in 6.7 and revert it?

I did not.

On my 7640u I am quite satisfied with the battery life during work.
But I have a problem with the power consumption during sleep.

24hrs ago I closed the lid, at 68%.
Now I open up my laptop, plug in a charger, and itā€™s at 0%.
Linux mint, hybrid-sleep enabled.

What should I do?
Because that is just simply not acceptable at all :slight_smile:
It basically makes my laptop incredibly unreliable; since I am used to always opening up a laptop and having a decent charge available (even after weeks, due to hybrid)
My 12 year old macbook air loses only like 15-10% max over a full day in sleep, probably even less.

2 Likes

Run the AMD s2idle report and fix whatever it says is wrong in your system.

If nothing is reported wrong, double check you have all the cards in suggested slots from framework guidance.

5 Likes

Wow!!
I ran the script.
All green except for the rtc_cmos.
I have added the kernel parameter rtc_cmos.use_acpi_alarm=1

Previously: Lost 40% battery in 1 night.
Currently: Lost 2% battery in 1 night.
:tada:

13 Likes

Hi Mario,

Iā€™ve just run this and come across the following:

ravi@ravi-fw13:~/Downloads$ sudo ./amd_s2idle.py
[sudo] password for ravi:
Location of log file (default s2idle_report-2023-12-18.txt)?
Debugging script for s2idle on AMD systems
:computer: Framework Laptop 13 (AMD Ryzen 7040Series) (Laptop) running BIOS 3.3 (03.03) released 10/17/2023 and EC unknown
:penguin: Kernel 6.6.7-1-siduction-amd64
:battery: Battery BAT1 ( ) is operating at 102.07% of design
Checking prerequisites for s2idle
:vertical_traffic_light:Logs are provided via dmesg, timestamps may not be accurate over multiple cycles
:white_check_mark: AMD Ryzen 7 7840U w/ Radeon 780M Graphics (family 19 model 74)
:white_check_mark: LPS0 _DSM enabled
:white_check_mark: ACPI FADT supports Low-power S0 idle
:white_check_mark: HSMP driver amd_hsmp not detected (blocked: False)
:white_check_mark: PMC driver amd_pmc loaded (Program 0 Firmware 76.70.0)
:white_check_mark: USB4 driver thunderbolt loaded
:white_check_mark: GPU driver amdgpu available
:x: GPU firmware missing
:white_check_mark: System is configured for s2idle
:white_check_mark: NVME Shenzhen Longsys Electronics Co., Ltd. is configured for s2idle in BIOS
:white_check_mark: GPIO driver pinctrl_amd available
Your system does not meet s2idle prerequisites!
Explanations for your system
:vertical_traffic_light: AMDGPU firmware is missing
The amdgpu driver loads firmware from /lib/firmware/amdgpu
In some cases missing firmware will prevent a successful suspend cycle.
Upgrade to a newer snapshot at kernel-firmware / Linux Firmware Ā· GitLab
amdgpu 0000:c1:00.0: Direct firmware load for amdgpu/gc_11_0_1_mes_2.bin failed with error -2
For more information on this failure see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053856

I have gone to gitlab but I canā€™t see how to install a newer snapshot. I am using siduction (a Debian Sid based rolling release distro and I have non-free enabled). I have firmware-amd-graphics version 20230625-1 which seems quite old compared to the snapshots on gitlab. I was wondering if you know what the command is to install to an updated snapshot version from gitlab? Iā€™m googling this but canā€™t seem to figure it out on my own.

I experimented a bit with sleep to hibernate and it does weird things.

Sleep to hibernate activated, after 90 minutes, close lid with 85% at 2 in the night, open it at 11 and its down to 30%, the script reports that apparently my samsung nvme isnt configured for sleep state. I tried to reproduce that by lowering the sleep to hibernate option to 1 minute but this time report says all green. Manually entering hibernate brought me once to a point where the script says that no sleep mode was achived. But the second time around it did not.

I think I had tlp and ppd running at the same time which probably conflicted somehow, for now, whatever i have set seems to properly sleep, in a timed test i lost 1% of battery in exactly one hour. That seems fine

Thereā€™s a newer snapshot in debian testing I seem to recall hearing. Maybe try that.

If the script changes output for NVME changes then this is a false negative. If youā€™re using the dmesg logger instead of systemd then the ring buffer wrapped from too many messages.

Now that you say thatā€¦yes i am stupid, i mentioned that the laptop was on for a long time and i think there was an error message around the ringbuffer issue. Thanks for the clarification!

FYI, powertop is not building on Ubuntu 22.04.

See Build error: configure: error: libtracefs is required but was not found Ā· Issue #124 Ā· fenrus75/powertop Ā· GitHub

I ran the AMD s2idle script because I was also having issues where my laptop unpredictably loses all battery during sleep, especially when the lid is closed. Iā€™m using powertop and the optimisations from this thread and that has been great for normal battery use but sleep is just broken, so broken! And the script gives me many errors (on Debian 22.04.3 LTS) that I donā€™t know how to fix ā€“ why am I having this and not others on a new 13" Framework (from mid-last year):

Debugging script for s2idle on AMD systems
:computer: Framework Laptop (13th Gen Intel Core) (13in Laptop) running BIOS 3.3 (03.03) released 04/07/2023 and EC unknown
:penguin: Ubuntu 22.04.3 LTS
:penguin: Kernel 6.5.0-15-lowlatency
:battery: Battery BAT1 (NVT Framewo) is operating at 94.54% of design
Checking prerequisites for s2idle
:white_check_mark: Logs are provided via systemd
:white_check_mark: 13th Gen Intel(R) Coreā„¢ i5-1340P (family 6 model ba)
:x: This tool is not designed for parts from this CPU vendor
:white_check_mark: LPS0 _DSM enabled
:white_check_mark: ACPI FADT supports Low-power S0 idle
:white_check_mark: HSMP driver amd_hsmp not detected (blocked: False)
:x: PMC driver amd_pmc did not bind to any ACPI device
:white_check_mark: USB4 driver thunderbolt loaded
:x: GPU driver amdgpu not loaded
:x: System isnā€™t configured for s2idle in firmware setup
:white_check_mark: NVME Sandisk Corp is configured for s2idle in BIOS
:x: GPIO driver pinctrl_amd not loaded

What if sleep.conf is totally commented out? It looks like Ubuntu uses the settings GUI to set these, Iā€™m not sure if thereā€™s two conflicting systems or something is out of sync? A quick look on the internet hasnā€™t helped clarify that unfortunately

Please check the output:

Debugging script for s2idle on AMD systems

and

:computer: Framework Laptop (13th Gen Intel Core)

You are running this AMD script (meant for the Ryzen platform) on an Intel machine - the results will not be meaningful.