Difference between revisions of "PHC"

From ArchWiki
Jump to: navigation, search
m (Installing the necessary packages)
(Automatic module generation with DKMS: style)
 
(39 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 
[[Category:CPU]]
 
[[Category:CPU]]
 
[[Category:Power management]]
 
[[Category:Power management]]
 +
[[ja:PHC]]
 
[[ru:PHC]]
 
[[ru:PHC]]
{{Translateme}}
+
{{Related articles start}}
{{Article summary start}}
+
{{Related| Laptop}}
{{Article summary text | Provides a guide to installing, configuring and using a PHC.}}
+
{{Related| Pm-utils}}
{{Article summary heading | Related articles}}
+
{{Related|CPU frequency scaling}}
{{Article summary wiki | Laptop}}
+
{{Related articles end}}
{{Article summary wiki | Pm-utils}}
+
PHC is an acpi-cpufreq patch built with the purpose of enabling undervolting on your processor. This can potentially divide the power consumption of your processor by two or more, and in turn increase battery life and reduce fan noise noticiably. PHC works only if your processor's architecture supports undervolting.
{{Article summary wiki | CPU Frequency Scaling}}
 
{{Article summary end}}
 
 
 
==Introduction==
 
 
 
PHC is an acpi-cpufreq patch built with the purpose of enabling '''arbitrarily''' undervolting on your processor. PHC works only if your processor's architecture supports undervolting. This is the ultimate and extreme tweak to reduce power consumption in modern PCs, therefore it's very interesting, especially for laptop computers.
 
 
 
For a complete power management suite see ''Related articles'' in top-right of the page.
 
 
 
===Automatically undervolting CPUs===
 
 
 
As of right now, the only automatic CPU voltage solution available is the {{AUR|cpupowerd}} package in the AUR and is only available to AMD users. If you own an Intel processor, then you need to install the {{AUR|phc-intel}} module, again from the AUR, and manually configure your own voltages.
 
  
 
==Supported CPUs==
 
==Supported CPUs==
  
PHC supports the two most common processor families:
+
PHC supports the following processor families:
 
 
*Intel
 
*AMD
 
  
 
===Intel===
 
===Intel===
 
+
{{note|Current Intel core i CPUs use Intel P-states instead of acpi_cpufreq and are therefor not compatible with PHC.}}
 
*Mobile Centrino
 
*Mobile Centrino
 
*Atom (N2xx)
 
*Atom (N2xx)
 
*Core / Core2 (T and P Series)
 
*Core / Core2 (T and P Series)
*Core i (tested on Core i3 550)
+
*Core i (2nd generation and older, tested on Core i3 550)
 +
{{note|Frequency locking does not seem to be working on Core i3 with the current stable 0.3.2 release of PHC, so finding the best vids for all but the highest frequency might be difficult or impossible.}}
  
 
===AMD===
 
===AMD===
Line 39: Line 26:
 
*K8 series
 
*K8 series
  
{{Note | there is also a package in AUR named {{AUR|cpupowerd}}, which is somehow related to downvolting on AMD processors, check it out!}}
+
== Installation ==
  
==Installing the necessary packages==
+
[[Install]] the {{AUR|phc-intel}} package if you have an Intel processor, or {{AUR|phc-k8}} if you have an AMD-K8-series one.
  
Install {{AUR|phc-intel}} if you have an Intel processor, or {{AUR|phc-k8}} if you have an AMD-K8-series one.
+
Next you need to compile the module for your kernel; this will also be necessary after a kernel update (but see the section below on using DKMS to automate this).
  
{{Note | The required packages are not present in the main repository, so you must install them from the [[Arch User Repository|AUR]].}}
+
You need to have {{pkg|linux-headers}} and/or {{pkg|linux-lts-headers}} installed to be able to build the module.
  
Install phc-intel (assuming you have an Intel CPU) and phctool from the AUR. Next you need to compile the module for your kernel, this will also be necessary after a kernel update.
+
Type:
 +
# phc-intel setup
 +
or
 +
# phc-k8 setup
 +
depending on processor.
  
You need to have {{pkg|linux-headers}} and/or {{pkg|linux-lts-headers}} installed to be able to build the module.
+
If the [[CPU frequency scaling#CPU_frequency_driver|''acpi-cpufreq'']] module is not already being loaded at boot, create the appropriate file in {{ic|/etc/modules-load.d/}}. See [[Kernel modules]] for more information.
 +
 
 +
{{Note|In the case of {{AUR|phc-intel}}, the ''acpi-cpufreq'' module is automatically loaded by {{ic|/usr/lib/modprobe.d/phc-intel.conf}}.}}
 +
 
 +
=== Automatic module generation with DKMS ===
 +
The {{AUR|phc-intel}} package uses DKMS to automatically update the module after a kernel update.  This is done at shutdown time to ensure that the kernel and kernel-headers are in sync (which is not necessarily the case during a system upgrade, depending on the order at which updates are installed).
 +
 
 +
[[Enable]] {{ic|dkms-phc-intel.service}}.
 +
 
 +
== Configuration ==
  
# /etc/rc.d/phc-intel setup
+
=== Finding safe low voltages ===
  
Then add "acpi-cpufreq" in the modules section of your {{ic|/etc/[[rc.conf]]}} file, if you have not done it before.
+
To automatically find the best voltages, you can use the [https://bbs.archlinux.org/viewtopic.php?pid=1141702#p1141702 mprime-phc-setup] script ([https://bitbucket.org/stqn/shell-tools/src/ source-code]). Just copy the code into a text file, chmod +x it to make it executable and run it. You need to install {{AUR|mprime}} or {{AUR|mprime-bin}} first (it is used to check that the CPU is stable). This script has not been tested on many systems yet, but should be safe.
  
==Configuring PHC==
+
=== Editing the configuration ===
  
After the phc module is compiled and the lowest voltages are found, they need to be added to the configuration file at {{ic|/etc/conf.d/phc-intel}}.
+
After the phc module is compiled and the lowest voltages are found, they need to be added to the configuration file at {{ic|/etc/default/phc-intel}} or {{ic|/etc/default/phc-k8}}.
  
# VIDS="25 22 15 8 5"
+
For example:
  
Even if it's possible to configure phc using a command line interface, the configuration is much easier using phctool.
+
VIDS="25 22 15 8 5"
Just run
 
  
# phctool
+
Simply restart the system and the modules will be loaded automatically by systemd.
  
and select the "voltage" tab.
+
== Troubleshooting ==
Every processor has its own VID values: finding the value that fits your processor's needs is up to you.
 
  
===Module loading===
+
=== Module loading ===
  
 
Run:
 
Run:
  
  # dmesg | grep acpi-cpufreq
+
  $ dmesg | grep acpi-cpufreq
  
 
If you see errors regarding this module, something has gone wrong OR you cannot use PHC.
 
If you see errors regarding this module, something has gone wrong OR you cannot use PHC.
  
===Hardware recognition===
+
=== Hardware recognition ===
  
 
There should be some files in {{ic|/sys/devices/system/cpu/cpu0/cpufreq/}} beginning with "phc_".
 
There should be some files in {{ic|/sys/devices/system/cpu/cpu0/cpufreq/}} beginning with "phc_".
 
To check whether PHC is working or not, just type:
 
To check whether PHC is working or not, just type:
  
  # cat /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
+
  $ cat /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
  
 
you should read some values. If the values do not appear, then PHC is probably not supported by your CPU.
 
you should read some values. If the values do not appear, then PHC is probably not supported by your CPU.
  
===Voltage controlling===
+
=== Voltage controlling ===
 +
 
 +
You can easily check whether PHC is working or not by looking at the cpu voltages: if the voltages are lower than the normal ones, then PHC has done its job. You can also manually set voltages, for example:
 +
# echo 34 26 18 12 8 5 > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids
 +
 
 +
=== System stability ===
  
You can easily check whether PHC is working or not by looking at the cpu voltages: if the voltages are lower than the normal ones, then PHC has done it's job. You can also manually set voltages, for example:
+
To make sure that your undervolted CPU is stable, you can run long sessions of {{AUR|mprime}} and/or {{AUR|linpack}} (Intel-only).
echo 34 26 18 12 8 5 > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids
 
To find the best values, install {{AUR|linux-phc-optimize}} from the [[Arch User Repository|AUR]]. The script progressively lower the values until the system crashes, and add two the values for stability. Because the system will crash, do not do anything else during the tests. Run it once for each value, then check {{ic|/usr/share/linux-phc-optimize/phc_tweaked_vids}}.
 
  
 
==Links==
 
==Links==

Latest revision as of 10:45, 23 August 2017

PHC is an acpi-cpufreq patch built with the purpose of enabling undervolting on your processor. This can potentially divide the power consumption of your processor by two or more, and in turn increase battery life and reduce fan noise noticiably. PHC works only if your processor's architecture supports undervolting.

Supported CPUs

PHC supports the following processor families:

Intel

Note: Current Intel core i CPUs use Intel P-states instead of acpi_cpufreq and are therefor not compatible with PHC.
  • Mobile Centrino
  • Atom (N2xx)
  • Core / Core2 (T and P Series)
  • Core i (2nd generation and older, tested on Core i3 550)
Note: Frequency locking does not seem to be working on Core i3 with the current stable 0.3.2 release of PHC, so finding the best vids for all but the highest frequency might be difficult or impossible.

AMD

  • K8 series

Installation

Install the phc-intelAUR package if you have an Intel processor, or phc-k8AUR if you have an AMD-K8-series one.

Next you need to compile the module for your kernel; this will also be necessary after a kernel update (but see the section below on using DKMS to automate this).

You need to have linux-headers and/or linux-lts-headers installed to be able to build the module.

Type:

# phc-intel setup

or

# phc-k8 setup

depending on processor.

If the acpi-cpufreq module is not already being loaded at boot, create the appropriate file in /etc/modules-load.d/. See Kernel modules for more information.

Note: In the case of phc-intelAUR, the acpi-cpufreq module is automatically loaded by /usr/lib/modprobe.d/phc-intel.conf.

Automatic module generation with DKMS

The phc-intelAUR package uses DKMS to automatically update the module after a kernel update. This is done at shutdown time to ensure that the kernel and kernel-headers are in sync (which is not necessarily the case during a system upgrade, depending on the order at which updates are installed).

Enable dkms-phc-intel.service.

Configuration

Finding safe low voltages

To automatically find the best voltages, you can use the mprime-phc-setup script (source-code). Just copy the code into a text file, chmod +x it to make it executable and run it. You need to install mprimeAUR or mprime-binAUR first (it is used to check that the CPU is stable). This script has not been tested on many systems yet, but should be safe.

Editing the configuration

After the phc module is compiled and the lowest voltages are found, they need to be added to the configuration file at /etc/default/phc-intel or /etc/default/phc-k8.

For example:

VIDS="25 22 15 8 5"

Simply restart the system and the modules will be loaded automatically by systemd.

Troubleshooting

Module loading

Run:

$ dmesg | grep acpi-cpufreq

If you see errors regarding this module, something has gone wrong OR you cannot use PHC.

Hardware recognition

There should be some files in /sys/devices/system/cpu/cpu0/cpufreq/ beginning with "phc_". To check whether PHC is working or not, just type:

$ cat /sys/devices/system/cpu/cpu0/cpufreq/phc_controls

you should read some values. If the values do not appear, then PHC is probably not supported by your CPU.

Voltage controlling

You can easily check whether PHC is working or not by looking at the cpu voltages: if the voltages are lower than the normal ones, then PHC has done its job. You can also manually set voltages, for example:

# echo 34 26 18 12 8 5 > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids

System stability

To make sure that your undervolted CPU is stable, you can run long sessions of mprimeAUR and/or linpackAUR (Intel-only).

Links