CUDA Download Page에서 최신 CUDA 버전과 다운 URL을 확인합니다. 글을 작성중인 지금 시점에서는 CUDA 7.5 버전이 최신 버전입니다.
CUDA Toolkit Installer를 다운받기 위해 아래와 같이 진행합니다.
wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run
다운 받은 CUDA Toolkit Installer에 실행권한을 부여합니다.
sudo chmod +x cuda_7.5.18_linux.run
설치를 시작합니다.
sudo ./cuda_7.5.18_linux.run
간혹 아래와 같이 Installation Failed. Using unsupported Compiler. 애러가 뜨면서 설치가 실패하는 경우가 있습니다. 아래 애러는 CUDA 6.5 설치 도중 일어난 애러 구문을 복사한 것입니다.
root@ubuntu:~# ./cuda_6.5.14_linux_64.run Logging to /tmp/cuda_install_37767.log Using more to view the EULA. End User License Agreement -------------------------- Preface ------- The following contains specific license terms and conditions for four separate NVIDIA products. By accepting this agreement, you agree to comply with all the terms and conditions applicable to the specific product(s) included herein. NVIDIA CUDA Toolkit Description The NVIDIA CUDA Toolkit provides command-line and graphical tools for building, debugging and optimizing the performance of applications accelerated by NVIDIA GPUs, runtime and math libraries, and documentation including programming guides, Do you accept the previously read EULA? (accept/decline/quit): accept Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 340.29? ((y)es/(n)o/(q)uit): n Install the CUDA 6.5 Toolkit? ((y)es/(n)o/(q)uit): y Enter Toolkit Location [ default is /usr/local/cuda-6.5 ]: Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y Install the CUDA 6.5 Samples? ((y)es/(n)o/(q)uit): y Enter CUDA Samples Location [ default is /root ]: Error: unsupported compiler: 4.8.4. Use --override to override this check. Missing recommended library: libGLU.so Missing recommended library: libXmu.so Missing recommended library: libGL.so Error: cannot find Toolkit in /usr/local/cuda-6.5 =========== = Summary = =========== Driver: Not Selected Toolkit: Installation Failed. Using unsupported Compiler. Samples: Cannot find Toolkit in /usr/local/cuda-6.5 Logging to /tmp/cuda_install_37767.log
이럴 경우 설치 시 다음과 같이 옵션을 주면 됩니다.
sudo ./cuda_7.5.18_linux.run --override compiler
CUDA가 지원하는 컴파일러 버전은 아래와 같습니다. 설치하고자 하는 Ubuntu 14.04버전에서는 Kernel 3.13, gcc 4.8.2 버전을 지원합니다.
CUDA TOOLKIT DOCUMENTATION
설치가 완료되면 PATH에 CUDA를 등록해줍니다.
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib' >> ~/.bashrc source ~/.bashrc