Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What CPU instructions use the most power?

The background is thus: next week our office will have one day with no heating, due to maintenance. Outdoor temperature is expected between 7 and 12 degrees Celcius, so it might become chilly. The portable electric heaters are too few to cater for everyone.

However, I have, in my office of about 6-8 m2, a big honkin' (3 yrs old) workstation (HP xw8600 with 3.0 GHz Quad-core Xeon) that should be able output a couple of hundred Watts of heat. Running Furmark will max out the GPU but I'm not sure how to best work the CPU.

Last time I was in a cold office I either compiled more often or just launched 4-8 DOSBox:es running Norton Commander, but I think one can do better by using SSE1-2-3-4,MMX etc, i.e. stuff that does more work per cycle.

So, what CPU instructions toggle the most transistors each cycle, and thus use cause the CPU to draw most amount of power and thus give off maximum heat?

If I had a power meter available, then I could benchmark myself, but I figure this would be a fun challenge for the SO-crowd. :)

like image 557
Macke Avatar asked Oct 03 '12 19:10

Macke


People also ask

How many instructions can a CPU run?

CPUs can only carry out one instruction at a time. It might seem like CPUs can perform many instructions simultaneously, since it is possible for you to do homework, read instant messages and listen to music at the same time.

Does high CPU usage use more electricity?

There is a catch though, and the faster CPU often wants a higher voltage to be able to change it states faster. That means it may draw the same current, but power used is increased.

Is 100% CPU usage normal?

CPUs are designed to run safely at 100% CPU utilization. However, you'll want to avoid these situations whenever they cause perceptible slowness in games.


2 Answers

For your specific goal, if you really want to use your system as a heat generator, you need to first make sure that the cooling system is working really well (throwing the heat out of the box). Processors today are designed to throttle themselves when they reach a critical temperature which happens when a proper heatsink is used and the processor is at TDP (Thermal Design Power is the max power for the processor using normal programs). If you have a better heat sink and good ventilation (box fan?), you can probably get beyond TDP assuming that your power supply can handle it. If you turn the fan off, you basically will hit the thermal limit right away.

To be more explicit, the individual instructions that burn the most are generally load instructions that miss in the caches and go out to memory. To guarantee misses, you'll want to allocate a chunk of memory that's bigger than the last level CPU cache and hop around that memory. The pattern of hopping in the maximum power case is a bit complex because you're trying to get the maximum number of misses outstanding at every level of the cache hierarchy simultaneously. If you have 3 levels of cache, in a given period of time, you can have more misses to the L1 than you can to the L2 than you can to the L3 than you can to the DRAM page. (And the specific design of your processor will have a total limit on misses.) Between misses, the instruction doesn't matter too much, but I'd guess that one of the SSE4 multiplies (PMULUDQ) is probably the best since on a lot of modern processors, they execute in pretty quickly and generally do a whole lot of work (compared to say an add).

The funny thing is, running the GPU may limit the amount of heat that you can generate using misses to the L3 cache since the memory may be bogged down by the GPU. In that case, you should make sure that all accesses to the L3 are hits, but that you're missing in the other levels.

like image 137
Nathan Binkert Avatar answered Sep 19 '22 01:09

Nathan Binkert


For GeForce graphics, my CudaMFLOPS program (free) is quite handy for obtaining high temperatures on the graphics card. If you have an appropriate card details are in:

http://www.roylongbottom.org.uk/cuda1.htm#anchor8

I find that my tests that execute SSE instructions with data from L1 cache generally produce the highest CPU temperatures.

like image 32
Roy Longbottom Avatar answered Sep 21 '22 01:09

Roy Longbottom