2011-06-21 02:16:11

by pradeep hettiarachchi

[permalink] [raw]
Subject: CPU Instantaneous Power Consumption

Hi,

I am a PhD student and doing a research which involves
control-theoretic real-time process/job scheduling. Here is my
question:

I need to calculate the power consumption of a single or two CPU cores
and equivalent Thermal Dissipation accurately. I did not find any
supporting material from Intel to find the instantaneous power
consumption (and thermal dissipation) of the CPU. Therefore I am
trying some alternative path; I measure the CPU regulator input
current (using a very small shunt resister in series with 4 pin CPU
ATX connector). Also, assuming that the CPU voltage regulator operates
at 12 V rated, I could calculate the input power to the CPU regulator.

However without knowing the following I cannot complete my power calculation:

1) What is the DC-to-DC CPU regulator efficiency ?
2) What is the relationship between TDP and input power to the CPU ?
3) Do you suggest any other better method to calculate the
instantaneous input power to the CPU ?
(I can think of calculating accurate instantaneous CPU power as VID
(corresponding Vcc) x CPU_current_from_regulator; but, how do I read
instantaneous VID ? Is there any MSR that I can instantly access to
read VID ? (I think Intel has hidden theses details from system
developer) )

Please help me to find answers to these questions.


Sincerely,

Pradeep M. Hettiarachchi


2011-06-24 06:59:34

by Ben Nizette

[permalink] [raw]
Subject: Re: CPU Instantaneous Power Consumption


On 21/06/2011, at 12:15 PM, pradeep hettiarachchi wrote:
>
> 1) What is the DC-to-DC CPU regulator efficiency ?

Varies board to board. North of 90% but if you want decent figures you're going to have to characterise this yourself I'd think

> 2) What is the relationship between TDP and input power to the CPU ?

Well all power that goes in and doesn't come out is dissipated! Unless you can monitor all power that goes out you're not going to get good figures. Given that most of the lines from the CPU are driving fairly high impedance buffers you can probably make some assumptions here, once again it depends how accurately you need this info

> 3) Do you suggest any other better method to calculate the
> instantaneous input power to the CPU ?

I think it'll be easier to just measure the TDP directly by embedding a good temp sensor in the heat sink and characterising the thermal inertia of the thing. To do that characterisation you might use, for instance, a heater element with known power dissipation attached to some kind of controller that applies a known power waveform.

> (I can think of calculating accurate instantaneous CPU power as VID
> (corresponding Vcc) x CPU_current_from_regulator; but, how do I read
> instantaneous VID ?

If you can read CPU current from the reg, why can't you directly measure CPU voltage from the reg?

HTH.
--Ben.

> Is there any MSR that I can instantly access to
> read VID ? (I think Intel has hidden theses details from system
> developer) )
>
> Please help me to find answers to these questions.
>
>
> Sincerely,
>
> Pradeep M. Hettiarachchi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2011-06-26 21:43:55

by Arjan van de Ven

[permalink] [raw]
Subject: Re: CPU Instantaneous Power Consumption

On Mon, 20 Jun 2011 22:15:47 -0400
pradeep hettiarachchi <[email protected]> wrote:

> Hi,
>
> I am a PhD student and doing a research which involves
> control-theoretic real-time process/job scheduling. Here is my
> question:
>
> I need to calculate the power consumption of a single or two CPU cores
> and equivalent Thermal Dissipation accurately. I did not find any
> supporting material from Intel to find the instantaneous power
> consumption (and thermal dissipation) of the CPU. Therefore I am
> trying some alternative path; I measure the CPU regulator input
> current (using a very small shunt resister in series with 4 pin CPU
> ATX connector). Also, assuming that the CPU voltage regulator operates
> at 12 V rated, I could calculate the input power to the CPU regulator.
>
> However without knowing the following I cannot complete my power
> calculation:
>
> 1) What is the DC-to-DC CPU regulator efficiency ?

tends to be pretty high, but it's also very dependent on the load; it's
not a constant, but it's a curve depending on the output load

> 2) What is the relationship between TDP and input power to the CPU ?

there isn't one.
TDP is the power the CPU will use under a "power virus" like workload,
eg this is the number that a system vendor is expected to be able to
cool.

What you actually use on a real life workload is less than that... how
much less "depends"

> 3) Do you suggest any other better method to calculate the
> instantaneous input power to the CPU ?

define "instantaneous"....
if you care about "100 milliseconds" resolution, sure you can do that.
if you want to do nanosecond kind of resolution (couple of hundred
instructions) it gets much more tricky, since the CPU will act as a
very big capacitor as well (as do other parts of the system); all will
smooth out current and voltage changes... limiting your visibility
resolution (think of it acting as a low pass filter)

> (I can think of calculating accurate instantaneous CPU power as VID
> (corresponding Vcc) x CPU_current_from_regulator; but, how do I read
> instantaneous VID ? Is there any MSR that I can instantly access to

the VID is not the instantaneous voltage. It's a minimum voltage a CPU
requests from the VR's.... what you actually get is much more variable
and depends also on current spikes/drops.
To calculate power you need to multiple the actual instantaneous
voltage by the instantaneous current..... and then all you get is the
power going into the capacitor .. not the "power dissipated" number.



--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2011-06-27 02:33:30

by Kyle Moffett

[permalink] [raw]
Subject: Re: CPU Instantaneous Power Consumption

On Sun, Jun 26, 2011 at 17:47, Arjan van de Ven <[email protected]> wrote:
> On Mon, 20 Jun 2011 22:15:47 -0400
> pradeep hettiarachchi <[email protected]> wrote:
>
>> Hi,
>>
>> I am a PhD student and doing a research which involves
>> control-theoretic real-time process/job scheduling. Here is my
>> question:
>>
>> I need to calculate the power consumption of a single or two CPU cores
>> and equivalent Thermal Dissipation accurately. I did not find any
>> supporting material from Intel to find the instantaneous power
>> consumption (and thermal dissipation) of the CPU. Therefore I am
>> trying some alternative path; I measure the CPU regulator input
>> current (using a very small shunt resister in series with 4 pin CPU
>> ATX connector). Also, assuming that the CPU voltage regulator operates
>> at 12 V rated, I could calculate the input power to the CPU regulator.
>>
>> However without knowing the following I cannot complete my power
>> calculation:
>>
> there isn't one.
> TDP is the power the CPU will use under a "power virus" like workload,
> eg this is the number that a system vendor is expected to be able to
> cool.
>
> What you actually use on a real life workload is less than that... how
> much less "depends"

The Thermal Design Power is very specifically not a chip-specific
parameter but a whole-system or whole-component design metric,
including the CPU and GPU as well as any chipset controllers, add-in
cards, etc.

For example, in a modern Intel laptop, the CPU may well have minimum
and maximum TDP numbers, but the processor boots up in low-power
mode and relies on the BIOS to program various secret model-specific
registers and other tunables to tell the CPU exactly how much power it
can use and how hot it can get, based on the "whole system" TDP.
Those power numbers *also* account for how hot the ethernet chipset
and SATA controller might get under maximum load.

Thermal Design Power also allows for short-term thermal overload;
something like Intel's "TurboBoost" where you can run the CPU very
cool at idle for 20 minutes (IE: writing code in "vim") and then turn the
frequency/power up above the steady-state max for 15-30 seconds of
high CPU usage (IE: compiling code), and then put it back into a lower
frequency state before it gets too hot.

It's even more complex when you consider shared cooling between
the CPU and GPU; if your GPU is at steady-state max frequency and
power then your CPU must be limited to ~60%, or vice versa.

Cheers,
Kyle Moffett