Intel® Power Governor


Active support for this tool is currently discontinued. The source code is provided below for the brave souls who would like to hack away at it. 


Martin Dimitrov, Carl Strickland, Seung-Woo Kim, Karthik Kumar, Kshitij Doshi

Introduction : 

Intel® Power Governor (power_gov) is a software utility and library, which allows developers to (a) monitor power and (b) regulate power at very fine time granularities (few tens of milliseconds). Power monitoring/control is available for the package, core, graphics, uncore and DRAM domains, as illustrated in Figure 1 below. The tool is self-contained, easy to use, and available on Intel® Xeon® E5 series processors based on Intel® microarchitecture code-named Sandy Bridge EP/EN/E, 2nd Generation Intel® Core™ and newer processors. As a library, power_gov allows developers to incorporate power monitoring/control into their own custom and dynamic solutions tailored to the needs of their application. 


Figure 1. Power domains for which power monitoring/control is available. To get uncore (last level caches and memory controller) power, subtract the core and graphics from package. Note: graphics power monitoring/control is only available on client parts, while the DRAM power monitoring/control is only available on server parts.
Usages :

Software power meter: power_gov can be used to report power consumption on the different power planes. The example in Figure 2 shows power_gov executing on a two socket Intel® Xeon® Processor E5-based machine, and reporting the average power consumption of the package, core, uncore and DRAM for each socket at 1 second intervals.


Figure 2. power_gov reporting power consumption at 1-second intervals for package, core, uncore, DRAM domains on a two-socket system.

Optimize for power/performance target: power_gov can be used to enforce power limits on the different power domains. In the example from Figure 3, we executed an OLTP workload, while at the same time we varied the power limit enforced on the package power domain (from 130W down to 30W on the x-axis). At the same time, on the y-axis we observed how the performance of the workload (in terms of average response time of transactions) varied with the enforced power limit. Assuming that our response time target was 0.015ms, we could limit the power consumption of the CPU socket to 50W while still satisfying the performance requirement. 
perf target
Figure 3. Using power_gov to optimize for a power/performance target.
Dynamic power/performance optimization: Using the power_gov library allows developers to create dynamic power monitoring/control solutions, which respond to changes in workload demand, time of day, etc. The example in Figure 4 depicts a scenario in which the customer software monitors energy consumption, in addition to its own quality of service (QoS) metrics and responds to changes in workload demand by dynamically adjusting the power limits, see ref[1]. The control algorithms used to dynamically adjust the power limits depend on the usage scenario and can be arbitrarily complex.
dynamic optimization
Figure 4. Using the power_gov library in order to design dynamic power/performance optimization solutions.


[1] V. Anagnostopoulou, M. Dimitrov, K. Doshi, “SLA-Guided Energy Savings for Enterprise Servers”, ISPASS 2012 poster, full version to appear in ITJ 2012
[2] Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3B: System Programming Guide, Part 2
For more complete information about compiler optimizations, see our Optimization Notice.
File power_gov.rev72.tgz40.17 KB


Martin Dimitrov (Intel)'s picture

Hi Filippo,

The Power Governor code has not yet been updated to support Haswell yet. However, it could be made to work with Haswell using a simplee change (litereally 1 line of code where the machine model is added to the list of recognized models). The source code for power governor is actually included in the linux version of the power gadjet :

Martin Dimitrov (Intel)'s picture


I believe that RAPL_LOCK cannot be unset without a reboot. If your RAPL_LOCK is perfmanently set (even after a reboot) and you have no option to unset it in BIOS - I would recommend trying on a different computer if possible. There registers are not architectural and they are not always exposed/suppored by vendors .


Filippo Sironi's picture

I'd like to run the power governor on top of my workstation with a recent Intel Xeon E3-1270 v3 (Haswell).
However, the power governor exits with the following error:
RAPL not supported, or machine model 306c3 not recognized.
Init failed!
I'm able to read energy consumption information directly from MSRs or through the performance counter monitor (provided by Intel).
Does the power governor support Haswell yet?

PS: is it possible to get the source code of the power governor and RAPL library?

Rajiv N.'s picture

From the first comment, you see that I could not disable the RAPL_LOCK in the BIOS version A19 on my Latitude E6420 with a Sandy Bridge processor.
I have two questions:
a) Would it be possible to disable the LOCK using the MSR registers.
sudo rdmsr -X --bitfield 63:63 0x00000610
The output of the 63rd bit MSR_PKG_POWER_LIMIT (0x00000610) is currently: `1`, which I assume means that the RAPL_LOCK is enabled.
UPDATE: When I try to disable the lock by writing into the msr register by unsetting the bit 63 using the following command:
./wrmsr -p 0 0x00000610 0x81c200dc8168
I see no change in the value of the msr register. I believe it is not a read-only register since I'm able to "write" the value to the register without any error.
b) If we cannot set the RAPL LOCK what is the other solution? How do we disable the RAPL_LOCK?

Martin Dimitrov (Intel)'s picture

Hi Ben,

Please take a look at the linux version of power gadget.
It basically contains the power governor source code with some very slight changes.


Benjamin K.'s picture


is there any way to take a look into the source code of the power governor?

I would appreciate if that was possible.

Best regards!

June L.'s picture


I'm trying to use power governor but I can't get the result to the text file using redirection.
./power_gov -e 1000 > result.txt

Could you tell me why?
And Could you modify something for that or share the source code?

Rajiv N.'s picture

I don't find RAPL_LOCK in the BIOS. Is there any other way around it?

Lee B.'s picture

I have read document that msr support power limit of DRAM domain in Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3B.
Can this program support power limit of DRAM domain?

Martin Dimitrov (Intel)'s picture

There is Power Gadget:
However, I don't think that the current version of Power Gadget allows you set power caps - but it can monitor power.


Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.