• Stars
    star
    3,994
  • Rank 10,901 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📊 A simple command-line utility for querying and monitoring GPU status

gpustat

pypi license

Just less than nvidia-smi?

Screenshot: gpustat -cp

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 Requirements

gpustat uses NVIDIA's official python bindings for NVML library (pynvml). As of now gpustat requires nvidia-ml-py >= 11.450.129, which is compatible with NVIDIA driver versions R450.00 or higher. Please upgrade the NVIDIA driver if gpustat fails to display process information. If your NVIDIA driver is too old, you can use older gpustat versions (pip install gpustat<1.0). See #107 for more details.

Python requirements

  • gpustat<1.0: Compatible with python 2.7 and >=3.4
  • gpustat 1.0: Python >= 3.4
  • gpustat 1.1: Python >= 3.6

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.

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

More Repositories

1

tensorflow-talk-debugging

💬 Slides and supplementary codes for my talk 'Debugging Tips on TensorFlow' (2016)
Python
613
star
2

gpustat-web

👓 A web interface of gpustat: monitor GPU clusters at a look
Python
312
star
3

dotfiles

🏠 Personal dotfiles for *NIX systems
Lua
312
star
4

tensorflow-plot

📈 TensorFlow + Matplotlib as TF ops
Python
298
star
5

python-imgcat

🖼 imgcat in Python (for iTerm2)
Python
243
star
6

pintos

🌀 OS Coursework Project (PintOS)
C
200
star
7

TensorFlowKR-2017-talk-bestpractice

💬 Slides and Tutorial Codes for the talk 'Toward Best Practices of TensorFlow Code Patterns' (2017)
CSS
155
star
8

expt

Experiment. Plot. Tabulate.
Python
67
star
9

fzf-fasd

🌸 fzf + fasd integration
Shell
56
star
10

arxivify.sh

Generates a zip archive that is uploadable to arXiv.
Shell
45
star
11

alfred-latex-symbols-workflow

🔎 Alfred 3-4 workflow to search for latex symbol commands
Ruby
45
star
12

alfred-papers3-workflow

🔎 An Alfred 2/3 workflow to search Papers3 items
Python
43
star
13

tensorboard-tools

📉 A collection of TensorBoard-related utilities (In Progress)
Python
37
star
14

vim-typora

🗒 Vim ❤️ Typora
Vim Script
35
star
15

alfred-arxiv-workflow

🔎 Alfred workflow to search arxiv.org items
JavaScript
25
star
16

vim-autoimport

A vim plugin for adding import statements (for python and more) without LSP
Python
25
star
17

alfred-open-color-workflow

🔎 An Alfred 2/3 workflow to quickly lookup and insert open color codes
Python
22
star
18

fzf-ripgrep.vim

Vim + Fzf + Rg = Super Fast Jumper
Vim Script
19
star
19

anybar-zsh

🐚 zsh function and completion for anybar
Shell
18
star
20

latex-boilerplate

📝 A personal collection of templates for Markdown+LaTeX-based writing.
TeX
16
star
21

is_mosh

Detect whether the current shell is running under mosh
Shell
13
star
22

TensorflowKR-2016-talk-debugging

A talk on TensorFlow debugging -- REPOSITORY MOVED TO:
HTML
8
star
23

vim-python-enhanced-syntax

🐉 An experimental vim python syntax
Vim Script
7
star
24

iterm-tab-color

🎨 A command-line script to easily set iterm tab colors
Python
7
star
25

kitty-tmux

Make Kitty work better with Tmux
Python
7
star
26

toy-montezuma-pycolab

Toy Montezuma's Revenge as Pycolab and Gym environments (working in progress, NOT FULLY USABLE)
Python
6
star
27

gym-tensorflow

Gym RL environment as TensorFlow op. A fork of Uber's implementation
Python
6
star
28

imagepaste.vim

A vim plugin to paste image from clipboard and its markdown tag
Vim Script
6
star
29

nvim-profiler

A simple Lua Profiler for neovim
Lua
5
star
30

nvidia-ml-py

An unofficial, up-to-date mirror of NVIDIA's python bindings (nvidia-ml-py)
Python
5
star
31

video2gif

A command line script to convert video file to (a reasonable) GIF
Python
3
star
32

misc-stuff

Personal Miscellaneous Stuffs
Python
2
star
33

slurm-tools

A collection of useful scripts for Slurm HPC.
2
star
34

teamnote

Teamnote and code snippets for algorithm competitions including ICPC
Vim Script
1
star
35

redmine_advanced_watchers_selection

Redmine watchers selection plugin
Ruby
1
star
36

fast-syntax-highlighting

Shell
1
star