UndervoltingHowto

Differences between revisions 3 and 4
Revision 3 as of 2006-10-20 22:59:38
Size: 5179
Editor: 213
Comment:
Revision 4 as of 2006-10-21 10:37:29
Size: 5181
Editor: 213
Comment:
Deletions are marked like this. Additions are marked like this.
Line 99: Line 99:
sudo -sh "echo 798000:700,1064000:844,1330000:892,1596000:908" > /sys/devices/system/cpu/cpu0/cpufreq/op_points_table" sudo sh -c "echo 798000:700,1064000:844,1330000:892,1596000:908" > /sys/devices/system/cpu/cpu0/cpufreq/op_points_table"

How to undervolt a Pentium M CPU on Ubuntu Edgy

WARNING !

Use this document at your own risk. Changing the voltage of a Pentium M CPU is not recommended because it can make it run out of its specifications. It can possibly damage your computer. Backup your data regularly to an off line medium.

Introduction

The Pentium M family of CPU's has the ability to change the frequency of the CPU. Each frequency has a specific voltage related to it. Lower frequencies need a lower CPU voltage and higher frequencies needs a higher voltage. If the CPU switches to a lower voltage it consumes less energy (= voltage2 / resistance) and as a result dissipates less heat.

The BIOS of your laptop contains a good table of the possible frequencies and the related voltage. The kernel reads this table and applies the correct voltage to the CPU. It is possible to override this table and run your CPU on a lower voltage. Some reason why you might want to try this are:

  • Longer battery live
  • Less noise
  • Less heat
  • More environmental friendly

Some reasons you don't want to do it:

  • The functions to change the voltage are not supplied with the Linux kernel in Ubuntu. You have to recompile the kernel yourself (read on).
  • Your system can become unstable. The standard voltages are tested by Intel. A too low voltage can crash your computer or make it unstable (e.g. damage your filesystem).
  • Although I didn't read any reports about it, it can possibly permanently damage your hardware, void your warranty and explode in your face.

If you are happy about your laptop, it is stronly recommended not to use this howto.

Rebuilding the kernel

This procedure is based on the KernelCustomBuild page.

Create a new working directory:

$ mkdir ~/undervolt
cd ~/undervolt

Download the latest kernel source (replace vv with the version of the current kernel):

$ apt-get source linux-image-2.6.17-vv-generic

This creates a directory in your working directory with the kernel source.

Download the latest version of the linux-phc patch at the projects website https://www.dedigentoo.org/trac/linux-phc/ in the undervolt directory.

$ wget http://belnet.dl.sourceforge.net/sourceforge/linux-phc/Linux-PHC-0.2.7.tar.gz
tar zxfv Linux-PHC-0.2.7.tar.gz

Now we are ready to patch the kernel:

cd linux-source-2.6.17-2.6.17
patch -p1 < ../linux-phc-0.2.7/kernel-patch/linux-phc-0.2.7-kernel-ubuntu-2.6.17.patch

The patch adds a few options to the kernel configuration so we have to run:

debian/rules updateconfigs

Answer allways yes (y) to the new options.

The command can return an error because the files in the directory debian/bin/ are not executable. This bug will probably be resolved in later version of the kernel package. Remove this note if the above command worked fine for you. If not:

chmod +x * debian/bin/

To build the package enter:

AUTOBUILD=1 fakeroot debian/rules binary-debs flavours=generic

This compiles only the 'generic' kernel. You likely want to use this flavour on a Pentium M system.

When the build is ready, install it on your system. Replace xxxx. This is a random string.

sudo dpkg -i debian/build/linux-image-2.6.17-vv-xxxx-generic_2.6.17-10.33_i386.deb

Reboot.

Check if the installation was successful:

cat /sys/devices/system/cpu/cpu0/cpufreq/voltage_table

(the file should exist).

Userspace

This part describes how to install the user space scripts and how to configure them.

cd ~/undervolt/linux-phc-0.2.7/ubuntu

First we have fix a small error on the first line of the startup script. Change  #!/bin/bash  in  #!/bin/bash  in  etc/init.d/undervolt .

Install the userspace scripts of the Linux-PHC package:

sudo cp etc/init.d/undervolt /etc/init.d/
sudo cp -r etc/phc-config/ /etc/

Change the configuration file /etc/phc-config/undervolt now.

cat /sys/devices/system/cpu/cpu0/cpufreq/op_points_table

Copy this value in the configuration file in the DEFAULT_VTABLE variable and change the IS_CONFIGURED value to yes. Optionally you can set the SWITCH_BACK value to yes.

Now you have to find out the best 'undervolting' values for your system. Start with the values original values in /sys/devices/system/cpu/cpu0/cpufreq/op_points_table. You can change the values with this command:

sudo sh -c "echo 798000:700,1064000:844,1330000:892,1596000:908" > /sys/devices/system/cpu/cpu0/cpufreq/op_points_table"

The settings take effect immediately. The [http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU#Finding_the_best_voltage_settings Gentoo wiki] contains information how to find out the best values for your system. The settings in the table turned out to be remarkably accurate for my system. YMMV.

If you found a value that satisfied your needs, copy it into the CUSTOM_VTABLE variable in /etc/phc-config/undervolt.

Add the startup script to the boot sequence:

cd /etc/rc2.d/
sudo ln -s ../init.d/undervolt S95undervolt

Done !

UndervoltingHowto (last edited 2009-01-15 22:16:08 by 82-169-236-159)