Linux-PHC CPU undervolting (for Intel processors)
Undervolt your notebook CPU for longer battery life
“Undervolting is the practice of reducing the supply voltage of a computer’s CPU. There are mainly three reasons to do so:
- Reduce power consumption
- Reduce heat generation
- Reduce fan noise
- official forum http://phc.athousandnights.de/
- official website https://www.dedigentoo.org/trac/linux-phc/
- SourceForge download page https://sourceforge.net/project/showfiles.php?group_id=161063/&abmode=1
- GoogleCode PHC patches download
svn co http://phcpatches.googlecode.com/svn/trunk/acpi-cpufreq phcpatches/cpufreq
svn co http://phctool.googlecode.com/svn/trunk/ phctool
- Dan Mihai has written an interesting article concerning undervolting in Ubuntu Lucid 10.04 http://openmindedbrain.info/09/05/2010/undervolting-in-ubuntu-10-04-lucid-lts/
- ubuntuforums.org Ares Drake guide [frequently updated] http://ubuntuforums.org/showthread.php?t=786402
- ubuntu guide [german] http://wiki.ubuntuusers.de/Prozessorspannung_absenken
From Ubuntu Jaunty 9.04 on the ACPI stuff is now in the kernel rather than in a module which requires you to patch and build the kernel sources. Latest distribution kernel patched can be downloaded straight from the PHC PPA: https://launchpad.net/~linux-phc/+archive/ppa
and automatically adding the following line to sources list:
ppa:linux-phc/ppa
then installing them via
sudo apt-get install linux-generic-phc linux-headers-generic-phc
(deb http://ppa.launchpad.net/linux-phc/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/linux-phc/ppa/ubuntu lucid main
- Signing key:
1024R/4D950ED1
[in order to automatically add the signing key have a look at this post]
3. Reboot. If the module is installed correctly, then look here for phc related files
/sys/devices/system/cpu/cpu0/cpufreq/
One should be like this one (values would be of course different):
12:38 10:30 8:24 6:18
UPDATE: Reached this point in Ubuntu Lucid you have to compile the module yourself. It’s as easy as typing 3 words. You could refer to Dan Mihai excellent post liked above for the complete explanation.
In order to minimize any possibility of data corruption I advise you to run this script from Ubuntu Safe Mode / Recovery mode (choose this at boot menu, then root terminal when prompted, if you have no boot menu keep pressed SHIFT / MAIUSC right after powering on the computer). Here you will have a terminal only environment, which also lacks any cpu management module. Remember you are in a root environment, here you may also do system wide damages! Be careful with the commands you type in!
First ensure you have phc-intel module loaded
modprobe phc-intel
If you haven’t granted execution to the script before do it now
# chmod u+x linux-phc-optimize.bash
cat /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
Then run the scripts the terminal with
The value before the: stands for the frequency, the later for the voltage.
4. Okay, now we need to find the lowest save voltages. We will use this optimizer script.
Download it then right-click the files, open the permissions tab, and and down at the bottom check the box that says “allow executing the file…”.
It needs cpuburn installed, so you might want to install it in advance with synaptic. If you haven’t done so yet
$ sudo ./linux-phc-optimize.bash
# apt-get install cpuburn
What this scipt does is: It stresses your cpu while lowering the cpu voltage step by step unil your system crashes. Then the script knows what is too low and will stay safely above. The script needs to run once for every frequency step your cpu is capable of, usually around 4-6 times. It will tell you, just run it so often until it tells you finished.
In case you have a dual core CPU it is advisable to run two instances of cpuburn,
first run
cpuburn &
then run the script (which will run the other instance)
NOTICE:
This script will crash your system. Several times. This is normal and intended. No harm to your hardware is to be expected. However in case you have open files and / or mounted filesystems data loss or corruption might occur. So be advised to unmount as many partitions as possible and open as few files as necessary while doing this. After a reset the fsck utility will check your partitions for data corruption so be strongly advised to let that check run!
All this is not going to occour if you run the script from the recovery mode
Second, the script stresses only one cpu core. In case you have a dual core, open a terminal and type “burnMMX” to run a second thread to stress the second core while doing this.
When you’re finished with the script, you will have a text file with the new and optimized frequency : voltage pairs.
5. To use these optimized values, you will need to echo them to /sys/devices/system/cpu/cpu0/cpufreq/phc_controls. An easy way to do it automatically every reboot is to add a line like this:
echo “12:21 10:1 8:1 6:1″ > /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
to your /etc/rc.local file. Of course you have to replace the values with your own. Any second core should automatically use the same voltages.
6. Check if it works:
cat /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
should now give you the new values (after a reboot) compared to before, see above. It is tested for intel Core2Duo and CoreDuo cpus. For AMD please refer to this page.
A note on minimum voltage by chuck232:
Core 2 Duos should have a min voltage of 15. The minimum for Core 2′s is 0.9V (so 712mV + 15*12.5mV. This is a documented lowest voltage.As for the 136: xx number people are seeing, this is a setting available for many of the 800MHz FSB Core 2 Duo’s. Typically the lowest multiplier is 6, and for a 800MHz quad-pumped FSB CPU, that equates to 6*200MHz = 1.2GHz. However these 800MHz Core 2 Duos can also drop the FSB. At its lowest operating power state, it downclocks to 8 multiplier * 100MHz FSB (400MHz quad-pumped), or 800MHz. That’s why it’s listed as the last entry. The 136 number is just the represenation of that power state. I’d go out on a limb and say that every 800MHz FSB Core 2 Duo should be able to do that state at 136:15 (or 0.9V i.e. the lowest operating voltage).
You may check for your own processor details at http://processorfinder.intel.com/Default.aspx
In case of an Intel Core2Duo T7300 processor the lowest working voltage is 0.85 which corresponds to 11 vID.
Hence the working and stable phc vIDs are these: 22 22 11 11 11
PHC-tool
There is no package, you have to download a subversion snapshot via:
sudo apt-get install subversion
svn co http://phctool.googlecode.com/svn/trunk/ phctool
The tool has a Analysis tab as you can see in the screenshot.
To get this to work, you first need to
sudo modprobe msr
(old obsolete method)
1. This howto depends on the kernel module acpi-cpufreq to control your cpu. To find out if you’re using it:
lsmod | grep acpi_cpufreq
freq_table 5536 3 acpi_cpufreq,cpufreq_stats,cpufreq_ondemand
processor 37384 4 acpi_cpufreq,thermal
2. You need to get a modified version of your acpi_cpufreq module, one with PHC (processor hardware control) support build in. There are several ways to get this module.
a) You can download a patch or a precompiled module on the official forum and official website and compile it yourself.
You can also download the precompiled modules from the authors’ subversion repository, however these are not updated regularly:
svn co http://phcpatches.googlecode.com/svn/trunk/acpi-cpufreq phcpatches/cpufreq
svn co http://phctool.googlecode.com/svn/trunk/ phctool
Note: To find out what kernel you have open a terminal and type:
uname -r
Mini-Howto for compilation (from Ares Drake thread)
extract the tar from /usr/src to /home/”your-username”/”kernelversion”
download latest patch to /home/”your-username”/”kernelversion”
copy /boot/config-$(uname -r).config to /home/”your-username”/”kernelversion”
cd /home/”your-username”/”kernelversion”
patch -p1 < linux-phc*.patch
make oldconfig
make prepare
make scripts
make M=./arch/x86/kernel/cpu/cpufreq
The finished module should be in /home/”your-username”/”kernelversion”/arch/x86/kernel/cpu/cpufreq
Proceed as if you had downloaded this module with copying it to the right place. After all is done you can savely remove the folder /home/”your-username”/”kernelversion” and uninstall linux-source to save harddisk space.
REMEMBER: First backup your old module (basically copies it to a new name ending with .old)
sudo cp /lib/modules/`uname -r`/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko /lib/modules/`uname -r`/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko.old
b) Then copy the downloaded file to the right place:
sudo cp acpi-cpufreq.ko /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq
So once you know, download the right kernel module from Ares Drake thread at Ubuntuforums.net
Kernel modules are also copiled by the THC crew and available on the main download site as well as on the official forum.
You have to redo the entire Step 2 every time you update your kernel, so you might want to save your downloaded module file, as it might work again after a kernel upgrade, i.e. the version -16 worked with -14 and -15 as well, but not with -17.
Related posts:
- nVidia PowerMizer powersaving/cooling in Linux (updated)
- eee-control – the best device control tray icon for Eee-PCs
Print This Post
|
Email This Post

I’d recommend running the linux-phc-optimize.bash script in a Live CD environment.
This way you can be sure, that none of you filesystems get corrupted, when the system crashes.
a moment, I did not understand how to pull out my VID values than frying my system with cpuburn.
I read the last comment on the T7300 but I do not understand: the voltage in which at least 15 units of measurement is expressed, how do you know that for each core is 0.9V, as you have obtained 712mV + 15 * 12.5mV, etc. etc. .
Sorry but I would need a speech step by step.
Ciao ugaciaka!
cpuburn serve per mettere sotto stress il processore ed elevare al massimo il suo assorbimento di corrente al fine di misurarne la stabilita’ per ogni livello di vID.
Quando il PC si spegne (il che significa che il processore non e’ piu’ stabile) lo script salva al riavvio il secondo vID precedente a quello che ha portato all’instabilita’.
Il voltaggio di riferimento minimo e’ ricavabile dalle schde tecniche del processore disponibili sul sito della Intel.
Nota che attualmente (Ubuntu Jaunty 9.04) per poter beneficiare di questo hack devi installarti un kernel personalizzato, essendo non più sufficiente rimpiazzare il singolo modulo.
Quello che non vorrei fare è proprio usare cpuburn.
Vorrei capire sapendo il moltiplicatore, il FSB e i voltaggi minimi (grazie al sito Intel) quali VIDi
VID posso impostare per il mio processore
E6600
- una velocità di FSB di 1066 MHz
- voltaggio espresso in VID (ma non dovrebbero essere spresse così, dovrebbero essere solo valori interi leggendo qua http://www.linux-phc.org/forum/viewtopi … =8&t=9 ) di 0.85V – 1.5V
quindi il mio problema è capire, se il voltaggio minimo è 0.85V, capire il valore intero in VID che vuole PHC
Considera che non c’e’ nulla di male nell’utilizzare cpuburn. Se proprio ti da’ pensiero il nome puoi sempre comprimere un file di 500Mb con 7z e vedere se il processore rimane stabile. Il vantaggio di CPUburn e’ in realta’ che non rischi di danneggiare il disco fisso quando il PC diviene instabile poiche’ il calcolo avviene solo nella RAM.
Se il range del voltaggio e’ 0.85-1.5 e il primo valore che ti restituisce PHC e’, poniamo 36, con una semplice proporzione puoi trovare il valore minimo: 1.5:0.85=36:? da cui (36*0.85)/1.5=20.4 in pratica 21.
[...] fan off longer). This works like a charm on my M65. Information on this topic can be found here: aldeby.org. The linux-pch patch mentioned there is already included in zen-sources, thus you only have to [...]
[...] fan off longer). This works like a charm on my M65. Information on this topic can be found here: aldeby.org. The linux-pch patch mentioned there is already included in zen-sources, thus you only have to [...]
I created an updated version for Ubuntu 10.04 LTS, might check it out at http://openmindedbrain.info/09/05/2010/undervolting-in-ubuntu-10-04-lucid-lts/
Thank you for your great article Dan!
Actually it works for AMD and there is kernel module for AMD also.
I`ve succeded with Turion64, how is written here:
http://www.linux-phc.org/forum/viewtopic.php?f=22&t=217&p=1167#p1167
Thank you very much Gele! I’ve just updated the post with your contribution!