nvitop是一款交互式NVIDIA设备和进程监控工具。它有一个丰富多彩的信息界面,可以不断更新设备和进程的状态。作为一款资源监控器,它包括许多功能和选项,如树视图、环境变量查看、流程过滤、流程度量监控等。除此之外,该包还为深度学习研究人员提供了CUDA设备选择工具nvisel。它还提供了方便的API,允许开发人员编写自己的监控工具。
信息和漂亮的输出:使用彩色的盒子绘图显示比nvidia-smi更多的信息。
监视器模式:可以作为资源监视器运行,而不是只打印一次结果。
交互式:在显示器模式下响应用户输入(来自键盘和/或鼠标)。(与gpustat和py3nvml相比)
高效
便携式:在Linux和Windows上工作。
可集成:易于集成到其他应用程序中,不仅仅是监控。(与nvidia-htop和nvtop相比)
github地址: https://github.com/XuehaiPan/nvitop
以下是在Ubuntu系统下安装命令,其他系统类似
$ sudo apt install pip
$ pip install nvitop
使用nvitop
, 可以实时监控显存的使用情况。
usage: nvitop [--help] [--version] [--once | --monitor [{auto,full,compact}]] [--interval SEC] [--ascii] [--colorful]
[--force-color] [--light] [--gpu-util-thresh th1 th2] [--mem-util-thresh th1 th2]
[--only idx [idx ...]] [--only-visible] [--compute] [--only-compute] [--graphics] [--only-graphics]
[--user [USERNAME ...]] [--pid PID [PID ...]]
# Monitor mode (when the display mode is omitted, `NVITOP_MONITOR_MODE` will be used)
$ nvitop # or use `python3 -m nvitop`
# Automatically configure the display mode according to the terminal size
$ nvitop -m auto # shortcut: `a` key
# Arbitrarily display as `full` mode
$ nvitop -m full # shortcut: `f` key
# Arbitrarily display as `compact` mode
$ nvitop -m compact # shortcut: `c` key
# Specify query devices (by integer indices)
$ nvitop -o 0 1 # only show <GPU 0> and <GPU 1>
# Only show devices in `CUDA_VISIBLE_DEVICES` (by integer indices or UUID strings)
$ nvitop -ov
# Only show GPU processes with the compute context (type: 'C' or 'C+G')
$ nvitop -c
# Use ASCII characters only
$ nvitop -U # useful for terminals without Unicode support
# For light terminals
$ nvitop --light
# For spectrum-like bar charts (requires the terminal supports 256-color)
$ nvitop --colorful