Powerlog
A command-line tool that measures the CPU and GPU energy consumed by an unmodified program.
Install
pip install powerlog
Python 3.8 or newer, no Python dependencies.
Supported platforms
Power sources are detected at runtime. Install only what matches your hardware;
anything unavailable is reported as n/a rather than failing the run.
| Domain | Read through | Needs | Gives |
|---|---|---|---|
| NVIDIA GPU | NVML | nvidia-smi on PATH |
Per-device power, one column each |
| AMD GPU | ROCm SMI | rocm-smi or amd-smi on PATH |
Per-device power |
| AMD GPU | amdgpu hwmon sysfs |
Readable /sys/class/drm/card*/device/hwmon |
Per-device power, no ROCm needed |
| Intel GPU | Level Zero | xpu-smi on PATH |
Per-device power |
| CPU | RAPL powercap | Readable /sys/class/powercap |
Package energy plus a power trace |
| CPU | RAPL via perf |
perf, kernel.perf_event_paranoid <= 0 |
Package energy, total only |
$ powerlog --list-backends
Detected power sources:
GPU:
nvidia NVIDIA GPU (nvidia-smi / NVML)
CPU:
rapl-sysfs CPU package (RAPL powercap sysfs)
The first source listed for each domain is the one that will be used.
CPU measurement is Linux only. Powerlog measures the node it runs on; it does not aggregate across nodes.
Use
powerlog ./my_program --arg value
================================================================
POWERLOG ENERGY SUMMARY
================================================================
Command ./my_program --arg value
Total time (s) 12.4180 (wall clock)
CPU AMD EPYC 7532 32-Core Processor
GPU NVIDIA A100-PCIE-40GB
----------------------------------------------------------------
Domain Energy (J) Share (%) Avg Power (W)
----------------------------------------------------------------
CPU 962.4013 31.05 77.5005
GPU 2136.7742 68.95 172.0707
----------------------------------------------------------------
TOTAL 3099.1755
EDP (J*s) 38485.5614
avg power = energy / total time, EDP = energy x total time
----------------------------------------------------------------
GPU power (W) min 61.20 / max 249.80
CPU power (W) min 74.90 / max 79.30
----------------------------------------------------------------
Samples 124
CPU source CPU package (RAPL powercap sysfs), 2 package domain(s)
GPU source NVIDIA GPU (nvidia-smi / NVML), 1 device(s)
================================================================
Powerlog runs unmodified binaries and samples CPU and GPU power in lockstep, so the measurement covers the whole application — I/O, transfers, kernel launches, synchronization — not just the kernels. It writes a summary CSV and a power trace, and exits with the program's own status.
Documentation
This repository additionally carries two things the wheel does not: example GPU
programs in apps/, and
datalog-engine-comparison/, a study comparing
the energy behaviour of five GPU-accelerated Datalog engines.
Contributing
Bug reports and patches are welcome on the
issue tracker. Open an issue first
for anything substantial, then send a pull request against main. Release
history is in Changelog.md.
License
MIT. See LICENSE.
Citation
@inproceedings{shovon2026heterogeneous,
title={Heterogeneous Energy Characterization of GPU-Powered Datalog Engines},
author={Shovon, Ahmedur Rahman and Sun, Yihao and Lan, Zhiling and Perarnau, Swann and Gilray, Thomas and Micinski, Kristopher and Papka, Michael E and Kumar, Sidharth},
booktitle={2026 IEEE/ACM Workshop on Energy Efficiency with Sustainable Performance: Techniques, Tools, and Best Practices (EESP)},
year={2026},
organization={IEEE}
}
Metadata
Release files for powerlog 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| powerlog-0.1.2.tar.gz | 42.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| powerlog-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.4 kB
Release files / powerlog-0.1.2.tar.gz
| Download URL | powerlog-0.1.2.tar.gz |
|---|---|
| Size | 42.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4ffbf2429b689a2fff66a3e05bc32371ca749afb3039f4344ab9b3736a09a8f
|
|
BLAKE2b-256 checksum How to use checksums |
9b615b1af21ce7e4255ad3c56bc75bf485f0c2bdf425623f996afd3a4717f667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / powerlog-0.1.2-py3-none-any.whl
| Download URL | powerlog-0.1.2-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
185d06dcdef7506f819c8a9ef15c38f67f3d3b459421a39fba1a7e1198985e91
|
|
BLAKE2b-256 checksum How to use checksums |
30996b19f2ed34cbf503322c05c6ef8a73ad3e756476e567835d9bc12087b38f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for powerlog 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.