- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use RAPL for capping the power consumption but couldn't find any sample codes to do that. Codes from google/this forum are just using RAPL for measuring power/energy. Could anyone give me an example/demo code how to use RAPL for capping the power consumption of CPU?
Thanks,
Kevin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Power capping on intel processors is all about writing correct values into a Model Specific Resistor (MSR).
A very nice article on how to read and write MSRs can be found at http://www.mindfruit.co.uk/2012/11/a-linux-kernel-module-for.html
Next, the MSR addresses and the associated explanation can be found in section 14.9 (Chapter 14) of Software Developer Manual (vol 3b part 2) of Haswell. It also has the explanation for how to convert Watt value to bits and also the time interval in bits.
The other easy way is to install the intel_rapl kernel module available at https://github.com/torvalds/linux/blob/master/drivers/powercap/intel_rapl.c. With this you can set power cap in watts for different domains.
Hope this helps.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page