mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-21 14:55:38 -06:00
| .. | ||
| collector-background | ||
| collector-csv | ||
| collector-tensorboard | ||
| ml-framework-callbacks | ||
| monitor-colored | ||
| monitor-minimal | ||
| monitor-web | ||
| select-devices-api | ||
| take-snapshots | ||
| README.md | ||
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.