Lightweight real-time power and resource monitoring tool for AI workloads
Project description
LaPerf Power
Lightweight real-time power and resource monitoring tool for AI/ML workloads.
Features
- Real-time monitoring with live console output
- Cross-platform support: macOS (Apple Silicon + Intel), Linux (NVIDIA), Windows
- Comprehensive metrics: GPU/CPU power, utilization, VRAM, temperature, RAM, battery
- Statistical analysis: P50/P95 percentiles for all metrics
- JSON export for further analysis
- Zero heavy dependencies: Only requires
psutil(~5 MB installed)
Installation
Quick run without installation (recommended)
uvx laperf-power
Install as a global tool
# Using uv
uv tool install laperf-power
# Using pip
pip install laperf-power
Usage
# Start monitoring with default settings (10s interval)
laperf-power
# Custom sampling interval (faster sampling = more overhead)
laperf-power --interval 1.0
# Without sudo (basic metrics only on macOS)
laperf-power --no-sudo
# Save results to JSON
laperf-power --output power_metrics.json
Press Ctrl+C to stop and view statistics.
What It Monitors
GPU Metrics
- Power consumption (Watts) - NVIDIA via
nvidia-smi, macOS viapowermetrics - Utilization (%) - GPU compute usage
- VRAM (GB) - Memory used/total
- Temperature (°C) - Die temperature
CPU Metrics
- Power consumption (Watts) - macOS only with sudo
- Utilization (%) - Average across all cores
System Metrics
- RAM usage (GB) - Process memory consumption
- Battery drain (%) - Change during monitoring period
Platform Support
| Platform | GPU Power | GPU Stats | CPU Power | Notes |
|---|---|---|---|---|
| macOS (Apple Silicon) | ✅ (with sudo) | ✅ | ✅ (with sudo) | Via powermetrics and ioreg |
| macOS (Intel) | ❌ | ❌ | ✅ (with sudo) | Via powermetrics |
| Linux (NVIDIA) | ✅ | ✅ | ❌ | Via nvidia-smi |
| Linux (AMD/Intel) | ❌ | ❌ | ❌ | CPU/RAM only |
| Windows | ❌ | ❌ | ❌ | CPU/RAM only |
Example Output
⚡ REAL-TIME POWER MONITORING
================================================================================
Started: 2025-11-27 14:30:00
Interval: 10.0s
================================================================================
Press Ctrl+C to stop and view statistics
[Sample #42] GPU: 11.7W 32% 8.2GB | CPU: 15% 1.0W | RAM: 16.3GB | Temp: 45°C
Final statistics:
📊 MONITORING SUMMARY
================================================================================
Duration: 420.0s
Samples collected: 42
🎮 GPU Power:
P50: 11.7W
P95: 13.2W
💻 CPU Power:
P50: 1.0W
P95: 1.5W
🎯 GPU Utilization:
P50: 32%
P95: 45%
💾 GPU VRAM:
P50: 8.2GB
P95: 8.5GB
🔧 CPU Utilization:
P50: 15%
P95: 22%
🧠 RAM Usage:
P50: 16.3GB
P95: 16.7GB
🔋 Battery:
Start: 85.0% → End: 83.5%
Drain: 1.5%
macOS sudo Setup (Optional)
For detailed GPU/CPU power metrics on macOS, laperf-power uses sudo powermetrics.
Option 1: Enter password when prompted (recommended for occasional use)
Option 2: Passwordless sudo (for frequent use)
Add to /etc/sudoers (use sudo visudo):
your_username ALL=(ALL) NOPASSWD: /usr/bin/powermetrics
Use Cases
- AI/ML Development: Monitor power usage during model training/inference
- Hardware Evaluation: Compare power efficiency across different GPUs
- Performance Optimization: Identify power/performance bottlenecks
- Battery Life Testing: Track power consumption on laptops
- System Monitoring: Real-time resource usage dashboard
Part of LaPerf
laperf-power is extracted from LaPerf - a comprehensive AI hardware benchmark suite. For full benchmarking capabilities (embeddings, LLMs, VLMs), check out the main project.
License
Apache-2.0
Contributing
Issues and PRs welcome at https://github.com/bogdanminko/laperf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laperf_power-0.1.2.tar.gz.
File metadata
- Download URL: laperf_power-0.1.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7b7356afe5349b6be6585e314300f8ebad14c72f43b707b7faa0d601c22491d
|
|
| MD5 |
9fa73b54733defa0f772503a77e54bd1
|
|
| BLAKE2b-256 |
fde369f229bf28049f4c017ee895584bf21de44d6668b2f32c843ea0130a9376
|
Provenance
The following attestation bundles were made for laperf_power-0.1.2.tar.gz:
Publisher:
publish-laperf-power.yml on bogdanminko/laperf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laperf_power-0.1.2.tar.gz -
Subject digest:
b7b7356afe5349b6be6585e314300f8ebad14c72f43b707b7faa0d601c22491d - Sigstore transparency entry: 729679657
- Sigstore integration time:
-
Permalink:
bogdanminko/laperf@83fd8f6bcd9d3ed7847a9a8c54fe6caa45f282d0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/bogdanminko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-laperf-power.yml@83fd8f6bcd9d3ed7847a9a8c54fe6caa45f282d0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file laperf_power-0.1.2-py3-none-any.whl.
File metadata
- Download URL: laperf_power-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c138b515d27bf5d5d595c9398a76a195d09ebec0a8066781b5db9abd17071815
|
|
| MD5 |
d7a0bf5dbe4a1837d07adade1aa74802
|
|
| BLAKE2b-256 |
eb4d615756528f23b4c3ab39aea52d2131976cc23ddfca56710c20098675888e
|
Provenance
The following attestation bundles were made for laperf_power-0.1.2-py3-none-any.whl:
Publisher:
publish-laperf-power.yml on bogdanminko/laperf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laperf_power-0.1.2-py3-none-any.whl -
Subject digest:
c138b515d27bf5d5d595c9398a76a195d09ebec0a8066781b5db9abd17071815 - Sigstore transparency entry: 729679659
- Sigstore integration time:
-
Permalink:
bogdanminko/laperf@83fd8f6bcd9d3ed7847a9a8c54fe6caa45f282d0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/bogdanminko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-laperf-power.yml@83fd8f6bcd9d3ed7847a9a8c54fe6caa45f282d0 -
Trigger Event:
release
-
Statement type: