k8s에서 gpu을 사용하는 pod을 만들일이 있어 관련 내용을 정리하였다.
gpu을 사용하기 위해서는 nvidia driver가 있어야한다.
이번 포스팅엔 먼저 nvidia 드라이버 설치 관련 내용을 정리하였다.
nvdia driver설치하기
$ yum update
$ yum install kernel-devel kernel-headers gcc make
nouveau 을 활성화시키면 충돌가능성이 있기에 blacklist해준다.
$ echo 'blacklist nouveau' >> /etc/modprobe.d/blacklist.conf
$ dracut /boot/initramfs-$(uname -r).img $(uname -r) --force
$ reboot
파일다운
이것저것 뜨는데 다 ok, yes해줌 된다.
$ bash NVIDIA-Linux-x86_64-390.59.run
1. WARNING: nvidia-installer was forced to guess the X library path '/usr/lib64' and X
module path '/usr/lib64/xorg/modules'; these paths were not queryable from the
system. If X fails to find the NVIDIA X driver module, please install the
`pkg-config` utility and the X.Org SDK/development package for your distribution
and reinstall the driver
OK
2. Install NVIDIA's 32-bit compatibility libraries?
YES
3. Would you like to run the nvidia-xconfig utility to automatically update your X
configuration file so that the NVIDIA X driver will be used when you restart X? Any
pre-existing X configuration file will be backed up.
YES
4. Your X configuration file has been successfully updated. Installation of the NVIDIA
Accelerated Graphics Driver for Linux-x86_64 (version: 390.59) is now complete.
OK
$ nvidia-smi
Thu May 24 21:39:10 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.59 Driver Version: 390.59 |
|-------------------------------+----------------------+----------------------+
| 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:01:00.0 Off | N/A |
| 0% 34C P5 15W / 250W | 0MiB / 11178MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 108... Off | 00000000:04:00.0 Off | N/A |
| 0% 33C P5 13W / 250W | 0MiB / 11178MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
위 화면이 뜬다면 완료
'apps > docker' 카테고리의 다른 글
flannel을 통한 pod간 통신 (2) | 2018.07.03 |
---|---|
도커에서 nodejs+mongodb 테스트 (0) | 2018.07.01 |
kubernetes에서 gpu pod생성( nvidia-docker2 ) (2) | 2018.05.30 |
kubenetes설치 실패 시 초기화방법 (0) | 2018.05.28 |
Kubernetes + Docker 설치 ( CentOS ) (1) | 2018.05.28 |