[TRACKING] Linux battery life tuning

Okay, took power measurements again. I have a very specific methodology to look at true idle, and get rid of as many variables as possible.

Hardware as given in my last post.
Booted to arch, plasma graphical desktop over X11
1% screen brightness, keyboard backlight off
Only USB-C expansion cards in
Airplane mode

Nothing running except a konsole terminal running watch cat /sys/class/power_supply/BAT1/current_now

Current_now settled to ~144000, very close to my all time record low of 133000 IIRC. Single touchpad-induced mouse movements spiked the current to ~180000, far better than the spikes to 300000+ I used to see in kernels near 5.18 or so.

Seems like my RZ608 wifi card is a bit more power hungry than the AX210 was, especially with bluetooth turned on. Powertop is reporting almost 4 watts for idle but connected wifi only, nearly 7 with bluetooth turned on. I know powertop’s guesstimates are kind of a wag, but still: Ugh.

Wow less than 3W! I never seem to drop below 8W. Looks like I need to actually tweak tlp with that guide rather than just leaving it as-is. I’m pretty sure I did set the flags for limiting CPU speed on battery at some point though.

I have iwlwifi using over 7W alone though, so maybe something funny is up?

That does not seem right.
For reference, i run F38 KDE on my 12th gen (i5-1240p) and havent done any tinkering (also no tlp).
With Wifi enabled + connected, screen at 30%, i idle at about 3.5w.

If your iwlwifi is using over 7w alone, your system is probably not idle.

2 Likes

What expansion cards were you using? I’m curious whether this idle power is possible with the notorious HDMI card, which on my machine draws a full 1.5 watts.

1 Like

2x USB-A + 2x USB-C
Dont think it’s possible with the „old“ hdmi cards…

1 Like

Got my i7 1370p recently and I can’t get idle power draw to go below like 11w… any ideas (or is this just normal and I don’t know?)
Other hardware:
2x usb-c expansion cards, 2x usb-a expansion cards
64G 3200MT/s teamgroup memory (TEAMGROUP-SD4-3200,) I know that having this much ram might negatively affect battery, but it shouldn’t be this bad, no?
2TB Samsung 980 pro SSD

I have TLP running with settings mostly taken from the wiki page (config below,) nvme acpi off (for suspend,) and deep suspend enabled (because s2idle is trash.) I’m running Kali Linux, which is forked from debian, and running the latest kernel it provides (6.3.)

Relevant Configs:

┌──(gido5731㉿gframe)-[~]
└─$  grep -v -e '^$' -e '^#' /etc/tlp.conf
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
CPU_ENERGY_PERF_POLICY_ON_AC=performance
CPU_ENERGY_PERF_POLICY_ON_BAT=power
CPU_MIN_PERF_ON_AC=100
CPU_MAX_PERF_ON_AC=50
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=40
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0
CPU_HWP_DYN_BOOST_ON_AC=1
CPU_HWP_DYN_BOOST_ON_BAT=0
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
NMI_WATCHDOG=
PLATFORM_PROFILE_ON_AC=performance
PLATFORM_PROFILE_ON_BAT=low-power
INTEL_GPU_MIN_FREQ_ON_AC=800
INTEL_GPU_MAX_FREQ_ON_AC=1500
INTEL_GPU_MAX_FREQ_ON_BAT=500
INTEL_GPU_BOOST_FREQ_ON_AC=1500
RADEON_DPM_PERF_LEVEL_ON_AC=
RADEON_DPM_PERF_LEVEL_ON_BAT=
RADEON_POWER_PROFILE_ON_AC=
RADEON_POWER_PROFILE_ON_BAT=
WIFI_PWR_ON_BAT=off
PCIE_ASPM_ON_AC=default
PCIE_ASPM_ON_BAT=default
USB_DENYLIST="046d:c52b"
RESTORE_THRESHOLDS_ON_BAT=1
                                                                                                                                                                
┌──(gido5731㉿gframe)-[~]
└─$  grep -v -e '^$' -e '^#' /etc/default/grub   
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT='nvme.noacpi=1 module_blacklist=hid_sensor_hub  i915.i915_enable_fbc=1 i915.lvds_downclock=1 drm.vblankoffdelay=1 acpi_osi="!Windows 2020" intel.iommu=on mem_sleep_default=deep'
GRUB_CMDLINE_LINUX=""

Thanks in advance, I will say that, unlike my last laptop (a Tuxedo Pulse 15 Gen 1,) this laptop is way less anxiety inducing on the battery life front because it charges properly from a usb-c brick under 100w, and also has an effective battery life over 20Wh (seriously, the battery is like a year old and at under 25% capacity. I did test it externally as well to make sure the software reading is correct.)

The guide only focusses on TLP, whereas auto-cpufreq seems to be the “modern” approach.
Is there a specific reason why TLP should be preferred?
In addition: for most optimized settings, should TLP and auto-cpufreq be run combined for maximum benefit on a framework?

Auto-cpufreq is often mentioned and I have tested it in the past, and found it wanting. I have much better runtimes with a properly configured TLP than any other option out there. Also TLP allows for other modifications to the behavior of all the parts that go into making a complete power saving solution. Want your usb ports to suspend, but don’t want your dock to fall asleep? TLP can do that, auto-cpufreq cannot. The only thing auto-cpufreq is good at is if you don’t want to take the time to configure TLP. It is plug and play, and will get you within striking distance of TLP…but I want to squeeze out every minute I can when I am on battery so TLP wins every time.

On my last laptop a Thinkpad T480s the difference was a full hour. I did not even bother comparing the two on the Framework.

1 Like

I do agree with this. It’s possible I totally misunderstood the goal of auto-cpufreq, but I saw very few configuration options and no improvement to power use. It’s possible that maybe it could have a use, but I would need TLP running for other reasons anyway, so I don’t really see a benefit for me. I uninstalled it within like 20 minutes of trying it, as it seemed to not do much of anything.

1 Like

Bumping this, still the best I can get is about 9w on idle, with a load average of 1.3. Any ideas on what is making this so awful? People seem to be getting 2w on the 12th gen, so this is sorta maddening…

Looking into this further, it looks like it’s not my cpu but something else? Reading the RAPL measurements, it’s listed as platform power, so maybe my samsung SSD is the problem? I think tomorrow I’ll try booting off of a USB and seeing how it goes, and maybe removing a ram stick?

source: GitHub - deater/uarch-configure: tools for setting and accessing advaned low-level CPU features

└─$ sudo ./rapl-read -p      

RAPL read -- use -s for sysfs, -p for perf_event, -m for msr

Found Unsupported model 186
 Processor type
	0 (0), 1 (0), 2 (0), 3 (0), 4 (0), 5 (0), 6 (0), 7 (0)
	8 (0), 9 (0), 10 (0), 11 (0), 12 (0), 13 (0), 14 (0), 15 (0)
	16 (0), 17 (0), 18 (0), 19 (0), 
	Detected 20 cores in 1 packages


Trying perf_event interface to gather results

	Event=energy-cores Config=1 scale=2.32831e-10 units=Joules 
	Event=energy-gpu Config=4 scale=2.32831e-10 units=Joules 
	Event=energy-pkg Config=2 scale=2.32831e-10 units=Joules 
	Event=energy-psys Config=5 scale=2.32831e-10 units=Joules 

	Sleeping 1 second

	Package 0:
		energy-cores Energy Consumed: 1.171814 Joules
		energy-gpu Energy Consumed: 0.061340 Joules
		energy-pkg Energy Consumed: 3.301392 Joules
		energy-psys Energy Consumed: 12.147766 Joules

If your load average is 1.3, your system is definitely not idle. That would mean either at least one CPU core is fully loaded, or at least one process is fully saturating some IO device. Check out htop and iotop to look for potential culprits.

As a point of comparison, my machine running nothing but Xorg, Awesome WM, htop, and powertop has a load average of 0.18 and a power consumption of 4 watts (wifi connected, screen at 1% brightness).

2 Likes

I can almost guarantee at 9w that you have a background process chewing on the GPU. Either a tab in your browser with some sort of animation playing on it whether the tab is active or not, or possibly a mail client allowing html in messages with animations. Pretty much anytime I have noticed my power usage being over 4-5w it is some misbehaving web process. What applications are you running? They matter, alot, but more importantly what they are doing.

Perhaps… I wonder if that’s some e-core weirdness? I’ll list the apps I have open below, in case that’s helpful.

intel_gpu_top lists very little load, so that’s doubtful. Also, I took measurements with gdm3 stopped and it was still above 8w, where no gui anything was running.

For apps, I have:
Firefox ESR
Ungoogled Chromium with memory/energy saver
Evolution mail client (defaults to no fancy html)
Signal Beta
Android Messages (unofficial desktop client, basically just an electron wrapper)
gnome-terminal (busiest tasks being top and intel_gpu_top)

None of these apps report really any major usage, in fact adding up the top 15ish processes in top only adds up to like 65% cpu usage… So that load average doesn’t make a lot of sense (unless it doesn’t account for cpu frequency scaling?)

Let me know if y’all catch anything in this that I don’t see.

  • You’re also running discord and steam. Discord is notorious for this kind of thing.
  • It looks like you’re using gnome with X and, given the gnome-shell CPU usage, you may not be offloading enough to the GPU. I’d definitely try wayland.
2 Likes

Electron has a reputation for being a giant waste of resources. Considering that you’re running Signal, Discord, Android – and also running Steam – it’s a feat that you’ve got power consumption down as much as you have.

2 Likes

Uhmmm…yeah those apps are reporting a crazy amount of usage…for apps that are supposed to be idle. Discord is a cpu and gpu hog. I would never use Discord while trying to conserve battery, whether the app itself or through a browser it turns your battery into a firehose and it wants to drink every last dreg of juice it has. Also looks like you might have two browsers open…why? This all looks like a problem with your expectations versus the actual tuning of the laptop.

1 Like

I prefer Firefox but I need Chrome for work

With HW Acceleration off, it should only be a cpu hog.

I’ve had constant issues with wayland in general, so I’m generally hesitant to use it (just today, I had an issue with spice-vdagent not cooperating.) Are the battery improvements that significant?

Either way, 1. the power draw after killing my entire desktop environment is still above 6w and 2. nothing actually is reporting high power draw? I mean, I get discord isn’t the most efficient thing in the world, but on every laptop I’ve had in the past it wasn’t a big deal (and measuring it now, it’s still not affecting the power draw after turning it off, measuring on a full battery using a usb-c power meter just in case software estimates are wrong.)

I’ll test in a moment from the logout screen but the power draw was still high last I checked, even with no graphical interface at all.

Ok, I do have to partially take this comment back. after killing gdm3, power draw was around 3.5-4w, not the 6 I had remembered from earlier. That’s still pretty high for a laptop doing not that much, but that leaves 8w unaccounted for in the system. I’ll look in to some gnome optimizations, as that seems to be the common thread.

And you configured it to do all the power saving stuff while plugged in?

I would not expect my laptop to idle anywhere near as low while plugged in as when on battery without some serious configuration changes.

1 Like