Zds Project Log

17.9.2008

How to enable power saving on k8 CPU in Linux

Filed under: Uncategorized — zds @ 20:04

Background

All modern CPUs (AMD Athlon 64 and Intel Core series to name the most popular) support functionality called “CPU power scaling”. This means that when the CPU is not doing anything, ie. is sitting idle or doing only some light work, it runs at lower clock speed and lower voltage than normally. When CPU is loaded, the speed is adjusted accordingly so that you get the full power to your hands.

So in essence, the point is to reduce the speed of the CPU when the speed is not needed and call it back as soon as there is something to do. Makes sense, doesn’t it? The sad thing is.. you need to do this yourself, because by default this functionality is disabled. This post goes to explain how.

Case: our home server

As nowadays our home server is the only piece of electronic hardware that run 24/7 in our apartment, I have had a project on reducing it’s power consumption. Surprisingly move from power-hungry (at it’s time) Athlon XP to more power efficient Athlon 64 X2 did not help much. I guess the motherboard itself, Asus A8N-SLI Deluxe, and its NForce 4 chipset consume too much and balance for the more energy-efficient CPU. Then again, now the gigabit ethernet runs on PCI Express bus, machine has 2G instead of 256M of main memory, there is four hard drives instead of three and naturally the dual-core CPU has at least three times the horsepower compared to the old one, so still running at almost the same AC power is not that bad in the end.

Now, to the benefit of all the potential googlers and to help my own memory, follows a brief description of how I got the power saving enabled and how I checked it actually works.

Hardware
OS: Ubuntu Linux Hardy
CPU: AMD Athlon(tm) 64 X2 4600+
Mobo: Asus A8N-SLI Deluxe
Memory: 4G DDR-400 total
PSU: Antec 350W, bundled
Hard drives:
ST3120022A Seagate Barracuda 7200.7 120G
WD3000JB-00KFA0 Western Digital Caviar SE 300G
ST3160023A Seagate Barracuda 7200.7 160G
WD6400AAKS-00A7B0 Western Digital Caviar 640G

Results
Without CPU performance scaling enabled: 124-131W AC on light load/idle.
With CPU performance scaling enabled: 110-116W AC on light load/idle.
Saving: 14 to 15W AC.

In this particular case the savings are not tremendous.. I really should look into replacing the PSU with a modern one. But still, 15W 24/7 is energy wasted.

Notes: the hard drives are not the definitely most quiet models available, mostly because I buy server hard drives when some old ones fails and thus I want something that’s available right now, right here. Still all of those four drives running on hard surface are easily drown by the sound of quiet 92mm and 80mm fans keeping the CPU and chipset cool.

Seeing how the CPU runs
This applies to both Linux and Windows: Go to http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_871_13118,00.html and download the AMD Power Monitor. Install it and run to see your CPU speed and voltage:

What you want to see is to have the voltage be reduced to 1.1V and clock speed to 1GHz when the machine is idle and then check that it rises back to full speed (like 3200MHz and 1.4V) when machine is loaded. Especially the voltage reduction is important - clock speed increases power usage linearly while core voltage increases power usage to second power or more.

To install the Power Monitor to my Ubuntu box I first installed Alien by running

apt-get install alien

as root. Then I downloaded the Power Monitor rpm (tagged RHEL 32-bit in this case) and used alien to create .deb of it:

alien PowerMonitorLinux-1_0_4_118-RHEL4-External.bin.rpm

Then installed the resulting .deb:

dpkg -i powermonitorlinux_1_0_4-1_i386.deb

And finally ran the Power Monitor itself:

amdpwrmon

Note that this is X program - so you need to have X support. In my case I ran it remotely by running and X server on my Windows box, but you can naturally run it locally, too, if you have X running.

Necessary drivers

To actually install the CPU scaling support I followed this tutorial: http://ubuntuforums.org/showthread.php?t=248867. It should work equally for Debian, too.

Since I am running stock Hardy kernel, 2.6.24 derivative, the necessary modules were already compiled with my kernel, so I needed just to make sure they are loaded at every boot and then configure them to save energy by enabling mode ondemand.

16.12.2007

Network performance testing

Filed under: Uncategorized — zds @ 2:06

I have for some time longed for a tool that would run in both Windows and Linux and be able to test the raw speed of the network between two endpoints. Now, half accidentally, I ran into this thread: Slow Gigabit Network - Win XP. And there it was: iperf.

With iperf I found that the bottlenecks were the actual pieces of software doing downloads, not the network itself. I managed to pull some 300+ megabits per second over TCP with gigabit link between nForce gigabit NIC and Netgear PCI NIC, and 700+ megabits between the said nForce NIC and Realtek TRL8111B integrated on Riitta’s Asus M2A-VM motherboard. Satisfactory to say the least.

Strongly recommended.

2.12.2007

Opening a Fujitsu-Siemens Lifebook S7010

Filed under: Uncategorized — zds @ 23:13

This is just a quick report to help friendly googlers.

We today disassembled a Lifebook S7010 to examine problems in the cooling fan. Unfortunately after opening it we found nothing in the cooler we could have fixed, tho the thermal paste was in bad shape and we changed it; hope it helps the cooling somewhat.

However, when assembling the system back we got it working but the backlight was not working. Suspecting broken inverter we tore the machine back apart but as we had not touched it, we found it strange to have broken it.. The problem was solved when I screwed back the screws securing the D-Sub external VGA connector to the chassis - after fastening them the backlight worked like new.

Seems the inverter is grounded with the screws that also hold the VGA connector in place. Talk about kludge..

2.7.2007

TEC experiment

Filed under: Uncategorized — zds @ 15:20

Introduction

In computer enthusiast circles thermo-electric Cooling Modules, or TEC modules, or Peltier elements and best known for their use in keeping overclocked monster CPUs cool, or getting below the ambient without compressor equipment. In extreme overclocking TECs are usually asked to pump as much heat as they can and are operated near 80% of the maximum wattage they can move. They have however a lot more uses than that, and in this article I am diving into completely other part of their range of usage.

The TECs have an important property I am going to take advantage of: the less you ask them to do, the more they can do per given amount of power. This means that if you have TEC rated for moving 172 watts of power at maximum (Qmax 172W) and you ask it to move 150 watts, you need to throw in a lot more than the 150W to get it done. But if you ask it to move 30W, it might need only 10 watts of power to do it, thus having Coefficient of Performance of 3.0: moving 3 watts per watt consumed.

In theory this should mean that if your TECs are clearly more powerful than the component to be cooled and you run them seriously undervolted, you should get the component kept cooler than without TEC, without changing the other parts of the cooling system.

Test setup

To validate this theory I first used Kryotesc, TEC system calculation software provided by Kryotherm, one of the leading TEC manufacturers. By varying parameters I ended up having considering overrating Qmax 7-8 times being a good compromise for efficient cooling.

So I acquired a DRIFT-0,8 TEC module from Coolputer. It’s rated for Qmax 172W and 24.6V. This means I can seriously undervolt it using just the pre-existing ATX power lines, +5V and +3.3V. Here’s the test equipment in group portrait:

The other components are 1ohm/100W power resistor, el cheapo two-sensor thermometer, 50×50mm piece of 3mm aluminium flat, passive heatsink used to cool Pentium Pro and old Enermax ATX power supply. Part of the test but not in the picture are two small active coolers.

The power resistor was connected to +5V line, which theoretically should make it produce 25W of heat. In practise the regulation of the power supply and resistance of the wires lowered this figure quite a lot.

I did not use any thermal compound, so to get comparable results without TEC I used the aluminium flat in place of it:

The thermometer sensor was taped to the resistor and we were good to go.

Three sets of configurations were tested: Just the resistor with heatsink and aluminium flat for comparison, and heatsink, resistor and TEC running at 3.3V and 5V (nominal).

On the batch of runs I tried using the passive heatsink (originally used to cool my Pentium Pro 180 CPU), but while it showed expected results, it was way too prone to changes in the environment. It was hard to get it to stabilize even to within a whole degree of Celcius.

The next cooler to try was an old tiny aluminium heatsink with a 40mm fan, possibly from some 486dx100 CPU. I reasoned that despite of the small size it should easily beat the all-passive heatsink, but the smell of overheated electronics soon signalled I was terribly wrong. The fan seemed to have worn out and the cooler had lost even the smallish cooling power it had once had.

After letting the parts to cool down a bit I brought in what I think is fairly new chipset stock cooler. With aluminium flat the setup looks like this:

And with TEC:

Caveats

In the end the results I got are to be considered preliminary, as while measuring the setup and running tests I found several weaknesses in my testing methodology:

1) The inherent (and pre-known) weakness is that as the resistor is not insulated in any way, inevitably fair amount of heat moves to air without going through our test heatsink assembly.

2) The test PSU, old 230W Enermax ATX one, seemed to have exceptionally bad voltage regulation. It is rated for 20A for 5V line, but by no means I could run the resistor and the TEC module from it without voltage dropping to 4V or below. This means the heat load was smaller than hoped for and that the results between different setups are not that comparable, as the TEC load affects also the heat generated by the resistor.

3) The low resistance of the resistor itself (1 ohm) combined with bad voltage regulation means that there’s no way to measure the heat generated precisely, as even the wires from the PSU cause resistance in the same order of magnitude. Even putting the measuring equipment to the loop affects the system noticeably, so margin of error for the results is quite high. In the final run I hooked the resistor and the TEC module to the ATX motherboard connector, not the molex ones, to get a bit more stable voltages.

4) The thermometer used in these tests is cheap and is pretty certainly not calibrated. However I have all reasons to believe it is consistent, ie. given the same real temperature it shows always the same reading. And as temperature delta and differences between deltas in different setups are the relevant things, I don’t think this weakness really skews the results.

5) The experiments should be done in a space with more constant airflow and temperature conditions.

Results

With all these disclaimers, here are the numbers. Ambient temperature was between 24 and 28 degrees during testing.

Setup Measured thermal load TEC power usage Temperature delta C/W CoP max. CoP est.
ALU flat 4.6V * 4.15A = 19.1W n/a 27.8°C 1.46 n/a n/a
TEC @5V 4.65V * 4.1A = 19.1W 4.94V * 1.54A = 7.6W 21.2°C 1.11 2.51 2.01
TEC @3.3V 4.67V * 4.07A = 19.0W 3.31V * 1.11A = 3.7W 18.8°C 0.99 5.14 4.11

First of all, the C/W numbers for TEC setups are there just to get some idea about the cooling performance between these three setups. You can *not* extrapolate these results linearly. Second, the CoP numbers are just estimates, as it is not known how large portion of the heat gets transferred to air without ever going through the TEC. The first CoP value sets the upper limit by assuming that all the heat would go through the TEC and the second, more realistic but more vague number calculates the CoP assuming 80% of the heat goes through the TEC.

As you can see, at least these results show the same pattern the simulator does: both TEC setups beat the reference aluminium flat and TEC running at 3.3V does better job than the same TEC running at 5V. This is due to better CoP, so less extra heat is produced and thus heatsink has to do less work.

What this mean in practise is that you can get your chip run cooler *with the same heatsink and fan* if you employ TEC properly. You can extrapolate the rating of the TEC(s) needed by multiplying all the parts with the same multiplier: if you for example double the heat load, you need to double the rating of the TECs and double the efficiency of the heatsink to keep the temperature the same. All other means of linear extrapolation are doomed due to non-linear behaviour of the TECs.

Also in practical applications you want some intelligent circuitry to run the TEC(s), so that they do not accidentally put the chip below the dew point and thus risk condensation occurring. One way to do this would be to harness a microcontroller to monitor the temperature and PWM the TEC to keep the cold side at the same temperature regardless of the load. As TECs need quite a lot of power and they do not like PWMing, you need to chain some hi-power transistor to keep the microcontroller circuitry from frying and hi-capacity capacitor in between to even out the voltage. Needless to say, if you are not familiar with these concepts, ask someone who is to help.

Further work

First of all, the TEC and the temperature source should definitely be fed from different PSUs to rule out the possibility of the TEC load affecting the thermal load. Second, the thermal load should be better insulated so that we’d have clearer idea about what exactly is the thermal load we are coping with.

Third, it would be interesting to hook up two TEC modules electrically in series and physically both in parallel and in series and see how that compares to a single one. Simulations with Kryotherm software indicate the electrically series physically parallel configuration should yield even better CoP, but it’d be nice to get that validated myself.

19.2.2006

Silencing home server, next step

Filed under: Uncategorized — @ 21:59

This goes out to prove that sometimes you do not need lot of time or budget to silence something:


I got bored to Titan fan howling on the home server heatsink and swapped in thermally controlled Acoustifan. In addition to swapping the fan I also added four tiny pieces of 1mm rubber sheet and attached the fan with cloth rubberband. Very cheap, very easy, very effective. And my ears thank me.

13.1.2006

Home server up again

Filed under: Uncategorized — @ 3:49

As one of the disks in our home server broke before x-mas, I had to shut down and open up the home server to swap the drive. Now that I had it open anyway, I thought it would make sense to upgrade the hardware at the same time. Just swap in new MB, CPU, memory and the replacement HDD and start it up again… Bzzzt. Boy, I was wrong. But well, more on that story later on, now I have got it up’ n’running again.

Here is the server in the old setup:

The old machine was AMD K6 450MHz class veteran, and even while it had almost 400M of memory, it’s IO bandwidth just couldn’t keep up with the four 7200RPM IDE drives in two physical (four logical) controllers. So I gathered stuff I had lying around; obsolete Duron and Athlon XP 2000+ processors given by friends, DIMM module that didn’t work reliably at DDR400 anymore and Chaintech Socket-A MB from online auctioning servive.

To swap the MB I had to rip out almost all the guts, and as I didn’t want to do it multiple times, I first built the new system in a classic ghetto way:

After lot of hassle, tuning with Ubuntu Live CD (very nice tool also for configuring hard drives..) and trial with another Socket-A MB from another friend I ended up packing all the data to the two Seagate drives, 120G and 160G in size.

It was time for these old workhorses to retire:

They all all Deskstars, 20G, 30G and 40G in size. The bottommost (40G) is the only one that’s broken for sure; the two others are just suspicious and slow enough so that I decided the additional 50G of disk space just isn’t worth all the troubleshooting. 24/7 server use is tough job for such old beasts, after all.

With them I could also swap out this nice piece of hardware:

It’s four device Ultra ATA 133 controller I had used to have dedicated lane for each of the four drives. Now that I have only two disks, two IDE connectors on the MB are enough.

The server is also *a lot* quieter now; I almost feel like keeping it in our study for easier tuning ;-). I need still to swap the CPU fan to some thermally controlled model and maybe do some tricks to the PSU fan, but the HDDs are now well below the ambient noise.

23.12.2005

AnandTech: NVIDIA Will Buy ULi

Filed under: Uncategorized — @ 16:34

According to Anandtech NVIDIA Will Buy ULi Electronics.

Too bad :-(. ULi has been a manufacturer with very interesting products and lately especially complementing ATI chipset products. NVidia on the other hand fights fiercely against ATI and is known to have used unfair competitive practises when in a position to be able to do so.

But we’ll see.. I’ll keep keep my fingers crossed for ATI getting stronger and ULi designers changing jobs :-].

18.12.2005

Amazing case mod

Filed under: Uncategorized — @ 19:22

This left me breathless:

I immediately started to want to have sandcasting equipment :-).

12.12.2005

Listening tests

Filed under: C case, Uncategorized — @ 1:01

We had an argument on SPCR forums over acoustic footprint of the Laing Delphi pump, so I felt compelled to make some head-to-head listening comparisons.

The contestants and some test equipment:

On the back the Laing Delphi 12VDC pump. On the front from left: PAPST 8412NGL 80mm fan (rated 0.045A / 12dB(A) but definitely louder), Thermaltake A2277 120mm UV fan (0.3A / 21dB(A)) and Silverstone FM121 120mm fan (0.4A / 17-39.5dB(A)).

Testing:


As it’s now daytime, I didn’t even try to measure absolute noise level, just make relative head-to-head comparisons. In order to eliminate vibration noise all contestants were placed on 50mm thick soft foam. Acoustics on the measurement room were quite challenging: walls are mostly bare and hard (concrete and similar).

Fully bleeding the small loop I made for testing the pump proved out to be quiet a challenge and there definitely was some additional noise due to miniscular airbubbles when I made listening tests.

But even on this level I had to go really close to the pump to hear any sound. Mostly the sound seemed to come from water turbulence, as the pump rushed the water throught the tight loop and fairly restrictive T piece used to bleed the system. In these ambient conditions (ambient sound level below 25dB(A), maybe as low as 20dB(A)) it was hard to hear the pump at all.

Results:

Pump against PAPST:

PAPST at 12V was clearly louder than the pump. It was by no means noisy, as it’s one of the most silent fans I have ran into, but it had some level of low-frequency clicking motor noise and air turbulence noise easily heard from distances below 1 meter. It was by no means noisy, and it would be very hard to hear if it was inside a properly
constructed case.

I have soldered a trimmer pot to the PAPST to be able to fine-tune the voltage level, but as I wanted to use only known voltage levels I set it to zero resistance.

Next step was to do the 7V trick and at this level PAPST fell clearly below the pump in noise level. I had to strain my hearing to hear either of the devices, but the pump was more easily audible at this test. My guesstimate is that the pump equals in noise PAPST volted to 9V.

Thermaltake fan against the pump:

Thermaltake at 12V was so much louder than the pump that were really was no contest. At 7V is was a tad louder than the pump, but this was maybe the closest pair in this test - it’s more up to your hearing, ambient noise and preferences which one you determine louder.

Next I managed to test that the Silverstone fan at 5V started cleanly and was more silent than TT@7V or pump@12V, but also didn’t provide much airflow to talk about.

At this point the ancient PSU I used to run the equipment shut itself down and didn’t start again. I have blocked it’s fan from running in order to eliminate it as a noise source and I guess something overheated… Oh well.

Anyway, the conclusion is: the Laing Delphi pump I own can honestly be defined as quiet. It equaled noisewise one of the most silent 80mm fans I have at around 9V and the most silent 120mm fan I have at 7V.

In the Laing Delphi there really is not much noise to talk about than the sound that water causes when is circulates in the tubing. I noticed some noise from the impeller, some infrequent very quiet clicks every now and then, but they were too quiet to be heard from any distance greater than 30cm and I think they might be due to poor bleeding of the system at this point.

EDIT:

This started to intrigue me and thus I dug out my digital multimeter. After confirming that it gave believable readings (some 12.05V on 12V rail and 5.03 on 5V rail), I tried to set the PAPST fan as close to the noise level of the pump as I could. I ended up going back and forth between 9V and 10V - they are so different on the type of the noise they produce it’s hard to define when they are even. At this point the loop had also been better bled, so most of the noise from the pump was impeller noise.

To get another opinion, I also let my girlfriend to have a say. She’s an engineer so while she’s not a silencing enthusiast, she has some knowledge about technical equipment.

I let her to set the PAPST to voltage level where the pump and the fan are equally noisy and she found it as hard as I did, but finally ended up at 10.3V. In relation to the TT fan she confirmed my results: TT@7V was a tad quieter than the pump, but you had to listen carefully to notice it. At TT@12V it was easy for her also to say that the TT was clearly louder.

Of course I didn’t tell her my own opinions beforehand to get non-biased measurements.

1.11.2005

More drooling

Filed under: Uncategorized — @ 16:29

I am not sure if I’d like to really use that kind of keyboard as my primary one, but hey, it’s totally cool nevertheless: Déck keyboard

Thanks go to grumblemarc.

31.10.2005

The Blackout project

Filed under: Uncategorized — @ 3:22

I ran across this worklog today and spend best of the day going through it: TBCS Community Forums - TRIBALOVERKILL, “Blackout” Updated–> 06/24/05

It love the work Tribaloverkill has done there, and I have to say he raises my bar also higher than ever. Gosh. I need to find some arrangement on getting access to some decent workshop..

28.10.2005

Ending the silence

Filed under: Uncategorized — @ 3:19

As some of you might have noticed, I’ve been a bit quiet for a while. I recently visited Rome and it’s been a lot of busier in work than normally, so these home projects have been on a lower priority. But now I’m back and full of ideas!

8.10.2005

Another praise to ALE

Filed under: Uncategorized — @ 17:07

Here is another example of what ALE can do.

One of the source images:

After ALE:

After sharpening:

Of course since this is 1:1 size image taken with compact camera, the quality is not terrific in any of the pictures, but for web they are anyway always scaled smaller than 3MP.

One additional nice thing about ALE processing is that the resulting images can be had in 16BPP format, and thus there is a lot of more room to enhance the lighting without having color bands.

9.9.2005

Meta: Photos in this log

Filed under: Uncategorized — @ 3:10

Photos on this log are taken with HP Photosmart 735 compact digital camera. It’s slow, bulky and way too automatic but it has pretty good lense, for a compact one.

Most of the images have been taken inside, often without any sunlight and definitely without any real photographic lighting. To enhance the poor quality I usually take series of pictures with tripod from exactly the same spot - sometimes with different lighting - and then combine them with ALE.

Here you can see 1:1 piece of one of the images, first from a single shot and then from combined picture composed of five individual shots:


Powered by WordPress