Top 3 Linux GPU Monitoring Command Line Tools

Top 3 Linux GPU Monitoring Command Line Tools

There are some fancy but very useful tools for NVIDIA GPU. It is a ncurses-based GPU status viewer for NVIDIA GPUs similar to the htop command or top command. We can install it as follows using the pip/apt command on a Debian or an Ubuntu Linux. 
 
 

1. GPUStat

                          

A simple command-line utility for querying and monitoring GPU status.
 
NOTE: This works with NVIDIA Graphics Devices only. No AMD support as of now. 
 
# Install from PyPI
$ pip install gpustat

# To periodically watch
$ gpustat --watch

# If something goes wrong, try
$ gpustat --debug

# Monitor gpu
$ gpustat -cp
https://github.com/wookayin/gpustat 
 
# See help details
$ gpustat --help
usage: gpustat [-h] [--force-color | --no-color] [--id ID] [-a] [-c] [-f] [-u] [-p] [-F] [-e [{,enc,dec,enc,dec}]] [-P [{,draw,limit,draw,limit,limit,draw}]] [--json] [-i [INTERVAL]] [--no-header] [--gpuname-width GPUNAME_WIDTH]
               [--debug] [--no-processes] [-v]

options:
  -h, --help            show this help message and exit
  --force-color, --color
                        Force to output with colors
  --no-color            Suppress colored output
  --id ID               Target a specific GPU (index).
  -a, --show-all        Display all gpu properties above
  -c, --show-cmd        Display cmd name of running process
  -f, --show-full-cmd   Display full command and cpu stats of running process
  -u, --show-user       Display username of running process
  -p, --show-pid        Display PID of running process
  -F, --show-fan-speed, --show-fan
                        Display GPU fan speed
  -e [{,enc,dec,enc,dec}], --show-codec [{,enc,dec,enc,dec}]
                        Show encoder/decoder utilization
  -P [{,draw,limit,draw,limit,limit,draw}], --show-power [{,draw,limit,draw,limit,limit,draw}]
                        Show GPU power usage or draw (and/or limit)
  --json                Print all the information in JSON format
  -i [INTERVAL], --interval [INTERVAL], --watch [INTERVAL]
                        Use watch mode if given; seconds to wait between updates
  --no-header           Suppress header message
  --gpuname-width GPUNAME_WIDTH
                        The width at which GPU names will be displayed.
  --debug               Allow to print additional informations for debugging.
  --no-processes        Do not display running process information (memory, user, etc.)
  -v, --version         show program's version number and exit
 

2. NVTOP

https://github.com/Syllo/nvtop
Nvtop stands for Neat Video card TOP, a (h)top like task monitor for A MD, Intel, and NVIDIA GPUs. It can handle multiple GPUs and print information about them in a htop familiar way.
 
# install nvtop
$ sudo apt install nvtop
## RUN the tool ##
$ nvtop
 
For quick command line arguments help.
$ nvtop --help
nvtop version 1.0.0
Available options:
  -d --delay        : Select the refresh rate (1 == 0.1s)
  -v --version      : Print the version and exit
  -s --gpu-select   : Column separated list of GPU IDs to monitor
  -i --gpu-ignore   : Column separated list of GPU IDs to ignore
  -p --no-plot      : Disable bar plot
  -C --no-color     : No colors
  -N --no-cache     : Always query the system for user names and command line information
  -f --freedom-unit : Use fahrenheit
  -E --encode-hide  : Set encode/decode auto hide time in seconds (default 30s, negative = always on screen)
  -h --help         : Print help and exit

3. NVITOP

https://github.com/XuehaiPan/nvitop
Nvitop is an interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management. Nvitop can be easily integrated into other applications. You can use Nvitop to make your own monitoring tools. The full A PI references host at https://nvitop.readthedocs.io.
# Install nvitop
$ pip install --upgrade nvitop

# Run as a resource monitor
$ nvitop
 
Press h and the help screen will show.

Add Feedback