English Community

  • 1
  • 2
  • 3
Go to page

Best practices for Linux power management? - Lots of options

I'll be receiving my X1C Gen 9 soon (I'll be installing Manjaro with kernel 5.14) and had a few questions regarding how to make sure I'm not installing conflicting power management applications and services that might harm rather than help. When Googling, there's a lot of info out there that may be outdated and I'm curious to know what the best way is to approach this. Here's what I've Googled so far:

  • TLP: Generally considered to be the most important thing to install however I've read in some places that it may not be necessary now and could actually interfere with the most recent firmware versions. Not sure if I should install this or not.
  • Powertop - Ability to run this to monitor power usage via command line or as a service to continuously tune power management. Not sure if this may also interfere with the most recent firmware if run as a background service
  • ThermalD - Seems like this might be important according to Phoronix however it's not clear if this is the new successor to TLP or Powertop or if it fills another gap entirely
  • Throttled - Might be for older laptops but it's one I've used before but can't remember if it was helpful: https://github.com/erpalma/throttled
  • Power-profiles-daemon - Doesn't seem like this does any intelligent tuning but just allows the user to set their preference for efficiency vs speed similar to how it's done in Windows. I could be wrong on this though.

Given some of the changes in the ecosystem of power management and the advancements that the Lenovo team has made with more recent laptops, what is the new gold standard or combination of tools that are recommended for newer Intel processors and Lenovo laptops like the X1C G9?

0
0

Re:Best practices for Linux power management? - Lots of options

I recently installed openSUSE LEAP-15.3 on a Lenovo Carbon X1 Gen9 (X1C9).  After some days of tuning, it is running extremely well.

 

When I do heavy video rendering with kdenlive or ffmpeg (involving all cores in the 1165G7 CPU on my X1C9) initially the CPU frequency jumps to > 4000 MHz, and the CPU temperature shoots up to 95c. Within a few seconds the CPU frequency is throttled back to about 2400 MHz and the temperature subsequently drops to about 65c.  The laptop CPU freq and temperature than stays at this 2400MHz/65c range for as long as it takes the video to be rendered.

 

I am more than happy with this behaviour.  I am not a power user - and this X1C9 is a massive upgrade over my previous much slower ultrabook.

 

DETAILS on what I have installed:

 

To sort power issues I ended up upgrading from a default 5.3.18 kernel (that comes by default with openSUSE LEAP-15.3) to a more cutting edge 5.14.11 kernel. That upgrade solved a power shutdown issue.  I also had occasional random crash/reboots which I solved by changing specific parameters in the BIOS configuration to work better with openSUSE LEAP-15.3.  Further I updated the XWindows environment to newer packages that have bug fixes for the Iris graphics in this X1C9 (for example Mesa from 20.2.4 to 21.2.4).  

 

openSUSE LEAP-15.3 with these updates has been very stable the past week.

 

As for packages, I have installed:
* tlp-1.3.1-bp153.1.15.noarch
* kernel-default-5.14.11

 

I have not installed the front end 'tlpui' which is available in an openSUSE LEAP-15.3 community repository (to provide a front end gui for tlp).

 

There is also a version 1.4.0 of tlp available on github ( https://github.com/linrunner/TLP/releases ) , but given it was released only 24-Sept-2021, it is not yet packaged for openSUSE-15.3.  One of the new fetures for 1.4.0 is purportedly: Lenovo laptops: stop threshold at 60% aka "battery conservation mode" .  I don't know how relevant that may be for X1C9 - but it reads to be interesting and possibly relevant.

 

Applications that you mentioned that I have NOT installed are: 

 

thermald-1.6 <<< available for openSUSE-LEAP-15.3 but I have not installed it.

- I read thermald’s purpose is to limit power dissipation before the laptop’s temperature gets critical. The article notes TLP enables power saving features globally to optimize battery power especially in idle and low workload situations. ( https://linrunner.de/tlp/faq/installation.html ) . Purportedly (per that article) TLP does not conflict with thermald - however I have not seen the need to install it.

 

powertop-2.13-2.33 <<<< available on openSUSE LEAP-15.3 but I have not installed it.
  - I read this is a linux tool to find out what is using power on a laptop (ie a diagnostic type tool).

 

throttled-0.9.2 <<< this is available only in a LEAP-15.3 community repository (an it is not packaged with the distribution)
 - I read this tool was originally developed to fix Linux CPU throttling issues affecting Lenovo T480 / T480s / X1C6. The CPU package power limit (PL1/2) is forced to a value of 44 W (29 W on battery) and the temperature trip point to 95 'C (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default.  I have seen no need to install this.  I think an X1C6 is not an X1C9.

 

power-profiles-daemon-0.10 <<< This is not packaged for openSUSE LEAP-15.3. I have read ( from https://linrunner.de/tlp/faq/installation.html ) that power-profiles-daemon.service prevents TLP from making power saving settings at system startup. Hence even if packaged for LEAP-15.3, I likely would not install it.

0
0

Re:Best practices for Linux power management? - Lots of options

Thank you for sharing that experience, I'll certainly try a few of those things in Manjaro and see if I can replicate your success.

 

The reason I ask about power-profiles-daemon and such is because there are some posts online regarding the Lenovo team assisting with it: https://www.reddit.com/r/linux/comments/oz43m0/gnome_powerprofilesdaemon/

 

It seems like the GUI for it is already in GNOME and coming to KDE soon so I imagine it will form part of the next "gold standard" for power management on Lenovo devices.

 

My thinking is to go with TLP + Power-Profiles-Daemon and leverage this TLP config as it seems to be working for Lenovo owners: https://gist.github.com/pauloromeira/787c75d83777098453f5c2ed7eafa42a

0
0

Re:Best practices for Linux power management? - Lots of options

@ webo wrote:

The reason I ask about power-profiles-daemon and such is because there are some posts online regarding the Lenovo team assisting with it: https://www.reddit.com/r/linux/comments/oz43m0/gnome_powerprofilesdaemon/

 

It seems like the GUI for it is already in GNOME and coming to KDE soon so I imagine it will form part of the next "gold standard" for power management on Lenovo devices.

 

My thinking is to go with TLP + Power-Profiles-Daemon and leverage this TLP config as it seems to be working for Lenovo owners: https://gist.github.com/pauloromeira/787c75d83777098453f5c2ed7eafa42a

 

It will be interesting to read as to how this evolves with time - it looks very 'cutting edge' at present, for as I noted on the TLP FAQ page they have a very specific warning not to use power-profiles-daemon with TLP:  https://linrunner.de/tlp/faq/installation.html  ....

 

I have no experience to offer there - I don't plan to explore that possibility as at present I am happy with the X1C9 in how it is current running without Power-Profiles-Daemon. ... But I also type that noting I am not a 'demanding' user for the most performance - as this laptop even when throttled down to ~2400 MHz is a massive upgrade to what I am used to.

0
0

Re:Best practices for Linux power management? - Lots of options

Yes and that's exactly why I created the post. It seems like there's a lot of change in the power management space at the moment and I don't know what the desired end result is supposed to look like.

 

It looks like Fedora and Ubuntu (which the Lenovo team seem to be optimizing for primarily) now use power-profiles-daemon and the computer handles other power management in the firmware of the laptop itself.In one place I read that they suggested not running other power management tools as it may conflict with their optimizations in the firmware (can't remember exactly where I read that though) which is why I posed the question.Hopefully someone on the Lenovo team can clarify a bit and it can be added to the Arch Wiki and other places.

 

EDIT: Some more recent thoughts on power management: https://www.reddit.com/r/archlinux/comments/qen7vc/fix_your_battery_life/

0
0

Re:Best practices for Linux power management? - Lots of options

Great post - and hopefully we get suggestions from others but I'll try and add my point of view. Power/thermal mgmt is one of those topics which is definitely complicated and there are so many tools out there that please don't take my mutterings below as gospel....but hope they're useful.

 

As a quick starter - we work primarily with Ubuntu and Fedora so they get the most testing experience and tends to be what we run in our team, but it is our stated aim to support all distro's as best we can (I use Debian a fair bit too). Everything is supposed to be upstream so any distro can benefit.

 

Lenovo has the thermal and power management control built into firmware. We did this a few years back because Intel have not open sourced DPTF and Linux users were getting a crappy experience. The aim of the firmware is to give Linux users the same performance that Windows gets with DPTF. The official recommendation is to stick with that and you'll get a well tested experience that maintains your system within the recommended temperature boundaries.

 

As a note - I contributed the platform_profile kernel driver upstream and the new profile slider in Gnome and KDE takes advantage of this and our platforms do support it. This feature lets you switch between performance (higher power and temps), balanced (medium) and quiet (lower power and temps) settings. As a quick note - if you're using the system on lap for safety reasons performance mode is not active. If you don't have the latest Gnome/KDE but do have a recent kernel you can control from the cmdline via sysfs

 

I've not played with throttled in a while - a few years back it was important as it let you hit the higher performance modes. I don't think you should need it now for that purpose.

 

Thermald with adaptive mode (and --nocpuid I think) is very interesting. Matthew Garrett very cleverly reverse engineered the Intel DPTF implementation (or at least large chunks of it) and that means Linux can now use the same dynamic throttling as Windows - which is pretty cool. In theory this can give you a more adaptive performance behaviour which might be interesting. The caveat that comes with it is that we don't officially test with this or support it. There is some concern within the FW team with using something that doesn't have support from the vendor - and I've heard of scenarios with the X1C9 where the systems have overheated and shut down that suggest they have a valid point.  If you want to play with that stuff it's definitely interesting - I've done so and I know the Intel power engineers have checked it out too - but do understand that you're in unsupported territory and there's (a very small) chance you'll just fry your device.

 

TLP is very cool and something I need to get more familiar with - I've poked around at some of the battery life improvements it has and there's a lot of power with that tool. A bit like thermald  - I would exercise caution with it.

 

I look forward to hearing from others for their experiences. I know the tuning of graphics vs CPU power is an interesting area (doesn't matter so much on the X1 Carbon). Let me know if any of the above I've written is complete nonsense.

 

I'll also note that a few of our platforms had sub-optimal tuning in the initial FW (X1 Carbon 9 definitely suffered from that) earlier this year - so make sure you've got the latest FW installed. If it's any consolation - the issue was on both Windows and Linux :)

 

Mark

4
4

Re:Best practices for Linux power management? - Lots of options

Thank you for that Mark! I've been reading your posts in other places online to help piece together the picture of where these projects and initiatives are ultimately heading.

 

I think the most that can be done is find some sane defaults that close the gap between the Linux experience and the Windows experience. So far it seems like having the latest firmware + power-profiles-daemon (already in GNOME and in KDE 5.23) is the recommended path forward.

 

From your description, it seems like both ThermalD and TLP essentially try to do what the firmware is doing in their own way and it may cause conflicts (but, if done well, could create opportunity for further optimization)

 

Looking forward to doing some informal testing! Thanks!

 

I'll leave the thread open for anyone that's done their own testing and wants to chime in.

0
0

Re:Best practices for Linux power management? - Lots of options

@ webo wrote:

So far it seems like having the latest firmware + power-profiles-daemon (already in GNOME and in KDE 5.23) is the recommended path forward.

 

@webo, according to an internet article I read ( https://pointieststick.com/2021/07/23/this-week-in-kde-power-profiles-and-a-more-polished-kickoff/  ) I think this is the KDE feature you were referring to ( https://invent.kde.org/plasma/powerdevil/-/merge_requests/49  ) which is to integrate "power-profiles daemon" into KDE.  Purportedly:

 

* This allows to switch between the "power-saver", "balanced" and "performance" profiles.

 

* It adds an action that can be configured to switch automatically on AC (un)plugging or low power, as well as exposes that setting on DBus for a future Battery Monitor UI.  

 

As you noted it was implemented in KDE-Plasma 5.23 and is applicable if Kernel 5.12 or later is installed.

 

I didn't mention in my posts, but I note openSUSE-15.3 by default comes with KDE-Plasma Version 5.18.6, so its a bit older than the newer KDE-5.23.  While one can update their KDE version on openSUSE with more cutting edge KDE repositories ( as described in https://en.opensuse.org/SDB:KDE_repositories  ) , in my case I will likely stay with the older KDE-Plasma 5.18.6, unless I start encountering issues prompting me to want to upgrade.

 

Given the warning on the TLP website about incompatibilities with power-profiles daemon, it has me curious as to what the openSUSE plan is here for using TMP with future openSUSE updates and the power-profiles-daemon.   I have a desktop PC (connected to electricity via a UPS) that is running the cutting edge openSUSE Tumbleweed, and I may check that to see what it is running.  However that is not relevant to this forum, nor is it likely a desktop/UPS combo will have similar apps installed as installed on a laptop.

 

Perhaps if others chime in on this thread, it might be useful if they advise versions of their software?  ie. (in my case):


* GNU/Linux version: openSUSE-15.3 LEAP
* Lenovo X1C9 w/BIOS 1.47 on a core-i7 1165G7 w/1TB SSD
* kernel-5.14.11 (updated over default 5.3.18)
* TLP-1.3.1   (for others post your TLP version and/or appropriate power-profiles-daemon version, or installed thermald-1.6 version).  
* KDE-Plasma-5.18.6 (provide your KDE-plasma version or provide your appropriate Gnome or other desktop version)
* throttling and other power/thermal behaviour observed

* other info ? 

 

Edit:  here is another relevant link on this topic:  https://www.hadess.net/2020/09/power-profiles-daemon-new-project.html  (describing the introduction of power-profiles-daemon and its objectives).

0
0

Re:Best practices for Linux power management? - Lots of options

Is there a cross-platform battery benchmarking tool that can be run to assess the performance of the various tools? I should have my X1 by next week and I'd like to do some informal tests before I remove Windows completely to post the results here.

0
0

Re:Best practices for Linux power management? - Lots of options

@ webo wrote:

Is there a cross-platform battery benchmarking tool that can be run to assess the performance of the various tools? I should have my X1 by next week and I'd like to do some informal tests before I remove Windows completely to post the results here.

 

I am not aware of such - but power management is not a topic I typically spend much time on ... for I am not a very demanding user for performance.

 

Phoronix had an article some time back comparing the use of 'thermald' on a laptop with thermald, to the laptop without 'thermald'.  The Phoronix article from what I recall, did not say if there was any package (such as TLP) running in their example of the laptop without 'thermald'.  My guess is "TLP" was not running.  Their test was not on a Lenovo, and the distro they used was Ubuntu with a 5.13 kernel.

 

A link to their article is here:  https://www.phoronix.com/scan.php?page=article&item=intel-thermald-tgl&num=1

 

The end of that article provides a link to more detail on their bench mark testing of thermald:  https://openbenchmarking.org/result/2107159-IB-THERMALDC71&sgm=1

 

Given I am content with TLP in my X1C9 setup, I don't plan to follow up on this further.

 

0
0
  • 1
  • 2
  • 3
Go to page

Identify Your Device

OR

Don't want to provide your serial number? You can also Browse by product

Find your Device

Problem solved or need help? Click here.