Open SourceApache-2.0 License

gpu-monitor

CLI watcher that flags idle GPUs from local nvidia-smi data and estimates wasted spend — free local checks, optional Badgr email alerts.

How it works

gpu-monitor runs on the GPU machine itself — rented pods, cloud GPU instances, or a local workstation — sampling nvidia-smi on an interval to detect idle and stale-memory GPUs.

1

Sample nvidia-smi

Reads utilization, memory, and power draw per GPU on every check interval (default 60s, via check or watch).

2

Track idle duration

A GPU is idle when utilization and memory both stay below threshold; idle duration accrues per GPU index until it clears --idle-minutes.

3

Alert and estimate waste

Prints a waste estimate locally, and — with --email and --badgr-key — sends a cooldown-protected email alert through Badgr.

1

Install

Terminal
npm install -g gpu-monitor

Requires Node.js 18+ and NVIDIA drivers with nvidia-smi available.

2

Usage

Run a one-time check or a continuous watcher with your GPU's hourly rate. Email alerts require a Badgr API key.

Terminal
npx gpu-monitor watch --hourly-rate 2.50 --idle-minutes 30 --email you@example.com --badgr-key $BADGR_API_KEY

Example output

Terminal output
GPU cost watcher

Checked at: 2026-06-09T06:00:00.000Z
GPUs checked: 2
Idle GPUs: 1
Alert-ready GPUs: 1
Hourly rate: $2.50/hr
Idle threshold: 30 min (utilization <= 10%, memory <= 10%)
Estimated waste: $1.25
Next check: 2026-06-09T06:01:00.000Z

⚠ GPU 0 NVIDIA A100-SXM4-40GB: idle
  utilization: 0%
  memory: 512/40960 MB (1.3%)
  idle duration: 30.0m
  power draw: 45 W
  estimated waste: $1.25 after 30 min idle

✓ GPU 1 NVIDIA L40S: active
  utilization: 85%
  memory: 16000/46080 MB (34.7%)
  idle duration: 0s
  power draw: 240 W

Commands

gpu-monitor check --hourly-rate 2.50Run one nvidia-smi sample and print the current GPU state.
gpu-monitor watch --hourly-rate 2.50Continuously check on an interval; a GPU becomes alert-ready after --idle-minutes idle.
gpu-monitor processesShow which PIDs are holding VRAM on each GPU.
gpu-monitor processes --jsonSame as processes, with machine-readable JSON output.

What's included

Flags idle GPUs from local nvidia-smi utilization and memory data
Stale-memory detection (high VRAM, low utilization — a process forgot to free memory)
Per-GPU PID listing via the processes command
Waste estimate: hourly rate × idle minutes / 60
Continuous watch mode with configurable interval and idle thresholds
Optional cooldown-protected email alerts via Badgr
JSON output for all commands
Works on rented pods, cloud GPU instances, or local workstations
View on GitHub →

Ready to try gpu-monitor?

npm install -g gpu-monitor — no account needed to get started.