Skip to content

Provides a CPU/GPU software power meter using measurements from Intel and AMDs RAPL interfaces, and Nvidia's NVML interface

Notifications You must be signed in to change notification settings

apt-sim/power_meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This library provides a software power meter for Intel and AMD CPUs, and Nvidia GPUs. On CPU it reads from Intel and AMD's RAPL interfaces, while on GPU it uses Nvidia's NVML interface.

The simplest way to obtain measurements is by using the built-in monitoring loop. It runs on a separate thread taking measurements at the specified sampling interval, the measurements are stored at "power_meter_out/[cpu/gpu]" or optionally on user-specified files.

It's important to note that the measured application needs to run with root privileges in order to be able to read the CPU's MSR registers.

In order to start the monitoring, run:

power_meter::launch_monitoring_loop([Sampling interval in ms]);

To stop it:

power_meter::stop_monitoring_loop();

Build

The library has no dependencies on other packages, to configure, run:

cmake -S. -B./build -DCMAKE_INSTALL_PREFIX=[install_directory]

To build and install:

cd build/ && make install

Integration in other projects

In order to include the library on other Cmake projects, add the following line to CMakeLists.txt:

find_package(Power_meter REQUIRED)

This will make the library Power_meter::Power_meter available

About

Provides a CPU/GPU software power meter using measurements from Intel and AMDs RAPL interfaces, and Nvidia's NVML interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published