nvitop/examples
2026-05-21 14:59:52 +08:00
..
collector-background chore: update license header 2026-05-16 15:37:30 +08:00
collector-csv chore: update license header 2026-05-16 15:37:30 +08:00
collector-tensorboard chore: update license header 2026-05-16 15:37:30 +08:00
ml-framework-callbacks chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
monitor-colored chore: update license header 2026-05-16 15:37:30 +08:00
monitor-minimal chore: update license header 2026-05-16 15:37:30 +08:00
monitor-web feat(examples/monitor-web): unify plot legends 2026-05-21 14:59:52 +08:00
select-devices-api chore: update license header 2026-05-16 15:37:30 +08:00
take-snapshots chore: update license header 2026-05-16 15:37:30 +08:00
README.md feat(examples/monitor-web): add minimal stdlib HTTP(S) GPU dashboard 2026-05-20 13:56:50 +08:00

nvitop Examples

Runnable reference scripts that exercise the public nvitop API. Each subfolder is fully self-contained: one runnable .py file, a README.md, and (if extra dependencies are required) a requirements.txt.

Index

Folder What it shows Extra deps
monitor-minimal/ Minimal plain-text GPU monitor using Device.all().
monitor-colored/ Colored monitor with per-process snapshots.
monitor-web/ Minimal stdlib HTTP(S) dashboard backed by collect_in_background with a rotating buffer.
take-snapshots/ Every form of take_snapshots — NVML, CUDA, single-device, processes off.
collector-tensorboard/ Log ResourceMetricCollector output to TensorBoard around a tiny PyTorch loop. torch, tensorboard
collector-csv/ Append ResourceMetricCollector samples to a CSV file via pandas. pandas
collector-background/ Run the collector on a daemon thread via collect_in_background.
select-devices-api/ Programmatic CUDA device selection (nvitop.select_devices), the API behind nvisel.
ml-framework-callbacks/ ML-framework callbacks (Keras, Lightning) and a TensorBoard helper built on nvitop. varies per file

Running an Example

# Folders without a requirements file only need `nvitop` itself
python3 examples/<folder>/<script>.py

# Folders with a requirements file
pip install -r examples/<folder>/requirements.txt
python3 examples/<folder>/<script>.py

The ml-framework-callbacks/ folder ships per-framework requirements-<framework>.txt files so you can pull in only the framework you actually use.