gpustat is a Python command-line utility that queries and monitors NVIDIA GPU status, built for developers, researchers, and cluster operators who want a more readable view of GPU usage than raw nvidia-smi output.
What it is
gpustat is an MIT-licensed Python tool distributed on PyPI that reports the state of NVIDIA graphics devices from the terminal. It queries the hardware through NVML using NVIDIA's official nvidia-ml-py binding, then prints a compact, colorized per-GPU summary β utilization, memory, temperature, power, and the processes holding resources β in a single command. It ships both as a command-line program and as an importable library, so the same query surface can be embedded in other Python code.
The concrete problem it solves is the friction of day-to-day GPU inspection. nvidia-smi is authoritative but verbose, and getting per-process detail out of it means reading wide tables or wiring up format flags. gpustat presents the same underlying device data as a tighter, consistently formatted table, adds per-process owner, PID, and command columns directly, and exposes the result as JSON so it can be consumed by scripts rather than by eyes. It replaces nvidia-smi as the routine query command a user or operator runs when they need to know which GPUs are free and who is using them, while still sitting on top of the same driver-level source of truth.
Key capabilities
- Compact colorized GPU table as the default
gpustat output, with --color to force color when stdout is not a tty and --no-color to suppress it.
- Per-process attribution through
-u / --show-user, -c / --show-cmd, -f / --show-full-cmd, and -p / --show-pid, or --no-processes to hide process information entirely.
- Hardware detail flags:
-F / --show-fan for fan speed, -e / --show-codec for encoder and decoder utilization, and -P / --show-power for power draw and limit.
-a / --show-all to display every GPU property above at once, and --id 0,1,2 to target a specific subset of GPUs by index.
- Watch mode via
--watch, -i, and --interval, which polls and refreshes the display on a set interval.
--json for machine-readable output, plus a Python API where gpustat.new_query() returns a GPUStatCollection supporting .print_formatted() and .jsonify().
- Shell completion generation with
--print-completion (bash|zsh|tcsh), and --debug for diagnosing query failures.
Who uses it and how
- Shared multi-GPU workstations and lab servers, where the
--show-user and --show-pid flags let one person find out which colleague is holding memory on a device.
- Cluster and operations work, where watch mode (
gpustat --watch or gpustat -i) runs in a terminal pane for continuous polling instead of repeatedly invoking nvidia-smi.
- Automation and monitoring pipelines, where
gpustat --json feeds a dashboard or scheduler, or where the Python API is imported to log GPU state from inside a training job.
- Administrators who need a narrow view:
--id restricts the query to chosen devices, and --no-processes trims the output when process detail is not wanted.
- Teams that prefer a browser view, via gpustat-web, a web interface of gpustat that is available in alpha.
Getting started
Install from PyPI with pip install gpustat, or use pip install --user gpustat when root privileges are unavailable; the master branch can be installed with pip install git+https://github.com/wookayin/gpustat.git@master. The dependency is nvidia-ml-py, NVIDIA's official Python binding for NVML β not the pynvml package, which will not work.
How it compares
Among similar tools, gpustat positions itself explicitly as "just less than nvidia-smi": it does not replace nvidia-smi but condenses its output into a more legible form, and it depends on the same NVIDIA driver and NVML layer underneath. Its companion gpustat-web extends the same querying into a browser interface, currently in alpha, for users who want the data outside a terminal.
When to use it β and when not to
A self-hoster or user needs a working NVIDIA driver β version 450.00 or higher for gpustat 1.0+ β and the correct nvidia-ml-py binding, and Python 3.6 or newer; matching CUDA_DEVICE_ORDER=PCI_BUS_ID is required if CUDA and gpustat are to report the same GPU indices. It is not a fit for AMD hardware, since the README states it works with NVIDIA graphics devices only and there is no AMD support as of now. Anyone needing vendor-neutral GPU monitoring, or a web dashboard that is not alpha-quality, should look elsewhere or wait.
project readme (upstream, from github) β read inline
gpustat

Just less than nvidia-smi?

NOTE: This works with NVIDIA Graphics Devices only, no AMD support as of now. Contributions are welcome!
Self-Promotion: A web interface of gpustat is available (in alpha)! Check out gpustat-web.
Quick Installation
Install from PyPI:
pip install gpustat
If you don't have root (sudo) privilege, please try installing gpustat on user namespace: pip install --user gpustat.
To install the latest version (master branch) via pip:
pip install git+https://github.com/wookayin/gpustat.git@master
NVIDIA Driver and pynvml Requirements
[!IMPORTANT]
DO NOT: pip install pynvml, nor include pynvml as a dependency in your python project. This will not work.
Instead: pip install nvidia-ml-py. nvidia-ml-py is NVIDIA's the official python binding for NVML.
- gpustat 1.2+: Requires
nvidia-ml-py >= 12.535.108 (#161)
- gpustat 1.0+: Requires NVIDIA Driver 450.00 or higher and
nvidia-ml-py >= 11.450.129.
- If your NVIDIA driver is too old, you can use older
gpustat versions (`pip install gpustat=3.4
- gpustat 1.0: Python >= 3.4
- gpustat 1.1: Python >= 3.6
- gpustat 1.2+: Python >= 3.6 (tested through Python 3.16 development builds)
Usage
$ gpustat
Options (Please see gpustat --help for more details):
--color : Force colored output (even when stdout is not a tty)
--no-color : Suppress colored output
-u, --show-user : Display username of the process owner
-c, --show-cmd : Display the process name
-f, --show-full-cmd : Display full command and cpu stats of running process
-p, --show-pid : Display PID of the process
-F, --show-fan : Display GPU fan speed
-e, --show-codec : Display encoder and/or decoder utilization
-P, --show-power : Display GPU power usage and/or limit (draw or draw,limit)
-a, --show-all : Display all gpu properties above
--id : Target and query specific GPUs only with the specified indices (e.g. --id 0,1,2)
--no-processes : Do not display process information (user, memory) (#133)
--watch, -i, --interval : Run in watch mode (equivalent to watch gpustat) if given. Denotes interval between updates.
--json : JSON Output (#10)
--print-completion (bash|zsh|tcsh) : Print a shell completion script. See #131 for usage.
Tips
- Try
gpustat --debug if something goes wrong.
- To periodically watch, try
gpustat --watch or gpustat -i (#41).
- For older versions, one may use
watch --color -n1.0 gpustat --color.
- Running
nvidia-smi daemon (root privilege required) will make querying GPUs much faster and use less CPU (#54).
- The GPU ID (index) shown by
gpustat (and nvidia-smi) is PCI BUS ID,
while CUDA uses a different ordering (assigns the fastest GPU with the lowest ID) by default.
Therefore, in order to ensure CUDA and gpustat use same GPU index,
configure the CUDA_DEVICE_ORDER environment variable to PCI_BUS_ID
(before setting CUDA_VISIBLE_DEVICES for your CUDA program):
export CUDA_DEVICE_ORDER=PCI_BUS_ID.
Python API
gpustat can also be used as a library to query GPUs from your own code:
import gpustat
stats = gpustat.new_query() # a GPUStatCollection
stats.print_formatted() # same output as the `gpustat` command
data = stats.jsonify() # query result as a dict (same as `gpustat --json`)
Default display
[0] GeForce GTX Titan X | 77Β°C, 96 % | 11848 / 12287 MB | python/52046(11821M)
[0]: GPU index (starts from 0) as PCI_BUS_ID
GeForce GTX Titan X: GPU name
77Β°C: GPU Temperature (in Celsius)
96 %: GPU Utilization
11848 / 12287 MB: GPU Memory Usage (Used / Total)
python/...: Running processes on GPU, owner/cmdline/PID (and their GPU memory usage)
Changelog
See CHANGELOG.md
License
MIT License