CPU Energy Meter
A Linux tool that allows to monitor power consumption of Intel CPUs at fine time intervals.
https://github.com/sosy-lab/cpu-energy-meter
Category: Consumption
Sub Category: Computation and Communication
Keywords
energy linux rapl resource-measurement
Keywords from Contributors
benchmark-framework benchmarking cgroups competition software-verification sv-comp verification verification-task witness
Last synced: about 22 hours ago
JSON representation
Repository metadata
A tool for measuring energy consumption of Intel CPUs
- Host: GitHub
- URL: https://github.com/sosy-lab/cpu-energy-meter
- Owner: sosy-lab
- License: bsd-3-clause
- Created: 2015-11-19T13:28:07.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-02T07:08:26.000Z (over 1 year ago)
- Last Synced: 2025-04-20T09:04:27.704Z (7 days ago)
- Topics: energy, linux, rapl, resource-measurement
- Language: C
- Homepage:
- Size: 249 KB
- Stars: 334
- Watchers: 13
- Forks: 30
- Open Issues: 2
- Releases: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
CPU Energy Meter
CPU Energy Meter is a Linux tool that allows to monitor power consumption of Intel CPUs
at fine time granularities (few tens of milliseconds).
Power monitoring is available for the following power domains:
- per package domain (CPU socket)
- per core domain (all the CPU cores on a package)
- per uncore domain (uncore components, e.g., integrated graphics on client CPUs)
- per memory node (memory local to a package, server CPUs only)
- per platform (all devices in the platform that receive power from integrated
power delivery mechanism, e.g., processor cores, SOC, memory, add-on or
peripheral devices)
To do this, the tool uses a feature of Intel CPUs that is called RAPL (Running Average Power Limit),
which is documented in the Intel Software Developers Manual, Volume 3B Chapter 14.9.
RAPL is available on CPUs from the generation Sandy Bridge and later.
Because CPU Energy Meter uses the maximal possible measurement interval
(depending on the hardware this is between a few minutes and an hour),
it causes negligible overhead.
CPU Energy Meter is a fork of the Intel Power Gadget
and developed at the Software Systems Lab
of the Ludwig-Maximilians-Universität München (LMU Munich)
under the BSD-3-Clause License.
Installation
For Debian or Ubuntu the easiest way is to install from our PPA:
sudo add-apt-repository ppa:sosy-lab/benchmarking
sudo apt install cpu-energy-meter
Alternatively, you can download our .deb
package from GitHub
and install it with apt install ./cpu-energy-meter*.deb
.
Dependencies of CPU Energy Meter are libcap,
which is available on most Linux distributions in package libcap
(e.g., Fedora)
or libcap2
(e.g, Debian and Ubuntu: sudo apt install libcap2
),
and a Linux kernel with the MSR module (available by default)
Alternatively, for running CPU Energy Meter from source (quick and dirty):
sudo apt install libcap-dev
sudo modprobe msr
make
sudo ./cpu-energy-meter
It is also possible (and recommended) to run CPU Energy Meter without root.
To do so, the following needs to be done:
- Load kernel modules
msr
andcpuid
. - Add a group
msr
. - Add a Udev rule that grants access to
/dev/cpu/*/msr
to groupmsr
(example). - Run
chgrp msr
,chmod 2711
, andsetcap cap_sys_rawio=ep
on the binary (make setup
is a shortcut for this).
The provided Debian package in our PPA
and on GitHub does these steps automatically
and lets all users execute CPU Energy Meter.
How to use it
cpu-energy-meter [-d] [-e sampling_delay_ms] [-r]
The tool will continue counting the cumulative energy use of all supported CPUs
in the background and will report a key-value list of its measurements when it
receives SIGINT (Ctrl+C):
+--------------------------------------+
| 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
To get intermediate measurements, send signal USR1
to the process.
Optionally, the tool can be executed with parameter -r
to print the output as a raw (easily parsable) list:
cpu_count=1
duration_seconds=3.241504
cpu0_package_joules=4.971924
cpu0_core_joules=0.461182
cpu0_uncore_joules=0.053406
cpu0_dram_joules=0.953979
cpu0_psys_joules=38.904785
The parameter -d
adds debug output.
By default, CPU Energy Meter computes the necessary measurement interval automatically,
this can be overridden with the parameter -e
.
Owner metadata
- Name: SoSy-Lab
- Login: sosy-lab
- Email:
- Kind: organization
- Description:
- Website: https://www.sosy-lab.org
- Location: LMU Munich, Germany
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/16129993?v=4
- Repositories: 20
- Last ynced at: 2023-08-05T12:10:30.706Z
- Profile URL: https://github.com/sosy-lab
GitHub Events
Total
- Issues event: 2
- Watch event: 11
- Issue comment event: 14
- Fork event: 1
Last Year
- Issues event: 2
- Watch event: 11
- Issue comment event: 14
- Fork event: 1
Committers metadata
Last synced: 6 days ago
Total Commits: 211
Total Committers: 5
Avg Commits per committer: 42.2
Development Distribution Score (DDS): 0.559
Commits in past year: 4
Committers in past year: 1
Avg Commits per committer in past year: 4.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Thomas Bunk | T****9@g****m | 93 |
Philipp Wendler | u****i@p****e | 87 |
Nils Steinger | g****t@n****e | 19 |
Thomas Lemberger | l****e@f****e | 11 |
leostrakosch | s****i@g****m | 1 |
Committer domains:
- fim.uni-passau.de: 1
- n-st.de: 1
- philippwendler.de: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 32
Total pull requests: 2
Average time to close issues: 5 months
Average time to close pull requests: 4 months
Total issue authors: 12
Total pull request authors: 2
Average comments per issue: 3.41
Average comments per pull request: 4.5
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0
Past year issues: 2
Past year pull requests: 0
Past year average time to close issues: 8 days
Past year average time to close pull requests: N/A
Past year issue authors: 2
Past year pull request authors: 0
Past year average comments per issue: 8.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- PhilippWendler (21)
- dx2919717227 (1)
- edisonchan (1)
- slmatrix (1)
- nricciardi (1)
- Threemages (1)
- avacoder42 (1)
- TrevorVillwock (1)
- antondalgren (1)
- ManuCasillas (1)
- elfring (1)
- khaleghzadeh (1)
Top Pull Request Authors
- rkmax (1)
- TBunk (1)
Top Issue Labels
- question (4)
- bug (2)
- enhancement (2)
- wontfix (1)
Top Pull Request Labels
Dependencies
- ubuntu bionic build
Score: 7.426549072397305