XuehaiPan/nvitop

An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management.

What it solves

nvitop solves the problem of not having a good way to see what your NVIDIA GPUs are doing. nvidia-smi gives you a static snapshot, but nvitop gives you an interactive, live view that updates continuously. It combines device info and process info in one place, shows colored bar charts and history graphs, lets you filter and sort processes, and even lets you send signals (like terminate or kill) to a process directly from the interface. It works on Linux and Windows, over SSH and in Docker, and also ships a tool (nvisel) to pick which GPUs to expose via CUDA_VISIBLE_DEVICES.

How it works

nvitop is written in pure Python. Instead of parsing nvidia-smi output, it talks to the NVIDIA Management Library (NVML) through Python bindings for fast, accurate queries. It caches query results so it does not repeatedly ask for the same information. For its monitor mode display, it uses Python's curses library for a full-screen, keyboard- and mouse-driven terminal interface, and it gathers information asynchronously using multiple threads so it stays responsive while you type.

It has several ways to run:

  • One-shot mode (-1): prints a single, colorized snapshot similar to nvidia-smi but richer.
  • Monitor mode (-m): keeps running with full, compact, or auto display modes, showing bar charts, history graphs, process sorting and filtering, a tree view of GPU processes, an environment variable screen, and a help screen.
  • Process metrics screen: select a process and press Enter to see live graphs of that process's resource usage.

In monitor mode, you can send INT/TERM/KILL signals to processes with keystrokes (Ctrl-c, T, K). There is also a --readonly mode that disables all process-mutating actions, useful for sharing a session over SSH or demoing on a multi-tenant box.

Beyond the CLI, nvitop provides Python APIs (Device, Process, Host) so developers can build their own monitoring tools. The package also includes nvisel, a CLI to interactively set CUDA_VISIBLE_DEVICES, plus a Bash script to install or upgrade NVIDIA drivers on Ubuntu. There is also an nvitop-exporter that feeds GPU metrics into Grafana for a dashboard.

Who it's for

  • Deep learning researchers and engineers who want a live, richer replacement for nvidia-smi to watch GPU utilization, memory, and their training processes.
  • System administrators who need to monitor and manage GPU processes on shared machines; with sudo they can terminate other users' processes.
  • Developers who want Python APIs to integrate GPU monitoring into their own tools.
  • Docker and SSH users who need a monitoring tool that works in containers or over remote sessions.

Highlights

  • Colorful, informative full-screen interface with bar charts, history graphs, and a tree view of GPU processes and their parent processes.
  • Interactive: keyboard and mouse support, process sorting and filtering, and the ability to send TERM/KILL signals to processes from the UI.
  • Efficient: queries NVML directly (not parsing nvidia-smi), caches results, and uses curses and multi-threading for speed.
  • Portable: pure Python, works on both Linux and Windows, and gets host process info via psutil.
  • Integrable: exports Python APIs (Device, Process, Host) and ships with nvisel (CUDA device selection tool), a Grafana dashboard exporter, and an Ubuntu driver installer script.

Related

  • Project
  • Project
  • Project
  • Project
  • Project