2019.01.28 업데이트
- http://imky.egloos.com/3231380 Ubuntu 16.04 듀얼그래픽카드 노트북 + CUDA 9.0 글을 먼저 참조 부탁드립니다.
[참고자료]
- NVDIA드라이버 CUDA에 관한 내용 : https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07
- PPA를 통해 NVIDIA드라이버 설치 : https://www.pcsuggest.com/install-nvidia-drivers-ubuntu/
요점은 Ubuntu에 NVIDIA 드라이버를 설치하여 CUDA를 활용하고자 한다면,
시행착오식으로 작업하지 마시고 관련 내용들을 다 살펴본 후 최적의 방법으로 해야 시간을 아낄 수 있을 듯 합니다~
- 리눅스는 NOUVEAU가 기본 설치되는데, CUDA를 쓰려면 이것을 꺼야 함
- UEFI secure boot가 설정된 컴퓨터에서는 NVIDIA 드라이버가 설치되지 않을 수 있음
- 동작만 된다면 PPA를 통해 드라이버를 설치하는 것도 하나의 방법...
(저는 거의 스무 시간을 소비 ㅜㅜ)
- 1대는 GTX-1080Ti가 설치된 데스크탑
- 1대는 Dell의 인스피론 7577 게이밍 노트북 GTX-1060 Max-Q
nvidia-smi 명령과 /usr/local/cuda/samples/1_Utilties/deviceQuery/deviceQuery(sudo make해야 만들어지는)가 정상 작동되는 것이 목표입니다.
[nvidia-smi 명령 결과]
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.26 Driver Version: 396.26 |
|-------------------------------+----------------------+----------------------+
| 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:06:00.0 Off | N/A |
| 0% 31C P5 28W / 250W | 0MiB / 11175MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
[deviceQuery 명령 결과]
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1080 Ti"
CUDA Driver Version / Runtime Version 9.2 / 9.2
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 11175 MBytes (11718230016 bytes)
(28) Multiprocessors, (128) CUDA Cores/MP: 3584 CUDA Cores
GPU Max Clock rate: 1721 MHz (1.72 GHz)
Memory Clock rate: 5505 Mhz
Memory Bus Width: 352-bit
L2 Cache Size: 2883584 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 6 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.2, CUDA Runtime Version = 9.2, NumDevs = 1
Result = PASS
[해결 안된 문제 혹은 확인 중인 문제]
- Dell에서는 X Window 로그인 화면에서 계속 로그인 실패 중 => GUI가 필요하면 원격에서 접속해서 사용 중... 나머지 다른 것은 아무 문제 없음. .run파일을 이용한 NVIDIA 및 CUDA설치에 어려움이 없음.
- 데스트탑에서 cuda 9.2 설치 중 아래 오류는 여전히 나타남(nvidia 드라이버 설치는 제외하고 진행, 현재 sudo apt-get install nvidia-396을 설치한 상태).
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.2 functionality to work.
[알게된 혹은 확인한 부분들]
- 바이오스(UEFI) 설정에서 UEFI Secure Boot는 그냥 끄고 작업을 하는 것이 정신 건강에 이롭다... : 최소 서너 시간 절약
- NVIDIA드라이버, CUDA와 cuDNN은 그냥 아무 생각없이 최신 버전을 깔자... : 예를 들면, NVIIDA 390드라이버가 cuda 9.2(NVIDIA 396요구)로 하면 deviceQuery가 응답이 오류...
- NVIDIA드라이버는 DKMS를 사용해야 함, 우분투는 기본으로 nouveau로 설치되므로...꺼주어야 하구요...
- GRUB에서 커널 버전을 낮추고 부팅하라는 이야기도 있지만 큰 도움은 안됨
- GCC버전이 낮으면 NVIDIA의 .run으로 드라이버 설치 중 오류가 나타나서 기존 4.대에서 5.대로 교체해서 한가지 문제는 해결함
- PPA를 등록해서 sudo apt-get install nvdia-396을 통해 설치해도, CUDA는 작동되었음(데스크탑에서는 계속해서 NVIDIA의 .run드라이버가 DKMS 작업 중 오류가 나와서 이렇게 설치. ERROR (dkms apport): binary package for nvidia: 390.59 not found).
결론적으로
- 데스크탑은 현재 아무런 문제가 없이 작동 중입니다.
- Dell에서는 X Window 로그인이 안되어서 콘솔로 켜놓고 원격 접속 이용 중입니다.(다음에 시간 날 때 해결 예정) -> 첫부분 글 참조
써놓고 보니 잘 정리된 거 같지는 않군요. 어쨌든 종합적으로 알고 시작하는 것이 결국 시간 절약이라는 교훈을 얻었습니다.
덧글