Difference between revisions of "Powertop"

From ArchWiki
Jump to: navigation, search
(Tips and tricks: using powertop report helps to identify parameters)
(Undo revision 494875 by Storrgie (talk) - see the "recommended" way above)
 
(52 intermediate revisions by 25 users not shown)
Line 1: Line 1:
 
[[Category:Power management]]
 
[[Category:Power management]]
 
[[de:Powertop]]
 
[[de:Powertop]]
{{Article summary start}}
+
[[ja:Powertop]]
{{Article summary text|This article discusses solving common power saving tasks, with use of Intel "PowerTOP" utility.}}
+
[[zh-hans:Powertop]]
{{Article summary heading|Important pages}}
+
{{Related articles start}}
{{Article summary link|Official site|https://01.org/powertop/}}
+
{{Related|Power saving}}
{{Article summary link|Project page|http://www.lesswatts.org/projects/powertop/}}
+
{{Related|Laptop Mode Tools}}
{{Article summary text|[[Wikipedia:Powertop|Wikipedia article]]}}
+
{{Related articles end}}
{{Article summary heading|Related}}
 
{{Article summary wiki|Laptop Mode Tools}}
 
{{Article summary end}}
 
  
'''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.
+
'''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 ==
[[Pacman|Install]] package {{Pkg|powertop}}, available in [[Official Repositories]].
+
[[Install]] the {{Pkg|powertop}} package.
  
Powertop was updated to 2.0 which comes with more features [http://www.h-online.com/open/features/Powertop-2-0-saving-power-under-Linux-1257057.html (Article from the H Open)]. For more information, see the [https://01.org/powertop/blogs/ceferron/2012/powertop-v2.0-release Release Announcement].
+
== Usage ==
  
== Tips and tricks ==
+
Powertop suggests a few methods to reduce the power consumption further. However, in interactive mode, powertop does not display the parameters. To find out which ones are suggested, proceed as follows:
  
PowerTOP suggests a few methods to reduce the power consumption further. However, in the console, PowerTOP does not display the parameters. To find out which ones are suggested, proceed as follows:
+
# If you have changed parameters (e.g. in powertop), reboot so that the system has default state of the parameters.
* If you have changed parameters (e.g. in PowerTOP), reboot so that the system has default state of the parameters.  
+
# Use powertop to produce a report on parameters: {{ic|# powertop <nowiki>--html=powerreport.html</nowiki>}}
* Use PowerTOP to produce a report on parameters: {{ic|# 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 {{ic|<nowiki>awk -F '</?td ?>' '/tune/ { print $4 }' powerreport.html</nowiki>}}.
* The last tab of the report now shows the actual parameters suggested by the tool to apply to save power.
 
  
You can apply these settings at boot by using [[module parameters]], [[udev rules]] and [[sysctl]]. For details, see the [[power saving]] page.
+
=== 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 {{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.
 +
 
 +
{{hc|/etc/systemd/system/powertop.service|2=
 +
[Unit]
 +
Description=Powertop tunings
 +
 
 +
[Service]
 +
ExecStart=/usr/bin/powertop --auto-tune
 +
RemainAfterExit=true
 +
 
 +
[Install]
 +
WantedBy=multi-user.target
 +
}}
  
 
== Troubleshooting ==
 
== Troubleshooting ==
 
=== Error: Cannot load from file ===
 
=== Error: Cannot load from file ===
If you get an error like the following when starting powertop, you are likely to have powertop not allowed collecting enough measurement data yet. All you need to do is to keep powertop running for a certain time whilst being on battery.
+
If you receive an error like the following when starting powertop, it's 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
 
  Cannot load from file /var/cache/powertop/saved_parameters.powertop
 
  Cannot load from file /var/cache/powertop/saved_parameters.powertop
 
  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 {{ic|--calibrate}} parameter.
 +
 +
{{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
 +
 +
== See also ==
 +
 +
* [https://01.org/powertop/ Official site]
 +
* [[Wikipedia:Powertop|Wikipedia article]]

Latest revision as of 07:21, 3 November 2017

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.

Usage

Powertop suggests a few methods to reduce the power consumption further. However, in interactive mode, powertop does not display the parameters. To find out which ones are suggested, proceed as follows:

  1. If you have changed parameters (e.g. in powertop), reboot so that the system has default state of the parameters.
  2. Use powertop to produce a report on parameters: # powertop --html=powerreport.html
  3. 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.

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 systemd service to have the tunables set on boot.
/etc/systemd/system/powertop.service
[Unit]
Description=Powertop tunings

[Service]
ExecStart=/usr/bin/powertop --auto-tune
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

Troubleshooting

Error: Cannot load from file

If you receive an error like the following when starting powertop, it's 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.

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

See also