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 Monitoring
================================================================================
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
Metric | P50 | P95
-----------------------------------------
GPU Power | 11.70W | 13.20W
CPU Power | 1.00W | 1.50W
GPU Utilization | 32% | 45%
GPU VRAM | 8.20GB | 8.50GB
CPU Utilization | 15% | 22%
RAM Usage | 16.30GB | 16.70GB
GPU Temperature | 45°C | 48°C
Battery: 85.0% → 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
Metadata
Release files for laperf-power 0.1.3
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 | |
|---|---|---|---|---|
| laperf_power-0.1.3.tar.gz | 13.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| laperf_power-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.9 kB
Release files / laperf_power-0.1.3.tar.gz
| Download URL | laperf_power-0.1.3.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af21cb6c176c448901adae2639310cd9f45c9f0791c5124fc1919371a29d9f88
|
|
BLAKE2b-256 checksum How to use checksums |
2416e3c98e146fb634a6a4d993598eecb56f5e262b553ae2ced665b6c18287d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2025.
Transparency logRelease files / laperf_power-0.1.3-py3-none-any.whl
| Download URL | laperf_power-0.1.3-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6f4d622622d08b678333af9ab888d7fbc43b49e9e2839a89d967f55f6e54237
|
|
BLAKE2b-256 checksum How to use checksums |
3bb95173d1c042278d839564f4dbb07b1a4b62f9556d2f5a66e8434ea9af4e91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2025.
Transparency logSecurity for laperf-power 0.1.3
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for laperf_power-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2025.
Transparency logA 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.