CPU Energy Meter is a Linux software tool that enables you to monitor the power consumption of Intel CPUs at granular time intervals (a few tens of milliseconds). This software is designed to provide detailed energy consumption insights across different power domains within your system.
The software leverages the RAPL (Running Average Power Limit) feature found on Intel CPUs from the Sandy Bridge generation onwards. RAPL allows for precise power consumption measurements within specific time intervals.
Installing CPU Energy Meter on Debian or Ubuntu systems is straightforward:
sudo add-apt-repository ppa:sosy-lab/benchmarking sudo apt install cpu-energy-meter
.deb
package from our GitHub releases page and install it using the following command:
sudo apt install ./cpu-energy-meter*.deb
sudo apt install libcap-dev sudo modprobe msr make sudo ./cpu-energy-meter
CPU Energy Meter relies on the following dependencies:
libcap
(Fedora) or libcap2
(Debian/Ubuntu).For running CPU Energy Meter without root privileges, follow these steps:
msr
and cpuid
kernel modules.msr
./dev/cpu/*/msr
to the msr
group. (An example rule is available on the GitHub repository.)chgrp msr
, chmod 2711
, and setcap cap_sys_rawio=ep
on the binary. You can use make setup
as a shortcut for this.To use CPU Energy Meter, run the following command in your terminal:
cpu-energy-meter [-d] [-e sampling_delay_ms] [-r]
CPU Energy Meter will continuously monitor energy consumption and report measurements when you send a SIGINT signal (Ctrl+C). You can also send the USR1 signal to receive intermediate measurements.
Here's an example of the output you would see when running CPU Energy Meter:
+--------------------------------------+ | CPU-Energy-Meter Socket 0 | +--------------------------------------+ Duration 2.504502 sec Package 3.769287 Joule Core 0.317749 Joule Uncore 0.010132 Joule DRAM 0.727783 Joule PSYS 29.792603 Joule
CPU Energy Meter offers a range of features that make it a valuable tool for developers and system administrators:
CPU Energy Meter is a fork of the Intel Power Gadget software. It builds upon the original features and provides enhanced functionality, including:
CPU Energy Meter can be used in a variety of scenarios:
CPU Energy Meter is a powerful and versatile tool for monitoring the power consumption of Intel CPUs on Linux systems. It offers comprehensive measurement capabilities, ease of use, and a community-driven approach, making it an ideal choice for various applications in energy efficiency, benchmarking, and system optimization.
Ask anything...