Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

nvitop

> 云原生
Open source

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

7.1K stars0 likes7 views
WebsiteGitHub

About

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

nvitop

An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management. The full API references host at https://nvitop.readthedocs.io.


Monitor mode of nvitop.
(TERM: GNOME Terminal / OS: Ubuntu 16.04 LTS (over SSH) / Locale: en_US.UTF-8)


A Grafana dashboard built on top of nvitop-exporter.

Table of Contents

  • Features
  • Requirements
  • Installation
  • Usage
    • Device and Process Status
    • Resource Monitor
      • For Docker Users
      • For SSH Users
      • Command Line Options and Environment Variables
      • Keybindings for Monitor Mode
    • CUDA Visible Devices Selection Tool
    • More than a Monitor
      • Quick Start
      • Status Snapshot
      • Resource Metric Collector
      • Low-level APIs
        • Device
        • Process
        • Host (inherited from psutil)
  • Screenshots
  • Changelog
  • License
    • Copyright Notice

nvitop is an interactive NVIDIA device and process monitoring tool. It has a colorful and informative interface that continuously updates the status of the devices and processes. As a resource monitor, it includes many features and options, such as tree-view, environment variable viewing, process filtering, process metrics monitoring, etc. Beyond that, the package also ships a CUDA device selection tool nvisel for deep learning researchers. It also provides handy APIs that allow developers to write their own monitoring tools. Please refer to section More than a Monitor and the full API references at https://nvitop.readthedocs.io for more information.


Process filtering and a more colorful interface.


Compare to nvidia-smi.


Features

  • Informative and fancy output: show more information than nvidia-smi with colorized fancy box drawing.
  • Monitor mode: can run as a resource monitor, rather than print the results only once.
    • bar charts and history graphs
    • process sorting
    • process filtering
    • send signals to processes with a keystroke
    • tree-view screen for GPU processes and their parent processes
    • environment variable screen
    • help screen
    • mouse support
  • Interactive: responsive for user input (from keyboard and/or mouse) in monitor mode. (vs. gpustat & py3nvml)
  • Efficient:
    • query device status using NVML Python bindings directly, instead of parsing the output of nvidia-smi. (vs. nvidia-htop)
    • support sparse query and cache results with TTLCache from cachetools. (vs. gpustat)
    • display information using the curses library rather than print with ANSI escape codes. (vs. py3nvml)
    • asynchronously gather information using multi-threading and correspond to user input much faster. (vs. nvtop)
  • Portable: work on both Linux and Windows.
    • get host process information using the cross-platform library psutil instead of calling ps -p <pid> in a subprocess. (vs. nvidia-htop & py3nvml)
    • written in pure Python, easy to install with pip. (vs. nvtop)
  • Integrable: easy to integrate into other applications, more than monitoring. (vs. nvidia-htop & nvtop)


nvitop supports Windows!
(SHELL: PowerShell / TERM: Windows Terminal / OS: Windows 10 / Locale: en-US)


Requirements

  • Python 3.8+
  • NVIDIA Management Library (NVML)
  • nvidia-ml-py
  • psutil
  • curses* (with libncursesw)

NOTE: The NVIDIA Management Library (NVML) is a C-based programmatic interface for monitoring and managing various states. The runtime version of the NVML library ships with the NVIDIA display driver (available at Download Drivers | NVIDIA), or can be downloaded as part of the NVIDIA CUDA Toolkit (available at CUDA Toolkit | NVIDIA Developer). The lists of OS platforms and NVIDIA-GPUs supported by the NVML library can be found in the NVML API Reference.

This repository contains a Bash script to install/upgrade the NVIDIA drivers for Ubuntu Linux. For example:

bash
git clone --depth=1 https://github.com/XuehaiPan/nvitop.git && cd nvitop

# Change to tty3 console (required for desktop users with GUI (tty2))
# Optional for SSH users
sudo chvt 3  # or use keyboard shortcut: Ctrl-LeftAlt-F3

bash install-nvidia-driver.sh --package=nvidia-driver-595  # install the R595 driver from ppa:graphics-drivers
bash install-nvidia-driver.sh --latest                     # install the latest driver from ppa:graphics-drivers
bash install-nvidia-driver.sh --latest --open              # install the latest open-kernel-module driver


NVIDIA driver installer for Ubuntu Linux.

Run bash install-nvidia-driver.sh --help for more information.

* The curses library is a built-in module of Python on Unix-like systems, and it is supported by a third-party package called windows-curses on Windows using PDCurses. Inconsistent behavior of nvitop may occur on different terminal emulators on Windows, such as missing mouse support.


Installation

It is highly recommended to install nvitop in an isolated virtual environment. Simple installation and run via uvx (a.k.a. uv tool run) or pipx:

bash
uvx nvitop
# or
pipx run nvitop

You can also set this command as an alias in your shell startup file, e.g.:

bash
# For Bash
echo 'alias nvitop="uvx nvitop"' >> ~/.bashrc

# For Zsh
echo 'alias nvitop="uvx nvitop"' >> ~/.zshrc

# For Fish
mkdir -p ~/.config/fish
echo 'alias nvitop="uvx nvitop"' >> ~/.config/fish/config.fish

# For PowerShell
New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
'Function nvitop { uvx nvitop @Args }' >> $PROFILE.CurrentUserAllHosts

or

bash
# For Bash
echo 'alias nvitop="pipx run nvitop"' >> ~/.bashrc

# For Zsh
echo 'alias nvitop="pipx run nvitop"' >> ~/.zshrc

# For Fish
mkdir -p ~/.config/fish
echo 'alias nvitop="pipx run nvitop"' >> ~/.config/fish/config.fish

# For PowerShell
New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
'Function nvitop { pipx run nvitop @Args }' >> $PROFILE.CurrentUserAllHosts

Install from PyPI ():

bash
pip3 install --upgrade nvitop

Install from conda-forge ():

bash
conda install -c conda-forge nvitop

Install the latest version from GitHub ():

bash
pip3 install --upgrade pip setuptools
pip3 install git+https://github.com/XuehaiPan/nvitop.git

Or, clone this repo and install manually:

bash
git clone --depth=1 https://github.com/XuehaiPan/nvitop.git && cd nvitop
pip3 install .

NOTE: If you encounter the "nvitop: command not found" error after installation, please check whether you have added the Python console script path (e.g., "${HOME}/.local/bin") to your PATH environment variable. Alternatively, you can use python3 -m nvitop.


MIG Device Support.


Usage

Device and Process Status

Query the device and process status. The output is similar to nvidia-smi, but has been enriched and colorized.

bash
# Query the status of all devices
$ nvitop -1  # or use `python3 -m nvitop -1`

# Specify query devices (by integer indices)
$ nvitop -1 -o 0 1  # only show <GPU 0> and <GPU 1>

# Only show devices in `CUDA_VISIBLE_DEVICES` (by integer indices or UUID strings)
$ nvitop -1 -ov

# Only show GPU processes with the compute context (type: 'C' or 'C+G')
$ nvitop -1 -c

When the -1 switch is on, the result will be displayed ONLY ONCE (same as the default behavior of nvidia-smi). This is much faster and has lower resource usage. See Command Line Options for more command options.

There is also a CLI tool called nvisel that ships with the nvitop PyPI package. See CUDA Visible Devices Selection Tool for more information.

Resource Monitor

Run as a resource monitor:

…

You can configure the default monitor mode with the NVITOP_MONITOR_MODE environment variable (default auto if not set). See Command Line Options and Environment Variables for more command options.

In monitor mode, you can use Ctrl-c / T / K keys to interrupt / terminate / kill a process. And it's recommended to terminate or kill a process in the tree-view screen (shortcut: t). For normal users, nvitop will shallow other users' processes (in low-intensity colors). For system administrators, you can use sudo nvitop to terminate other users' processes.

To run nvitop as a viewer only and disable all process-mutating shortcuts, pass --readonly (or set NVITOP_MONITOR_MODE="readonly"). The signal keys above become no-ops, the on-screen "Press ^C(INT)/T(TERM)/K(KILL) to send signals" hint is hidden, and the corresponding rows in the help screen are dimmed. Use this when sharing a session over SSH, demoing on a multi-tenant box, or wrapping nvitop in a non-admin alias.

Also, to enter the process metrics screen, select a process and then press the Enter / Return key . nvitop dynamically displays the process metrics with live graphs.


Watch metrics for a specific process (shortcut: Enter / Return).

Press h for help or q to return to the terminal. See Keybindings for Monitor Mode for more shortcuts.


nvitop comes with a help screen (shortcut: h).

For Docker Users

Build and run the Docker image with nvidia-container-toolkit:

bash
docker run -it --rm --runtime=nvidia --gpus=all --pid=host ghcr.io/xuehaipan/nvitop:latest

NOTE: Don't forget to add the --pid=host option when running the container.

If you only need to set up the Grafana dashboard, you can start a dashboard at http://localhost:3000 with the following command:

bash
docker compose --project-directory=nvitop-exporter/grafana up --build --detach

See [nvitop-exporter](./nvitop-exporter/R

Issues· 19 open

View all issuesOpen on GitHub
  • #211

    [RFC] AMD GPU Support

    upstreamapidependenciesUpdated May 14, 2026
  • #74

    [Feature Request] Add support to AMD's ROCm GPU

    enhancementupstreamapiUpdated Mar 12, 2026
  • #185

    [Feature Request] Provide Helm Chart / Kubernetes Manifests for nvitop-exporter

    enhancementUpdated Sep 19, 2025
  • #170

    [Feature Request] Hide CPU Section in Terminal

    enhancementUpdated Jun 26, 2025
  • #169

    [Feature Request] 是否考虑出支持K8S的版本?

    enhancementUpdated Jun 22, 2025
  • #160

    [Feature Request] Hide CPU usage

    enhancementUpdated May 10, 2025
  • #126

    [Feature Request] Add CPU Processes

    enhancementUpdated May 8, 2025
  • #136

    [BUG] Windows Server Unexpectedly Shuts Down When Using Nvitop to Monitor GPU Usage

    bugUpdated Mar 29, 2025
  • #144

    [BUG] Missing Windows Build on Conda Forge

    upstreamdependenciesUpdated Jan 6, 2025
  • #81

    [Feature Request] Make `AppImage` format or binary file

    enhancementUpdated Aug 18, 2023

> Tags

Pythoncommand-line-toolconsolecudacurses

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 22, 2026
Category云原生
PricingOpen source

> Related tools

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,