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 - ubuntuforums.org Ares Drake guide [frequently updated] http://ubuntuforums.org/showthread.php?t=786402
- ubuntu guide [german] http://wiki.ubuntuusers.de/Prozessorspannung_absenken
- gentoo guide [mostly obsolete] http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU
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.
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
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). 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 you have to load acpi_cpufreq:
# modprobe acpi_cpufreq
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. This does not work with AMD yet, also no precompiled modules are available at the project page at present. Feel free to check and experiment with them anyway!
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
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.