All Projects → sosy-lab → Cpu Energy Meter

sosy-lab / Cpu Energy Meter

Licence: bsd-3-clause
A tool for measuring energy consumption of Intel CPUs

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Cpu Energy Meter

BuildingSystems
Modelica BuildingSystems library
Stars: ✭ 52 (+18.18%)
Mutual labels:  energy
Openremote
100% open-source IoT Platform - Integrate your assets, create rules, and visualize your data
Stars: ✭ 254 (+477.27%)
Mutual labels:  energy
Stromdao Businessobject
Abstract BusinessObject for StromDAO Energy Blockchain. Abstraction layer between blockchain technology and business logic providing energy market related entities and use cases.
Stars: ✭ 10 (-77.27%)
Mutual labels:  energy
WindTurbineClassification
My master's dissertation on wind turbine fault prediction using machine learning
Stars: ✭ 31 (-29.55%)
Mutual labels:  energy
Home Assistant EDP Box
Integração das EDP Box com Home Assistant Core
Stars: ✭ 91 (+106.82%)
Mutual labels:  energy
Energy Languages
The complete set of tools for energy consumption analysis of programming languages, using Computer Language Benchmark Game
Stars: ✭ 385 (+775%)
Mutual labels:  energy
energy-py-linear
Optimize battery storage using mixed integer linear programming
Stars: ✭ 33 (-25%)
Mutual labels:  energy
Node Opcua
an implementation of a OPC UA stack fully written in javascript and nodejs - http://node-opcua.github.io/
Stars: ✭ 985 (+2138.64%)
Mutual labels:  energy
home-assistant-glow
⚡ The power of energy measurements in your house
Stars: ✭ 383 (+770.45%)
Mutual labels:  energy
Openespi Datacustodian Java
Spring Framework implementation of a Green Button Data Custodian OpenESPI Application
Stars: ✭ 9 (-79.55%)
Mutual labels:  energy
premise
Coupling Integrated Assessment Models output with Life Cycle Assessment.
Stars: ✭ 29 (-34.09%)
Mutual labels:  energy
multiphysics
Interactive Multiphysics Simulation for Everyone
Stars: ✭ 41 (-6.82%)
Mutual labels:  energy
Nilmtk
Non-Intrusive Load Monitoring Toolkit (nilmtk)
Stars: ✭ 563 (+1179.55%)
Mutual labels:  energy
Raspberry-Pi-Electricity-Monitor
Software for monitoring the electricity consumption of a home with a Raspberry Pi
Stars: ✭ 33 (-25%)
Mutual labels:  energy
Decentralized Energy Fabric On Ibp20
Set up a network on the IBM Blockchain Platform and deploy a decentralized energy smart contract on the network.
Stars: ✭ 29 (-34.09%)
Mutual labels:  energy
powerapi-scala
PowerAPI is a middleware toolkit for building software-defined power meters
Stars: ✭ 70 (+59.09%)
Mutual labels:  energy
Awesome Raspberry Pi
curated list of projects with raspberry pi
Stars: ✭ 309 (+602.27%)
Mutual labels:  energy
Iobroker.sourceanalytix
Detailed analysis of your Energy, gas and liquid consumptions
Stars: ✭ 40 (-9.09%)
Mutual labels:  energy
Home Assistant octopusagile
Octopus Agile custom component for Home Assistant
Stars: ✭ 30 (-31.82%)
Mutual labels:  energy
Open Sustainable Technology
Listing of worldwide open technology projects preserving a stable climate, energy supply and vital natural resources. Enjoy the website: https://opensustain.tech/
Stars: ✭ 595 (+1252.27%)
Mutual labels:  energy

CPU Energy Meter

Build Status BSD-3-Clause License Releases DOI via Zenodo

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 and CPUID modules (available by default)

Alternatively, for running CPU Energy Meter from source (quick and dirty):

sudo apt install libcap-dev
sudo modprobe msr
sudo modprobe cpuid
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 and cpuid.
  • Add a group msr.
  • Add a Udev rule that grants access to /dev/cpu/*/msr to group msr (example).
  • Run chgrp msr, chmod 2711, and setcap 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].