Etc/Etc

Nvidia Cuda 설치

light_meal 2022. 8. 14. 09:36
728x90

Nvidia Cuda 설치

설치 가이드 : https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#verify-you-have-cuda-enabled-system

 

Installation Guide Linux :: CUDA Toolkit Documentation

Check that the device files/dev/nvidia* exist and have the correct (0666) file permissions. These files are used by the CUDA Driver to communicate with the kernel-mode portion of the NVIDIA Driver. Applications that use the NVIDIA driver, such as a CUDA ap

docs.nvidia.com

 

환경

OS : Ubuntu 20.04 LTS

GPU : 4개

 

사전 설치 작업

  • 시스템에 CUDA 지원 GPU가 있는지 확인합니다.
  • 시스템이 지원되는 Linux 버전을 실행 중인지 확인하십시오.
  • 시스템에 gcc가 설치되어 있는지 확인합니다.
  • 시스템에 올바른 커널 헤더와 개발 패키지가 설치되어 있는지 확인하십시오.
  • NVIDIA CUDA 툴킷을 다운로드하십시오.
  • 충돌하는 설치 방법을 처리합니다.

 

CUDA 지원 GPU가 있는지 확인

lspci | grep -i nvidia

 

지원되는 Linux 버전이 있는지 확인

uname -m && cat /etc/*release

 

 

시스템에 gcc가 설치되어 있는지 확인

gcc --version

 

 

시스템에 올바른 커널이 설치되어 있는지 확인

uname -r

 

 

# 설치가 되어 있지 않을 경우
sudo apt-get install linux-headers-$(uname -r)

 

NVIDIA CUDA Tool kit 다운로드

https://developer.nvidia.com/cuda-downloads

 

CUDA Toolkit 11.7 Downloads

Get the latest feature updates to NVIDIA's proprietary compute stack.

developer.nvidia.com

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

 

설치 확인

ls -l /usr/local/cuda

728x90