Manjaro Difference between revisions of "Power Management"

Difference between revisions of "Power Management"

From Manjaro
imported>FadeMind
(remove note)
(Marked this version for translation)
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
__TOC__


Power Saving Techniques can be used on Laptops to maximize the Battery Life and minimize the heat produced, and conserve energy.
<translate>
<!--T:1-->
Power Saving techniques can be used to minimize the heat produced and conserve energy.  On laptops, this can be especially important as it can significantly extend battery life and excessive heat can be both uncomfortable and loud on portable devices.


= Power Saving using TLP =


TLP can be used for automatic power management, as explained in the following quote from their website:
=Power Management Software= <!--T:2-->
[[File:battery.png|left|96px]]


<blockquote>'TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. '''TLP comes with a default configuration already optimized for battery life''', so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.


All TLP settings are stored in the config file /etc/default/tlp. As the default configuration already provides for optimized battery saving, in many cases there is no immediate need to change it.
<!--T:3-->
There are several options for managing power under Manjaro. In this article, we will introduce three of the more popular options.


TLP is a pure command line tool with automated background tasks. ''It does not contain a GUI''.'</blockquote>


<!--T:4-->
{{note|In most cases running more than one power management tool at a time can cause conflicts so it is best practice to only use one of the below options}}


== How to Install TLP ==
<!--T:5-->
<br clear="all"/>


{{warning|TLP can conflict with laptop-mode-tools, so if you have laptop-mode-tools installed and want to install TLP, then uninstall laptop-mode-tools first!}}
==TLP== <!--T:6-->


<!--T:7-->
[http://linrunner.de/en/tlp/tlp.html TLP] is the most commonly used option for automatic power management.


TLP is available from the Community repository, and where access has been enabled, can be installed by entering the following command into your terminal:


sudo pacman -S tlp iw smartmontools --noconfirm --needed
===Installing TLP=== <!--T:8-->


<!--T:9-->
TLP is available from the Manjaro repositories, can be installed with your favorite package manager or by using entering the following command into your terminal:


After installation, TLP then needs to be configured to be run automatically when you start up your computer. To do so, enter the following commands into your terminal:
<!--T:10-->
pamac install tlp


  systemctl enable tlp
<!--T:11-->
  systemctl enable tlp-sleep.service
Now that it is installed, you need to start and enable the service. This can be accomplished with the command:
  systemctl enable tlp --now


<!--T:12-->
{{note|TLP 1.2.2 and lower need another service as well: tlp-sleep.service}}


Now TLP will automatically start every time you boot your computer.


=== TLP Configuration ===
===Configuring TLP=== <!--T:13-->
[[File:Tlpui.png|left|400px]]


Advanced TLP confuguration for Manjaro is available here: '''[https://wiki.manjaro.org/index.php?title=Optimized_power_settings#Setup_TLP Optimized Power Settings:Setup TLP]'''


{{warning|'''[http://linrunner.de/en/tlp/docs/tlp-faq.html#powertop Disclaimer: TLP was not designed to make powertop happy.]'''}}
<!--T:14-->
TLP can manually configured by editing the file '''/etc/default/tlp''' as described in [http://linrunner.de/en/tlp/docs/tlp-configuration.html The Official Documentation].


See http://linrunner.de/en/tlp/docs/tlp-configuration.html


<!--T:15-->
A simpler way to configure TLP is via the GUI tool [https://github.com/d4nj1/TLPUI TLPUI]


= An Alternative to TLP for Laptop Users =


{{warning|Again, TLP and laptop-mode-tools '''must not''' be installed together!}}
<!--T:16-->
To install TLPUI install the package '''tlpui''' using your favorite package manager or with the command
pamac install tlpui


<!--T:17-->
<br clear="all"/>


From the Arch Wiki:
==Laptop Mode Tools== <!--T:18-->


<blockquote>'Laptop Mode Tools is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.'</blockquote>
<!--T:19-->
An Alternative to TLP for laptops is [https://github.com/rickysarraf/laptop-mode-tools Laptop Mode Tools(LMT)].




To install '''laptop-mode-tools''', enter the following command into your terminal:
===Installing LMT=== <!--T:20-->


sudo pacman -S laptop-mode-tools
<!--T:21-->
To install {{ic|laptop-mode-tools}}, enter the following command into your terminal:


<!--T:22-->
pamac install laptop-mode-tools


Once installed, to enable ''laptop-mode-tools'' to start automatically every time you boot your computer, enter the following into your terminal:
<!--T:23-->
Once installed, to enable LMT to start automatically every time you boot your computer, enter the following into your terminal:


  sudo systemctl enable laptop-mode.service
  <!--T:24-->
sudo systemctl enable --now laptop-mode.service


<!--T:25-->
LMT automatically configures some settings for you in order to optimize your laptop's battery life.


''Laptop-mode-tools'' will automatically configures some settings for you in order to optimise your laptop's battery life.


===LMT Configuration=== <!--T:26-->


== Manually Setting Laptop-Mode-Tools Configuration ==
<!--T:27-->
For configuration, the file to edit is {{ic|/etc/laptop-mode/laptop-mode.conf}}}


For user configuration, the file to edit is '''/etc/laptop-mode/laptop-mode.conf''' (primary configuration file)
<!--T:28-->
The individual kernel modules can be configured from the configuration files present in {{ic|/etc/laptop-mode/conf.d/}}


The individual kernel modules can be configured from the configuration files present in '''/etc/laptop-mode/conf.d/'''


==PowerTOP== <!--T:29-->


= Minimizing Laptop/Desktop temperatures =
<!--T:30-->
PowerTop a diagnostic tool used to identify and report issues with power consumption and management.  It can be used as a reporting tool, an automated power management tool or both.


== For Intel Machines ==


The Intel pstate driver automatically handles CPU frequency scaling according to system load.
===Installing PowerTop=== <!--T:31-->


Note that the Intel Pstate works only with kernels >= 3.9, and kernel 3.11 is recommended.
<!--T:32-->
It can be installed as
pamac install powertop


Supported processor families are Intel Sandy Bridge, Ivy Leage and up.


The Intel Thermal Daemon (thermald) can be installed to automatically manage the CPU Temperature.
===Generating Reports=== <!--T:33-->


Install it with
<!--T:34-->
 
You can generate a report using powertop with the command:
sudo pacman -S thermald
  sudo powertop --html
 
After installing it needs to be configured to automatically start at boot:
 
sudo systemctl enable thermald
 
==For AMD Machines==
 
With Linux Kernel 3.11, AMD introduced Dyanamic Power Management (DPM) for the GPU for the free drivers, which can lead to lower power consumption and better operating temperatures.
 
To enable it,
 
sudo gedit /etc/default/grub
 
add/change the line
''GRUB_CMDLINE_LINUX=""'' to
''GRUB_CMDLINE_LINUX="radeon.dpm=1"''
 
and regenerate grub.cfg
  sudo grub-mkconfig -o /boot/grub/grub.cfg


= PowerTOP =
<!--T:35-->
 
This will create the file {{ic|powertop.html}} in the current directoryYou can open this file in any web browser.
PowerTop a diagnostic tool used to identify and report issues with power consumption and management.
It can be used to check the power consumption.
 
Install it with-
 
  sudo pacman -S powertop
 
Run PowerTop to analyze power consumption
 
sudo powertop
 
To save PowerTops output to a file,
 
sudo powertop --html


<!--T:36-->
If you are using TLP for power management you may notice some differences in the recommendations between the tools.  The article [http://linrunner.de/en/tlp/docs/tlp-faq.html#powertop Comparing TLP with PowerTop reporting] describes some of the reasons for these differences.


For more details, see [http://wiki.manjaro.org/index.php?title=PowerTOP_to_Optimise_Laptop_Power_Consumption Powertop : Manjaro Wiki]


=Support=
===Automated Tuning with PowerTop=== <!--T:37-->


Following is a link to this page's forum counterpart where you can post any related feedback: [http://forum.manjaro.org/index.php?topic=6867.0]
<!--T:38-->
The command {{ic|sudo powertop --auto-tune"}} will allow PowerTop to automatically tune power management based on it's recommendations.


<!--T:39-->
From a practical perspective, the best way to use PowerTops auto-tuning is with a systemd service.


Credit goes to LiberteCzech for posting about TLP, and to Arup for posting about Thermald, and to the Arch Wiki for their documentation, especially on Laptop-Mode-Tools
<!--T:40-->
To create, start and enable a systemd service for PowerTop you can use the commands:
sudo sh -c "echo -e '[Unit]\nDescription=PowerTop\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/usr/bin/powertop --auto-tune\n\n[Install]\nWantedBy=multi-user.target\n' > /etc/systemd/system/powertop.service"
sudo systemctl enable --now powertop.service




''For more configuration'', see [[Optimized_power_settings]].
=Temperature/Thermal Management= <!--T:41-->


=See Also=
==ThermalD== <!--T:42-->
[https://github.com/intel/thermal_daemon ThermalD], the Linux Thermal Daemon can be used to automatically handle CPU frequency scaling according to system load.


[http://wiki.manjaro.org/index.php?title=PowerTOP_to_Optimise_Laptop_Power_Consumption PowerTop]
<!--T:43-->
To install it, install {{ic|thermald}} in your favorite package manager or use the command:
pamac install thermald


[http://linrunner.de/en/tlp/tlp.html TLP]
<!--T:44-->
After installing it needs to be configured to automatically start at boot in order to work:
sudo systemctl enable --now thermald


[https://wiki.archlinux.org/index.php/Laptop_Mode_Tools LaptopModeTools-Arch Wiki]
</translate>
<translate>
=See Also= <!--T:45-->
* [[Undervolt_intel_CPU|How to undervolt Intel CPUs]]
* [http://linrunner.de/en/tlp/tlp.html TLP website]
* [https://wiki.archlinux.org/index.php/Laptop_Mode_Tools LaptopModeTools - Arch Wiki]
* [https://wiki.archlinux.org/index.php/TLP TLP - Arch wiki]
</translate>




[[Category:Contents Page]]
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 13:58, 23 January 2023

Other languages:
English • ‎français • ‎русский • ‎中文(中国大陆)‎

Power Saving techniques can be used to minimize the heat produced and conserve energy. On laptops, this can be especially important as it can significantly extend battery life and excessive heat can be both uncomfortable and loud on portable devices.


Power Management Software

Battery.png


There are several options for managing power under Manjaro. In this article, we will introduce three of the more popular options.


Note
In most cases running more than one power management tool at a time can cause conflicts so it is best practice to only use one of the below options


TLP

TLP is the most commonly used option for automatic power management.


Installing TLP

TLP is available from the Manjaro repositories, can be installed with your favorite package manager or by using entering the following command into your terminal:

pamac install tlp

Now that it is installed, you need to start and enable the service. This can be accomplished with the command:

systemctl enable tlp --now


Note
TLP 1.2.2 and lower need another service as well: tlp-sleep.service


Configuring TLP

Tlpui.png


TLP can manually configured by editing the file /etc/default/tlp as described in The Official Documentation.


A simpler way to configure TLP is via the GUI tool TLPUI


To install TLPUI install the package tlpui using your favorite package manager or with the command

pamac install tlpui


Laptop Mode Tools

An Alternative to TLP for laptops is Laptop Mode Tools(LMT).


Installing LMT

To install laptop-mode-tools, enter the following command into your terminal:

pamac install laptop-mode-tools

Once installed, to enable LMT to start automatically every time you boot your computer, enter the following into your terminal:

sudo systemctl enable --now laptop-mode.service

LMT automatically configures some settings for you in order to optimize your laptop's battery life.


LMT Configuration

For configuration, the file to edit is /etc/laptop-mode/laptop-mode.conf}

The individual kernel modules can be configured from the configuration files present in /etc/laptop-mode/conf.d/


PowerTOP

PowerTop a diagnostic tool used to identify and report issues with power consumption and management. It can be used as a reporting tool, an automated power management tool or both.


Installing PowerTop

It can be installed as

pamac install powertop


Generating Reports

You can generate a report using powertop with the command:

sudo powertop --html

This will create the file powertop.html in the current directory. You can open this file in any web browser.

If you are using TLP for power management you may notice some differences in the recommendations between the tools. The article Comparing TLP with PowerTop reporting describes some of the reasons for these differences.


Automated Tuning with PowerTop

The command sudo powertop --auto-tune" will allow PowerTop to automatically tune power management based on it's recommendations.

From a practical perspective, the best way to use PowerTops auto-tuning is with a systemd service.

To create, start and enable a systemd service for PowerTop you can use the commands:

sudo sh -c "echo -e '[Unit]\nDescription=PowerTop\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/usr/bin/powertop --auto-tune\n\n[Install]\nWantedBy=multi-user.target\n' > /etc/systemd/system/powertop.service"
sudo systemctl enable --now powertop.service


Temperature/Thermal Management

ThermalD

ThermalD, the Linux Thermal Daemon can be used to automatically handle CPU frequency scaling according to system load.

To install it, install thermald in your favorite package manager or use the command:

pamac install thermald

After installing it needs to be configured to automatically start at boot in order to work:

sudo systemctl enable --now thermald

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.