잡동사니

NVIDIA driver 설치하기 본문

IT/AI

NVIDIA driver 설치하기

yeTi 2020. 7. 8. 09:05

안녕하세요. yeTi입니다.
오늘은 NVIDIA GPU 사용하기 위해 driver를 설치해보려고 합니다.

nvidia-docker를 사용하기 위해선 NVIDIA driver를 설치해야 하는데요.

package manager를 활용해서 쉽게 cuda-drivers 패키지를 설치할 수 있습니다.

그래서 Download - CUDA Toolkit에서 제공하는 가이드를 따라 해봤습니다.

~$ wget [http://developer.download.nvidia.com/compute/cuda/11.0.1/local_installers/cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb](http://developer.download.nvidia.com/compute/cuda/11.0.1/local_installers/cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb)
~$ sudo apt-key add /var/cuda-repo-ubuntu1804-11-0-local/7fa2af80.pub
~$ sudo dpkg -i cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb
~$ sudo apt-get update
~$ sudo apt-get -y install cuda
...
Setting up cuda (11.0.1-1) ...
Processing triggers for initramfs-tools (0.130ubuntu3.9) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-109-generic
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.11-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Processing triggers for dbus (1.12.2-1ubuntu1.2) ...

설치 완료 후 드라이버가 정상적으로 동작하는지 다음과 같이 확인해볼 수 있습니다.

~$ docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
Tue Jul  7 23:36:45 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.36.06    Driver Version: 450.36.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id      Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|        Memory-Usage | GPU-Util  Compute M. |
|                  |                 |           MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:19:00.0 Off |            N/A |
| 40%   56C    P0    68W / 250W |      1MiB / 11019MiB |      0%      Default |
|  |  |  N/A |
+-------------------------------+----------------------+----------------------+
|   1  GeForce RTX 208...  Off  | 00000000:1A:00.0 Off |            N/A |
| 42%  57C     P0    78W / 250W |      1MiB / 11019MiB |      0%      Default |
|  |  |  N/A |
+-------------------------------+----------------------+----------------------+
|   2  GeForce RTX 208...  Off  | 00000000:67:00.0 Off |            N/A |
| 48%  58C     P0    56W / 250W |      1MiB / 11019MiB |      1%      Default |
|  |  |  N/A |
+-------------------------------+----------------------+----------------------+
|   3  GeForce RTX 208...  Off  | 00000000:68:00.0 Off |            N/A |
| 43%  57C     P0    62W / 250W |      1MiB / 11016MiB |      0%      Default |
|                  |               |            N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                        |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                |
+-----------------------------------------------------------------------------+
Comments