vidia自带一个命令行工具可以查看显存的使用情况:
nvidia-smi
表头释义:
下边的Processes:
显示每块GPU上每个进程所使用的显存情况。
如果要周期性的输出显卡的使用情况,可以用watch指令实现:
watch -n 10 nvidia-smi
命令行参数-n后边跟的是执行命令的周期,以s为单位。
watch用法
用法: watch [options] command 选项: -b, --beep beep if command has a non-zero exit -c, --color interpret ANSI color and style sequences -d, --differences[=<permanent>] highlight changes between updates -e, --errexit exit if command has a non-zero exit -g, --chgexit exit when output from command changes -n, --interval <secs> seconds to wait between updates -p, --precise attempt run command in precise intervals -t, --no-title turn off header -x, --exec pass command to exec instead of "sh -c" -h, --help 显示此帮助然后离开 -v, --version output version information and exit
完结!
原文:https://www.cnblogs.com/wqbin/p/12808002.html