RAPL
What?
RAPL vs. usage of power meters
Intel vs. AMD Implementation
Intel only supports CPU-socket-level measurement. AMD instead does offer per-physical-core energy counters. Source: @Qiao.etal.2024.EnergyawareProcessScheduling#^j0eaxc
RAPL survival guide
According to my review of the literature, RAPL is accurate, starting from itβs second generation (post-Broadwell), but it is not covering a complete perimeter. As you have seen in the schema, βPackageβ, or βPkgβ, only includes the CPU (Core), the Ram (DRAM) and integrated GPU (Uncore) power. Comparing Pkg to an IPMI/DCMI-based or a SmartPDU-based evaluation will be likely disappointing if you look at energy consumed on a decent time-period. They are supposed to be closer as you look for times where the CPU is most active, and more different as the machine is close to idle.
Last but not least, while using RAPL metrics could feel empowering as you have a pretty precise view on your machineβs components energy consumption, there is a catch. It should be said that this consumption profile will likely to be very specific to your hardware and configuration. The runtime context of a given software or service is also essential if you want to assess its energy consumption. Depending on its runtime, whether itβs running natively, in a virtual machine (hypervisor configuration will also be important then), or in a container and depending on the other services running on the physical host and their behavior, the evaluation may be more or less impacted. Moreover, from one machine to another, even if the hardware is the same, you may have a closer look to (at least): hyper threading, turbo boost, energy efficiency mode, β¦
Check if available
Kernel version β₯ 5.3:
sudo modprobe intel_rapl_msr
Kernels version < 5.3:
sudo modprobe intel_rapl
Or use perf.
π References
Software Development Lifecycle for Energy Efficiency (Georgiou, Rizou, Spinellis 2020)
RAPL in Action (Khan, Hirki, Niemi, Nurminen, Ou 2018)
Rotem, E., Naveh, A., Ananthakrishnan, A., Weissmann, E., & Rajwan, D. (2012). Power-Management Architecture of the Intel Microarchitecture Code-Named Sandy Bridge. IEEE Micro, 32(2), 20β27. https://doi.org/10.1109/MM.2012.12
Hackenberg, D., Schone, R., Ilsche, T., Molka, D., Schuchart, J., & Geyer, R. (2015). An Energy Efficiency Feature Survey of the Intel Haswell Processor. 2015 IEEE International Parallel and Distributed Processing Symposium Workshop, 896β904. https://doi.org/10.1109/IPDPSW.2015.70
RAPL, SGX and energy filtering - Influences on power consumption | green-coding.berlin by Arne Tarara