I am a developer and system admin. I have a LOT of browser tabs, lots of terminals open, as well as vscode and MS Teams. YMMV but as far as I can tell, the "best" balance of power savings (long battery life) vs maching usability is using tlp and tlpui. This gives approx 5 - 6 hours of battery life on my workload.
I am running an INTEL processor, the below does not apply to AMD
Default, out of the box power management in linux is still not mature. Use tlp for power management when using intel processors (scroll to bottom for instructions)
As of this writing, gnome power management doesn't have a separate setting for AC power and battery. So if you set it to power saving, then plug it in, you'll have to manually change the setting in the menu to performance or balanced, which kind of goes against the whole point of the damned thing.
acpi is the scaling driver available before intel pstates was published (and the default driver for AMD silicon). I allows fine grained control of your cpus' max and min frequencies. However, it is not as good as the intel driver at scaling up and down. I tried it out, told the cpu to scale way down to stay cool and save battery, but the system became jittery and practically unusable. To my surprise, this slowness and jitteryness did NOT translate to better battery life. I believe this to be due to the traffic jams caused by the various processes fighting for the limited cpu power, thus taking longer to run, thus burning watts nonetheless.
Use the default intel pstate driver when running intel silicon gives the best results. This driver has multiple levels of ways to save power while still allowing the system to be usable, and it's kinda complicated. It's clearly explained here if you have 5 hours to spare.
In a nutshell, intel pstate:
- has fewer governors, but you really only need to use powersave (even when plugged in)
- does not allow you to cap the cpu frequency
- allows you to cap the cpu percentage via CPU_PERF
- allows you to set and energy policy via CPU_ENERGY_PERF_POLICY, and this parameter is key to saving power when running battery
systemctl disable power-profiles-daemon
systemctl mask power-profiles-daemon
systemctl disable thermald
systemctl mask thermald
add-apt-repository ppa:linrunner/tlp
apt update
apt install tlp tlp-rdw
add-apt-repository -y ppa:linuxuprising/apps
apt update
apt install tlpui
Run tlp gui as root
tlpui
- CPU_SCALING_GOVERNOR =
powersave
for both AC and BAT (to avoid the fans from spinning up as soon as I plug it in - CPU_SCALING_FREQ, ignore
- CPU_ENERGY_PERF_POLICY =
power
for both AC and BAT - CPU_MIN_PERF_ON_AC = 0
- CPU_MAX_PERF_ON_AC = 100
- CPU_MIN_PERF_ON_BAT = 0
- CPU_MAX_PERF_ON_BAT = 30
- PLATFORM_PROFILE_ON_AC =
balanced
# this allows the machine to run fast and smooth, and silently on ac - PLATFORM_PROFILE_ON_BAT =
low-power
You can also enable power saving for usb and pci.
The cpu is the top energy consumer on a laptop, but the graphics card(s) are a close second. On an nvidia card, you can reduce power consumption by running prime-select on-demand
or even prime-select intel
to only use the built in intel card
The above setup took many long hours to figure out. I've used linux for years, but until 2019 I hadn't spent time figuring out battery life on laptops (was mostly using servers, and always pluggin my laptop into the socket).
Kernel v5.19 has just been announced with lots of power management improvements, which may render the above settings useless. I am also still wondering why thermald needs to be disabled when running tlp. Perhaps tweaking thermald settings can reach better results than tlp can. I have spent enough time on the subject for time being, and I remain disappointed that Ubuntu doesn't offer good power mangement settings that truly work, out of the box.
Have you tried https://extensions.gnome.org/extension/945/cpu-power-manager/ ?