nvidia-smi 的输出显示了正在 GPU 上运行的进程 ID 列表:
Thu May 10 09:05:07 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.111 Driver Version: 384.111 |
|-------------------------------+----------------------+----------------------+
| 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 108... Off | 00000000:0A:00.0 Off | N/A |
| 61% 74C P2 195W / 250W | 5409MiB / 11172MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 5973 C ...master_JPG/build/tools/program_pytho.bin 4862MiB |
| 0 46324 C python 537MiB |
+-----------------------------------------------------------------------------+
如何显示与每个进程相关联的用户名?
这将显示单个PID的用户名:
ps -u -p $pid