우분투에서 GPU 사용량 등을 확인하고 싶을 때 사용하는 툴을 소개합니다.
1. nvidia-smi
NAME
nvidia-smi - NVIDIA System Management Interface program
SYNOPSIS>
nvidia-smi [OPTION1 [ARG1]] [OPTION2 [ARG2]] ...
TIP : watch -n 0.5 nvidia-smi
- 0.5초마다 nvidia-smi 호출
2. gpustat
Link : https://github.com/wookayin/gpustat
Options:
-
--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 -
-p
,--show-pid
: Display PID of the process -
-P
,--show-power
: Display GPU power usage and/or limit (draw
ordraw,limit
) -
-i
,--interval
: Run in watch mode (equivalent towatch gpustat
) if given. Denotes interval between updates. -
--json
: JSON Output (Experimental, #10)
Tips :
-
To periodically watch, try
gpustat -i
(built-in watch support: #41). Alternative:watch --color -n1.0 gpustat --color << 매우 유용
-
Running
nvidia-smi daemon
(root privilege required) will make the query much faster. -
The GPU ID (index) shown by
gpustat
(andnvidia-smi
) is PCI BUS ID, while CUDA differently assigns the fastest GPU with the lowest ID by default. Therefore, in order to make CUDA andgpustat
use same GPU index, configure theCUDA_DEVICE_ORDER
environment variable toPCI_BUS_ID
(before settingCUDA_VISIBLE_DEVICES
for your CUDA program):export CUDA_DEVICE_ORDER=PCI_BUS_ID
'Dev Platform > Linux' 카테고리의 다른 글
[Linux] 우분투 Jupyter notebook 설치하기 (0) | 2023.08.17 |
---|---|
[Linux] 리눅스 모니터링 프로그램 ( htop ) 소개 (0) | 2023.08.17 |
[리눅스] 데스크탑 화면 동영상 캡쳐 프로그램 - OBS (0) | 2019.03.26 |
[Ubuntu] 18.04에서 쉽게 Nvidia 그래픽 카드 드라이버 설치하기 (0) | 2019.03.25 |
[Ubuntu] 18.04에서 한글 입력 및 한영키 사용 (0) | 2019.03.24 |