AMD CPU Underclocking Question

All about them.

Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee

Post Reply
chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

AMD CPU Underclocking Question

Post by chrisps » Fri Aug 22, 2008 4:59 am

Hi,

I am planning on building a standard definition HTPC / web server / home automation server. Because it is going to be on 24*7, idle power consumption is really important to me.

I have been reading various articles (including on here) about undervolting / underclocking AMD CPUs to really cut idle power draw.

On some of these articles, they talk about "steps", with different core voltages and I am getting slightly confused about it. Can you set the CPU to run at different core voltages / clock speeds depending on load? For instance, if the CPU was only at 10% load, run it dead low to keep the power down, but if it is doing a large encoding job and the CPU load goes up, increase the clock speed and core voltage?

If you can do the above, do you need some kind of Windows utility, or can it be done in the BIOS (I am intending to run Linux).

Thanks!

QuietOC
Posts: 1407
Joined: Tue Dec 13, 2005 1:08 pm
Location: Michigan
Contact:

Re: AMD CPU Underclocking Question

Post by QuietOC » Fri Aug 22, 2008 5:15 am

chrisps wrote:On some of these articles, they talk about "steps", with different core voltages and I am getting slightly confused about it. Can you set the CPU to run at different core voltages / clock speeds depending on load? For instance, if the CPU was only at 10% load, run it dead low to keep the power down, but if it is doing a large encoding job and the CPU load goes up, increase the clock speed and core voltage?

If you can do the above, do you need some kind of Windows utility, or can it be done in the BIOS (I am intending to run Linux).
AMD has a mechanism called Cool'n'Quiet. They have their own software called a "driver" and it normally sets up three states [email protected], some other speed, advertized speed at 1.3V (or whatever default voltage).

There are a few programs that can use the same C'n'Q mechanism to setup your own choice of processor states. I use CrystalCPUID. It also just lets you try settings immediately. Run a CPU stress program like Orthos (Prime95) to see if the current settings are stable.

chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

Post by chrisps » Fri Aug 22, 2008 5:29 am

Great, so it sounds like I just need to find a Linux program which can set the voltages like CrystalCPUID does.

Thanks!

Vicotnik
*Lifetime Patron*
Posts: 1831
Joined: Thu Feb 13, 2003 6:53 am
Location: Sweden

Post by Vicotnik » Fri Aug 22, 2008 6:01 am

There are no such program for Linux I'm afraid, kernel recompile is the only solution as far as I know. There's a thread here somewhere where this is discussed.
(edit: found it - viewtopic.php?t=43757)

Normal CnQ works fine under Linux though.

Under Windows I prefer RMClock over CrystalCPUID.

chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

Post by chrisps » Fri Aug 22, 2008 9:08 am

Thanks for the information about Linux.

I'm not too fussed about having to re-compile the kernel, but it is a pity that there isnt a nice way to do it :(

foobarbaz
Posts: 2
Joined: Fri Aug 22, 2008 11:14 am
Location: Germany

Post by foobarbaz » Fri Aug 22, 2008 11:25 am

A daemon that allows software undervolting of AMD cpus under Linux:

http://sourceforge.net/projects/cpupowerd/

m0002a
Posts: 2831
Joined: Wed Feb 04, 2004 2:12 am
Location: USA

Post by m0002a » Fri Aug 22, 2008 2:08 pm

An AMD 4050e dual core 2.1 GHz only draws 7 watts at idle. how much lower do you need to go? Mine idles at 25 C (ambient room temp is about 23 C) using a XIGMATEK HDT-S1283 CPU Heatsink with no fan attached (although it is not far from a very slow running top case fan on Mini P180).

I also have the 500 GB WD Caviar Green hard drive that also keeps the watts and temps down (Also available in 640 GB and 1 TB size).

chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

Post by chrisps » Sat Aug 23, 2008 5:44 am

Thanks for the link :)

As for how low do I want to go... I was reading an article last night on a German forum (linked from another topic on this forum) where someone managed to get their AMD X2 based system down to 21W total system idle power draw. Really I want the idle power as low as I can and absolutely no higher than 30W.

Those figures from the German site are just as good as the slower Asus EeeBox idle power figures and I can buy the components for roughly the same price :)

Melluk
Friend of SPCR
Posts: 68
Joined: Wed Apr 30, 2003 2:02 pm
Location: The Netherlands

Post by Melluk » Sat Aug 23, 2008 11:56 am

chrisps wrote:... I was reading an article last night on a German forum ... etc.
Can you provide a link please? Thank you.

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Sat Aug 23, 2008 12:27 pm

Melluk wrote:Can you provide a link please? Thank you.
Hello, my first post, on the second I will add the links.

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Sat Aug 23, 2008 12:31 pm

smax3 wrote:Hello, my first post, on the second I will add the links.
Here are the links:

General: http://translate.google.com/translate?h ... c-systeme/

Low-Power-PCs: http://translate.google.com/translate?h ... mspar-pcs/

My Low-Power-PC (Idle under 20W :D):
Windows: http://translate.google.com/translate?h ... glich.html
Linux: http://translate.google.com/translate?h ... -18-w.html

Stable undervolting tool for Linux -> cpupowerd:
http://translate.google.com/translate?h ... linux.html
http://sourceforge.net/projects/cpupowerd
Last edited by smax3 on Tue Aug 26, 2008 11:24 am, edited 1 time in total.

woodsman
Posts: 78
Joined: Tue May 29, 2007 5:22 pm

Post by woodsman » Sat Aug 23, 2008 8:08 pm

I use Slackware (Linux) 12.1. CPU voltage and frequency regulation is controlled by kernel modules. Depending upon the distro you use, you might or might not have to recompile the kernel to support those modules.

There are four basic modules that you can test directly from the command line:

Powersave policy, stick frequency to the slower state.
/sbin/modprobe cpufreq_powersave

Performance policy, stick frequency to the faster state.
/sbin/modprobe cpufreq_performance

Set the frequency on demand. What you want is what you get
/sbin/modprobe cpufreq_ondemand

Same of On demand policy, but for slow switching CPUs (AMD64 e.g)
/sbin/modprobe cpufreq_conservative

If you receive no errors then perform an lsmod to verify the modules loaded. Otherwise you have to recompile the kernel.

Once the preferred module is loaded, check the status of the regulator:

cat /sys/devices/system/cpu/*/cpufreq/scaling_governor

where * is each CPU core. An example of changing the status:

echo ondemand > /sys/devices/system/cpu/*/cpufreq/scaling_governor

I use the ondemand regulator. During idle or low demand my BE-2400 2.3 GHz AM2 dual core CPU runs at 1 GHz and 0.99 - 1.01 Vcore. Maximum demand is 2.3 Ghz and about 1.25 Vcore.

There is a tool called cpufrequtils that makes setting the upper and lower frequency easier. The limits can be set directly from the command line too if you are so inclined.

The ondemand regulator is the best for most people and works great for me. When playing a DVD my CPU remains at 1 GHz and 0.99 - 1.01 Vcore. When demand increases, such as running a virtual machine or compiling software, the CPU automatically ramps upward and when I am finished, resumes the idle state. This is a computer box, not an HTPC, however, therefore I don't know what high definition might do to CPU. If your graphics card does the decompressing, then I'm guessing the CPU will remain mostly in idle state.

I summarized a lot of this in my online journal:

Green Computing

You'll have some work on your part if your distro does not come fully featured, but you should find the basics in the essay.

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Sat Aug 23, 2008 11:10 pm

woodsman wrote:CPU voltage and frequency regulation is controlled by kernel modules.
Thats true, but undervolting can't be done with original kernel modules ("only" the Cool'nQuiet voltages).
woodsman wrote:During idle or low demand my BE-2400 2.3 GHz AM2 dual core CPU runs at 1 GHz and 0.99 - 1.01 Vcore. Maximum demand is 2.3 Ghz and about 1.25 Vcore.
My AMD X2 3800 EE SFF (TDP 35W) runs at 1 GHz with 0.8V (original 1.0V) and at 2 GHz with 1.0V (original 1.1V). On Idle I save 2-3W, on maximum 5-6W.

chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

Post by chrisps » Tue Aug 26, 2008 12:55 am

Thanks for the extra info guys :) - Really useful!

Also, for the people asking for the links.... the specific forum I was refering to was this:

http://translate.google.com/translate?h ... p?t=436832

The 22W idle system spec is here:

http://66.102.9.104/translate_c?hl=en&s ... oK31dAhCvg

Melluk
Friend of SPCR
Posts: 68
Joined: Wed Apr 30, 2003 2:02 pm
Location: The Netherlands

Post by Melluk » Tue Aug 26, 2008 6:37 am

smax3 and chrisps

Welcome to SPCR

And many thanks for the links, very informative.
I've already spent way to many hours catching up on reading. :wink: :lol:

arckuk
Posts: 10
Joined: Wed Dec 05, 2007 8:54 am
Location: London, UK

Post by arckuk » Wed Aug 27, 2008 2:11 am

Thanks very much for the great information in this thread, particularly the pointer to cpupowerd. I downloaded it from sourceforge, and followed the excellent README that is included. It really worked like a dream from that point, and I had no problems undervolting it successfully.

The BE2350 in my Ubuntu based server/torrent/TV recording PC is now idling at 0.85 V @ 1 GHz, rather than 1.1 V, and 1.1 V @ 2.1 GHz, rather than 1.3 V. I will hopefully get the chance to do some power consumption tests soon. As this machine is on 24/7 and mostly runs at 1 GHz when controlled by c'n'q, this is the frequency I spent most time optimising.

Now that I have got this working from the command line, I would like to have cpupowerd start automatically when the machine is powered on, but there seems to be a lack of infomation on how this is done. Does anyone else have some suggestions?

chrisps
Posts: 17
Joined: Fri Aug 22, 2008 4:52 am
Location: UK

Post by chrisps » Wed Aug 27, 2008 12:12 pm

arckuk wrote:mostly runs at 1 GHz when controlled by c'n'q, this is the frequency I spent most time optimising.
Out of interest, what is the rest of the system spec and what power consumption do you get at idle?

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Wed Aug 27, 2008 1:48 pm

arckuk wrote:Now that I have got this working from the command line, I would like to have cpupowerd start automatically when the machine is powered on, but there seems to be a lack of infomation on how this is done. Does anyone else have some suggestions?
On a server without a desktop environment (e.g. Gnome) you can do this:

Add all needed moduls in /etc/moduls .
Create file cpupowerd in /etc/init.d with the following content:

Code: Select all

#! /bin/sh

case "$1" in
  start)
        cpupowerd -d -c /etc/cpupowerd.conf
        ;;
 stop)
        killall cpupowerd
        ;;
 restart)
        $0 stop
        sleep 1
        $0 start
        ;;
 *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 3
        ;;
esac
Add links Sxx and Kxx to the needed runlevel (e.g. Sxx /etc/rc2.d, Kxx /etc/rc6.d).

With a desktop environment, it gives troubles with some processes (e.g. Gnome: gnome-power-manager, hald-addon-cpufreq), because they changes the cpu frequency and cpupowerd are in a wrong status. A security exit is executed as a result.

arckuk
Posts: 10
Joined: Wed Dec 05, 2007 8:54 am
Location: London, UK

Post by arckuk » Wed Aug 27, 2008 2:48 pm

Thanks very much smax3 for that, it's very much appreciated. I had sort of guessed that putting the modules in /etc/modules would be necessary, it was the init script that I needed. I haven't got time to try it out now, but will try tomorrow.

I'll also hopefully have time to test out the power consumption of the rest of my server. Specs are:

Antec Sonata II
Seasonic 330W PSU
Asus M2A-VM HDMI
AMD BE2350
2 x 1GB OCZ 6400 RAM (needs 1.9 V)
1TB Samsung F1 (suspended)
Compro DVB-T200 TV tuner card
2 x Yate-Loon D12SL-12 fans, controlled by zalman fanmate ii
Ubuntu 8.04 desktop.

This machine has slowly been taking over most of my desktop usage roles over the past year or so, to the point that I now hardly ever turn on my Windows machine - it's more powerful, but Windows just seems far too inelegant after the order of a Linux install. I have just got to spend some time sorting out the equivalent functionality to iTunes for syncing my music with my iPod.... Two young children don't leave much time for tinkering with technology!

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Wed Aug 27, 2008 11:11 pm

arckuk wrote:Ubuntu 8.04 desktop.
You have a Ubuntu desktop environment (Gnome).

Please read this thread:
http://translate.google.com/translate?h ... buntu-l/4/

arckuk
Posts: 10
Joined: Wed Dec 05, 2007 8:54 am
Location: London, UK

Post by arckuk » Thu Aug 28, 2008 3:07 pm

smax3. Thanks for your help with this, and for a fantastic tool for undervolting!

Just as a help to anyone else using Ubuntu desktop who wants to autostart cpupowerd, I did the following:

Download and configure cpupowerd according to the README file, including saving the optimal voltages in cpupowerd.conf

Copy cpupowerd.conf to /etc/cpupowerd.conf:
sudo cp cpupowerd.conf /etc/cpupowerd.conf

Load the msr module at startup by inserting a line with 'msr' in it into /etc/modules:
sudo gedit /etc/modules

Create an init script, /etc/init.d/cpupowerd as follows:
sudo gedit /etc/init.d/cpupowerd

Code: Select all

#! /bin/sh

case "$1" in
  start)
	sleep 20
	killall gnome-power-manager
	killall hald-addon-cpufreq
	cpupowerd -d -c /etc/cpupowerd.conf
        ;;
 stop)
        killall cpupowerd
        ;;
 restart)
        $0 stop
        sleep 1
        $0 start
        ;;
 *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 3
        ;;
esac
Note that this script didn't work without the 20 second sleep at the beginning that smax3 mentioned in the link he pointed out above.

set execute permissions to the init script:
sudo chmod +x /etc/init.d/cpupowerd

Add a symbolic link to automatically start the init script at run level 2:
cd /etc/rc2.d
sudo ln -s ../init.d/cpupowerd S99z_cpupowerd


Add a symbolic link to kill cpupowerd at run level 6 (shutdown)
cd /etc/rc6.d
sudo ln -s ../init.d/cpupowerd K60cpupowerd


As far as power savings go, the system uses about 3.5 watts less with with the undervolted CPU - not a huge gain, but better to have than not! My power meter averages around 54.7 watts at 0.85 V @ 1000 MHz with the spec in my earlier post + a spun down seagate 7200.10 500GB that I failed to mention. At 1.1 V (stock), the system draws 58.2 watts.

[Edit - smax3 pointed out below the need to kill cpupowerd at run level 6.]
Last edited by arckuk on Thu Aug 28, 2008 11:36 pm, edited 1 time in total.

smax3
Posts: 10
Joined: Sat Aug 23, 2008 12:15 pm
Location: Austria

Post by smax3 » Thu Aug 28, 2008 11:23 pm

@arckuk:
Don't forget the symbolic link to automatically stop cpupowerd at run level 6 (shutdown) :).

jackylman
Posts: 784
Joined: Sun May 22, 2005 8:13 am
Location: Pennsylvania, USA

Post by jackylman » Wed Oct 15, 2008 3:35 pm

I have a Brisbane 5000 ("Black Edition") and I'm wondering what to undervolt it to. I'm not really in the mood to do a lot of mprime testing, I was just wondering what values I should set cpupowerd to in order to get more undervolting than the stock C'n'Q, yet not risk making the system unstable.

Namheul
Posts: 92
Joined: Sun Jan 16, 2005 8:11 pm
Location: Australia

Post by Namheul » Sun Oct 19, 2008 4:56 pm

I have a Brisbane 4200+, and i use CrystalCPUID.

7x @ .8V
9x @ .9V
11x @ 1V

Post Reply