Ubuntu 16.04 显卡状态查询命令
1. nvidia-smi
strong@foreverstrong:~$ nvidia-smi
Mon Sep 2 10:57:09 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130 Driver Version: 384.130 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 0% 47C P8 8W / 180W | 249MiB / 8110MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1508 G /usr/lib/xorg/Xorg 191MiB |
| 0 1723 G /opt/teamviewer/tv_bin/TeamViewer 12MiB |
| 0 1959 G compiz 42MiB |
+-----------------------------------------------------------------------------+
strong@foreverstrong:~$
2. nvidia-smi -l SEC, --loop=SEC
Continuously report query data at the specified interval, rather than the default of just once. The application will sleep in-between queries. Note that on Linux ECC error or XID error events will print out during the sleep period if the -x flag was not specified. Pressing Ctrl+C at any time will abort the loop, which will otherwise run indefinitely. If no argument is specified for the -l form a default interval of 5 seconds is used.
以指定的时间间隔连续报告查询数据,而不是默认的一次。应用程序将在中间查询之间休眠。请注意,如果未指定 -x 标志,则在 Linux ECC 错误或 XID 错误事件将在睡眠期间打印输出。任何时候按 Ctrl + C 都会中止循环,否则循环将无限期地运行。如果没有为 -l 表单指定参数,则使用默认的 5 秒间隔。
使用默认值,每 5 秒间隔刷新一次。
strong@foreverstrong:~$ nvidia-smi -l
每 5 秒间隔刷新一次。
strong@foreverstrong:~$ nvidia-smi -l 5
3. watch -n 2 nvidia-smi
每 2 秒间隔刷新一次。
strong@foreverstrong:~$ watch -n 2 nvidia-smi
每 9 秒间隔刷新一次。
strong@foreverstrong:~$ watch -n 9 nvidia-smi