Powertop: Difference between revisions
m (page title is not capitalized) |
m (Added a few prepositions to make things more easily understood by English native speakers.) Tag: 2017 source edit |
||
(53 intermediate revisions by 26 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Power management]] | [[Category:Power management]] | ||
[[de:Powertop]] | [[de:Powertop]] | ||
[[fr:Powertop]] | |||
[[ja:Powertop]] | [[ja:Powertop]] | ||
[[zh-hans:Powertop]] | [[zh-hans:Powertop]] | ||
Line 6: | Line 7: | ||
{{Related|Power saving}} | {{Related|Power saving}} | ||
{{Related|Laptop Mode Tools}} | {{Related|Laptop Mode Tools}} | ||
{{Related|TLP}} | |||
{{Related articles end}} | {{Related articles end}} | ||
[https://github.com/fenrus75/powertop Powertop] is a tool provided by Intel to enable various powersaving modes in userspace, kernel and hardware. It is possible to monitor processes and show which of them are utilizing the CPU and wake it from its Idle-States, allowing to identify applications with particular high power demands. | |||
== Installation == | == Installation == | ||
[[Install]] the {{Pkg|powertop}} package. | |||
[[Install]] the {{Pkg|powertop}} package, or {{AUR|powertop-git}} for the latest development version. | |||
== Usage == | == Usage == | ||
Powertop | Powertop's interactive mode can be invoked with: | ||
# powertop | |||
In interactive mode, you can modify recommended settings in the '''Tunables''' and '''WakeUp''' tabs. This allows you to change settings and monitor how they affect your power consumption in the '''Overview''' tab. However this does not persist any settings and the changes will be lost on reboot. | |||
=== Generate reports === | |||
# Use powertop to produce a report on parameters: {{ | |||
# Open the report in your favorite web browser. The "Tuning" tab of the report now shows the actual parameters suggested by the tool to apply to save power. You may extract the commands with {{ | Powertop can generate reports in either CSV or HTML format. The HTML export is an interactive document that shows recommended settings. Make sure to reboot to revert to system defaults before generating a report! | ||
You can also extract the recommended parameters by following these steps: | |||
# Use powertop to produce a report on parameters: {{bc|# powertop <nowiki>--html=powerreport.html</nowiki>}} | |||
# Open the report in your favorite web browser. The "Tuning" tab of the report now shows the actual parameters suggested by the tool to apply to save power. You may extract the commands with {{bc|<nowiki>$ awk -F '</?td ?>' '/tune/ { print $4 }' powerreport.html</nowiki>}} | |||
Newer versions of Powertop include the {{ic|--auto-tune-dump}} option which will output the commands Powertop's {{ic|--auto-tune}} would have run. This is useful for including in a script in case you do not want to run all of Powertop's recommendations. | |||
=== Apply settings === | === Apply settings === | ||
Line 25: | Line 38: | ||
There are two ways to automatically apply the suggested settings: | There are two ways to automatically apply the suggested settings: | ||
* '''Recommended:''' You can apply these settings at boot by using [[module | * '''Recommended:''' You can apply these settings at boot by using [[module parameter]]s, [[udev rules]] and [[sysctl]]. For details, see the [[power management]] page. | ||
* You can use the {{ic|--auto-tune}} feature from powertop which sets all tunable options to their GOOD setting. This can be combined with systemd service to have the tunables set on boot. | * You can use the {{ic|--auto-tune}} feature from powertop which sets all tunable options to their GOOD setting. This can be combined with the systemd service to have the tunables set on boot. Remember to [[enable/start]] the service. | ||
{{hc|/etc/systemd/system/powertop.service|2= | {{hc|/etc/systemd/system/powertop.service|2= | ||
Line 33: | Line 46: | ||
[Service] | [Service] | ||
Type=oneshot | |||
RemainAfterExit=yes | |||
ExecStart=/usr/bin/powertop --auto-tune | ExecStart=/usr/bin/powertop --auto-tune | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
}} | }} | ||
You can also add this line to the {{ic|[Service]}} section in order to prevent your "Mouse" from getting disconnected upon booting, if it is already connected to your system. | |||
ExecStartPost=/bin/sh -c 'for f in $(grep -l "Mouse" /sys/bus/usb/devices/*/product | sed "s/product/power\\/control/"); do echo on >| "$f"; done' | |||
== Troubleshooting == | == Troubleshooting == | ||
=== Error: Cannot load from file === | === Error: Cannot load from file === | ||
If you receive an error like the following when starting powertop, it | |||
If you receive an error like the following when starting powertop, it is likely that powertop has not collected enough measurement data yet. To fix this, keep powertop running for a certain time connected to battery power only. | |||
Loaded 39 prior measurements | Loaded 39 prior measurements | ||
Line 49: | Line 68: | ||
=== Calibration to prevent inaccurate measurement === | === Calibration to prevent inaccurate measurement === | ||
If you experience inaccurate measurement, then it is likely that you need to calibrate powertop first. This can be done by running powertop with the {{ic|--calibrate}} parameter. | If you experience inaccurate measurement, then it is likely that you need to calibrate powertop first. This can be done by running powertop with the {{ic|--calibrate}} parameter. | ||
{{Note| | {{Note|Calibration will toggle various functions like backlight or wifi. Thus, it may turn your screen black for some time, lose your connection, and so on. Do not touch the machine during the calibration.}} | ||
}} | |||
# powertop --calibrate | # powertop --calibrate | ||
=== Display power estimation === | |||
Prior to displaying the power usage estimation column, powertop needs to run 270 measurements. Each one lasts 20 seconds, which means you need to let powertop run for 1h30 in total. | |||
== See also == | == See also == | ||
* [https://01.org/powertop/ Official site] | * [https://01.org/powertop/ Official site]{{Dead link|2023|09|16|status=404}} | ||
* [https://github.com/fenrus75/powertop Project repository] | |||
* [[Wikipedia:Powertop|Wikipedia article]] | * [[Wikipedia:Powertop|Wikipedia article]] |
Latest revision as of 16:39, 30 March 2024
Powertop is a tool provided by Intel to enable various powersaving modes in userspace, kernel and hardware. It is possible to monitor processes and show which of them are utilizing the CPU and wake it from its Idle-States, allowing to identify applications with particular high power demands.
Installation
Install the powertop package, or powertop-gitAUR for the latest development version.
Usage
Powertop's interactive mode can be invoked with:
# powertop
In interactive mode, you can modify recommended settings in the Tunables and WakeUp tabs. This allows you to change settings and monitor how they affect your power consumption in the Overview tab. However this does not persist any settings and the changes will be lost on reboot.
Generate reports
Powertop can generate reports in either CSV or HTML format. The HTML export is an interactive document that shows recommended settings. Make sure to reboot to revert to system defaults before generating a report!
You can also extract the recommended parameters by following these steps:
- Use powertop to produce a report on parameters:
# powertop --html=powerreport.html
- Open the report in your favorite web browser. The "Tuning" tab of the report now shows the actual parameters suggested by the tool to apply to save power. You may extract the commands with
$ awk -F '</?td ?>' '/tune/ { print $4 }' powerreport.html
Newer versions of Powertop include the --auto-tune-dump
option which will output the commands Powertop's --auto-tune
would have run. This is useful for including in a script in case you do not want to run all of Powertop's recommendations.
Apply settings
There are two ways to automatically apply the suggested settings:
- Recommended: You can apply these settings at boot by using module parameters, udev rules and sysctl. For details, see the power management page.
- You can use the
--auto-tune
feature from powertop which sets all tunable options to their GOOD setting. This can be combined with the systemd service to have the tunables set on boot. Remember to enable/start the service.
/etc/systemd/system/powertop.service
[Unit] Description=Powertop tunings [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/powertop --auto-tune [Install] WantedBy=multi-user.target
You can also add this line to the [Service]
section in order to prevent your "Mouse" from getting disconnected upon booting, if it is already connected to your system.
ExecStartPost=/bin/sh -c 'for f in $(grep -l "Mouse" /sys/bus/usb/devices/*/product | sed "s/product/power\\/control/"); do echo on >| "$f"; done'
Troubleshooting
Error: Cannot load from file
If you receive an error like the following when starting powertop, it is likely that powertop has not collected enough measurement data yet. To fix this, keep powertop running for a certain time connected to battery power only.
Loaded 39 prior measurements Cannot load from file /var/cache/powertop/saved_parameters.powertop Cannot load from file /var/cache/powertop/saved_parameters.powertop
Calibration to prevent inaccurate measurement
If you experience inaccurate measurement, then it is likely that you need to calibrate powertop first. This can be done by running powertop with the --calibrate
parameter.
# powertop --calibrate
Display power estimation
Prior to displaying the power usage estimation column, powertop needs to run 270 measurements. Each one lasts 20 seconds, which means you need to let powertop run for 1h30 in total.
See also
- Official site[dead link 2023-09-16 ⓘ]
- Project repository
- Wikipedia article