Skip to main content

gpu-scope

A modern, Textual-based TUI for watching GPU engagement on a node — in the spirit of nvtop, built on Rich/Textual, and covering NVIDIA, AMD, and Apple Silicon.

status

Features

  • Live per-GPU panels: utilization, memory, temperature, power, fan, clocks, encoder/decoder engagement, and a rolling utilization sparkline.
  • Per-GPU process table (PID, name, device memory) — NVIDIA only for now.
  • Adjustable refresh rate (+ / - at runtime).
  • Backend-pluggable, three vendors today:
    • NVIDIA — via NVML (nvidia-ml-py). Full field coverage, including per-process memory.
    • AMD — via the rocm-smi CLI (ROCm must be installed). Utilization, memory, temperature, power, fan, clocks; no per-process view yet. Parses rocm-smi's JSON defensively (case-insensitive key matching) to tolerate key-name drift across ROCm versions, but hasn't been run against real ROCm hardware — if a field looks off, please open an issue with your rocm-smi -a --json output.
    • Apple Silicon — via ioreg's IOAccelerator registry (no sudo required, macOS only). Utilization and a GPU-attributed memory figure (against total unified memory, there's no separate VRAM pool). Apple doesn't expose temperature/power/fan/clocks/per-process GPU stats without powermetrics, which requires root — those fields show as .
  • A demo backend with synthetic data, so you can preview the UI on a machine with no GPU at all.

Adding a vendor means writing one GpuBackend subclass that returns HostSnapshot/GpuSnapshot objects — the app and widgets are backend-agnostic.

Install

pip install gpu-scope

The project is gpu-scope end to end — gpu-top was blocked by PyPI's typosquat-similarity check against an unrelated existing package (gputop). The gpu-top name lives on as a second command, installed alongside gpu-scope and pointing at the exact same program, for anyone used to typing it.

One install gets every backend — there's nothing to opt into. NVIDIA support (nvidia-ml-py) ships as a core dependency: it's a small, pure-Python ctypes wrapper with no platform-specific build, so it installs cleanly everywhere and simply reports "unavailable" at runtime on a machine with no NVIDIA driver. AMD and Apple need no extra pip packages at all — they shell out to system tools (rocm-smi, ioreg) instead. The one thing pip can't do for you: AMD support only activates if ROCm's rocm-smi is on your PATH (a system package, install it via your distro/ROCm docs).

pip install gpu-scope[nvidia] is still accepted (as a no-op) if you're used to typing an extra — it doesn't install anything beyond the plain command above.

Installing from source instead: pip install "git+https://github.com/matplo/gpu-scope.git".

Usage

gpu-scope                  # auto-detects the first available backend (gpu-top works identically)
gpu-scope --backend demo   # synthetic data, no GPU required
gpu-scope --list-backends  # show what's available on this host
gpu-scope --interval 0.5   # poll twice a second

Running with no GPU present, or forcing --backend nvidia/--backend amd on a host without that vendor's tooling, exits with a short explanation and a --backend demo suggestion instead of a driver-library stack trace.

Keys: q quit · + / - refresh rate · d toggle light/dark theme.

Architecture

gpu_scope/
├── models.py          # GpuSnapshot / GpuProcess / HostSnapshot dataclasses
├── backends/
│   ├── base.py         # GpuBackend ABC — open() / poll() / close()
│   ├── nvidia.py        # NVML-backed implementation
│   ├── amd.py             # rocm-smi (CLI + JSON) implementation
│   ├── apple.py            # ioreg IOAccelerator implementation
│   └── demo.py               # synthetic backend for development/preview
├── widgets/
│   ├── meters.py         # Rich-renderable bars/sparklines (no extra deps)
│   └── gpu_panel.py       # the per-GPU card widget
├── app.py               # Textual App: layout + polling loop
└── cli.py                # argparse entry point (`gpu-scope` / `gpu-top`)

Development

pip install -e ".[dev]"
pytest
gpu-scope --backend demo   # preview the UI with synthetic data, no GPU required

For live Textual devtools (a separate log console while the TUI runs), see the Textual docs — in short, run textual console in one terminal and textual run --dev "gpu_scope.cli:main" in another.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpu_scope-0.2.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpu_scope-0.2.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file gpu_scope-0.2.0.tar.gz.

File metadata

  • Download URL: gpu_scope-0.2.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpu_scope-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a9675a9561d1e2913428c615c974d4b51737d94185e17ee9385193ec8449ad81
MD5 aa1e7dabb30d987a7b495f934ed9bc88
BLAKE2b-256 053c8847ea65409aaea1119a4a3420da18fcfcb718c5393f84210ad95721f4fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpu_scope-0.2.0.tar.gz:

Publisher: publish.yml on matplo/gpu-scope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gpu_scope-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gpu_scope-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpu_scope-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e206a1762e26ec76830f986993f081ffd45581bdbc37a5a482a84be298b6eb9
MD5 82e63da796d05b401221cc61cebab78e
BLAKE2b-256 208b8fb97019f0c31e95ba6fdc7b39a1d86ff1cddee66c7bb82b69bf35ae1896

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpu_scope-0.2.0-py3-none-any.whl:

Publisher: publish.yml on matplo/gpu-scope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page