What is RAPL?

By green_comp, 30 March, 2026

What is RAPL? 

RAPL (Running Average Power Limit) is an Intel processor feature (see Intel, 2022 and Intel, 2024) which allows real-time measurements of CPU and RAM as described by Malmodin and Lundén, 2018, and by Raffin and Trystram, 2024. This feature could be used to measure the energy consumed of running the code, but can also be used to measure the power consumption on different hardware. This method can be used as a benchmark to compare different power consumption of different hardware configurations by running the same code as a comparison. Through this, developers can cap power usage during run-time or find inefficiencies that can be improved. Intel for Intel, AMD and Apple have their own way of presenting this data with further details below. 

 

Intel  

Intel’s Performance Counter Monitor (PCM) includes RAPL support, this allows direct access to these metrics on Windows through running commands such as ‘pcm-power.exe’ to measure the CPU’s energy usage. Whereas the Linux version can utilise the MSR kernel module provided, a sample implementation of a Windows driver provides a similar interface (Intel, 2022).  

  

Inside your program  

To use PCM within your own programs, you can embed the following code into your applications. This will allow you to measure CPU utilisation, cashe hits/misses and power consumption via RAPL and more. Intel provides this C++ APU allowing you to analyse your code away from other applications.   

For measuring energy:  ‘getConsumedJoules(before_sstate, after_sstate)’ measures the energy consumed (via RAPL).  

  

PCM * m = PCM::getInstance();   
// program counters, and on a failure just exit   
if (m->program() != PCM::Success) return;   
SystemCounterState before_sstate = getSystemCounterState(); 

     [run your code here]   

SystemCounterState after_sstate = getSystemCounterState();   
  count << "Instructions per clock:" << getIPC(before_sstate,after_sstate)   
  << "L3 cache hit ratio:" << getL3CacheHitRatio(before_sstate,after_sstate)   
  << "Bytes read:" << getBytesReadFromMC(before_sstate,after_sstate)   
  << [and so on]...   
 

   

Download Intel PCM here : https://github.com/intel/pcm  

  

Intel VTune :  

Intel’s VTune Focuses on application performance, providing insight into software execution and how it utilizes hardware. With both command-line and GUI options, VTune allows you to select a directory in which to execute and analyze before specifying how and what to test for. Once ran, a section will show total power consumption during data collection. Switching to the Platform window to view power consumption over time (measured in millijoules).  

  

Download Intel VTune here: https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler-download.html  

AMD  

AMD has made a significant impact on the market share in the past couple of years since the introduction of their new Ryzen Processors on the AM4 platform in March 2017. Which is still being continued over their planned lifespan of the platform. Moreover, the new AM5 platform introduced in September 2022 has made even more impact on strengthening their position in “monopolised” CPU market share by Intel for years.  According to Tom’s Hardware (2024) where they did get access to mercury research, AMD has made a significant growth across all 3 of the platforms, Desktop, Mobile, and Server. It is growing to 20.6% market of total client market share from 17% in just a year, which is a lot considering how big this market is.   

That is why it is important to mention how to measure energy usage on AMD’s CPUs, and this can be done by using by exposing the energy counters reported via RAPL Model-specific Registers (MSRs).  

MSR RAPL allows user to access 3 main different ways to measure the energy used (nchatrad, 2021):  

  • Power, Energy, and Time Units MSR_RAPL_POWER_UNIT/ C001_0299: shared with all cores in the socket  

  • Energy consumed by each Core MSR_CORE_ENERGY_STATUS/ C001_029A: 32-bitRO, Accumulator, core-level power reporting  

  • Energy consumed by Socket MSR_PACKAGE_ENERGY_STATUS/ C001_029B: 32-bitRO, Accumulator, socket-level power reporting, shared with all cores in socket  

These drivers will allow users to measure the energy consumed by the whole socket or each of the cores on its own. Unlike in Intel’s approach, AMD processors do not measure the dram energy consumed. Only the CPU socket is considered in these measurements; therefore it is less accurate but will allow the users to estimate the energy consumption better than just using the base CPU power limit as a reference.  

Energy accumulation might occur especially when measuring the socket power as the nchatrad mentioned based on the 240W processor it would happen in around 9 minutes, but if only measuring per core it would take several days to wrap around time. Energy accumulation occurs because of 32-bit limitations. Most of the processors are using 32-bit RAPL MSR and only a few EPYC server grade processors are using 64-bit RAPL MSR eliminates the need to account the energy accumulation.  They approached this issue with starting a thread which is on sleep for 100 seconds and checks if the value has gone down. It keeps running in a loop until the driver is stopped and adds counts how many times it wrapped around.    
  

Instructions and more information about this can be found on this user's GitHub repository here[hyperlink]  

 

Apple 

Older models with  Intel chips. Older revisions of Mac’s and MacBooks, Apple used to equip them with Intel CPU’s, you would be able to check if your CPU model supports RAPL, by going to  -> About This Mac, if CPU model is not listed there click “More Info…”. This way you can search your CPU model and intel has a web page for each of their’s CPU’s so you should easily find the information there. 

Newer models with Apple’s own ARM chips. 

Newer Mac models are equipped with new ARM chips which are not equipped with intel RAPL, but has their own method. This allows users to view how much power each of the processors it is equipped with, CPU, GPU, and new ANE (Apple Neural Engine)). sudo powermetrics  --samplers cpu_power,gpu_power will allow user to see the measurements  of power use for these chiplets. To help you get the energy used from series of timestamp measurements refers to Here

 

  

References 

Intel (2022). Intel® Performance Counter Monitor - A Better Way to Measure CPU Utilization:  https://www.intel.com/content/www/us/en/developer/articles/tool/performance-counter-monitor.html (Accessed on: 25th August 2024)  

Intel (2024). User-guide (page 304):  https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-2/getting-started.html (Accessed on: 29th August 2024) 

Malmodin, J. and Lundén, D. (2018). The Energy and Carbon Footprint of the Global ICT and E&M Sectors 2010–2015. Sustainability, 10(9), p.3027. Available at: https://doi.org/10.3390/su10093027. (Accessed on 15th August 2024) 

nchatrad (2021). GitHub — amd/amd_energy. GitHub. Available at: https://github.com/amd/amd_energy (Accessed on: 23 Aug. 2024) 

Raffin, G., & Trystram, D. (2024). Dissecting the software-based measurement of CPU energy consumption: a comparative analysis. arXiv:2401.15985 

Shilov, A. and Tom's Hardware (2024). AMD takes CPU market share from Intel in desktops and servers, but Intel fights back in laptops. Tom’s Hardware. Available at: https://www.tomshardware.com/pc-components/cpus/amd-takes-cpu-market-share-from-intel-in-desktops-and-servers-but-intel-fights-back-in-laptops [Accessed on: 23 Aug. 2024]