설치 버전
CUDA 12.8 + cuDNN 9.7.0
설치 순서
1. NVIDIA 드라이버 + CUDA 설치
2. cuDNN 설치
1. NVIDIA 드라이버 설치 + CUDA 설치
1) 사전 설치 요소
sudo apt update && upgrade -y
sudo apt install build-essential gcc make ubuntu-drivers-common dkms vim nvidia-modprobe
2) CLI 전환
NVIDIA 드라이버 + CUDA Toolkit을 설치하기 전에 GUI를 끌 것
sudo systemctl isolate multi-user.target
3) Nouveau 비활성화
# nouveau 드라이버를 블랙리스트에 추가
sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
# 아래 명령어로 blacklist-nvidia-nouveau.conf 파일 내용 확인
cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
blacklist nouveau
options nouveau modeset=0
# 아래 명령어 입력 후 재부팅
sudo update-initramfs -u
# nouveau 실행 확인 -> 아무것도 안뜨면 종료된 것
lsmod | grep nouveau
4) CUDA 다운로드
4-1) NVIDIA 홈페이지에서 필요한 버전 찾기
https://developer.nvidia.com/cuda-toolkit-archive
CUDA Toolkit Archive
Previous releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production
developer.nvidia.com
4-2) 아래 명령어로 설치
wget https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_570.86.10_linux.run
sudo sh cuda_12.8.0_570.86.10_linux.run
4-3) 설치 진행
4-4) Summary 출력 확인
===========
= Summary =
===========
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-11.8/
Please make sure that
- PATH includes /usr/local/cuda-11.8/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-11.8/lib64, or, add /usr/local/cuda-11.8/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.8/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 520.00 is required for CUDA 11.8 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
sudo <CudaInstaller>.run --silent --driver
Logfile is /var/log/cuda-installer.log
4-5) ./bashrc 파일 수정
sudo vim ~/.bashrc
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
source ~/.bashrc
5) nvidia-smi 및 nvcc -V로 버전 확인
nvidia-smi
# 출력 결과
Wed Mar 5 08:55:31 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.10 Driver Version: 570.86.10 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| 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 NVIDIA RTX 6000 Ada Gene... Off | 00000000:55:00.0 On | Off |
| 30% 28C P8 10W / 300W | 7345MiB / 49140MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA RTX 6000 Ada Gene... Off | 00000000:A2:00.0 Off | Off |
| 30% 25C P8 13W / 300W | 7343MiB / 49140MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
nvcc -V
# 출력 결과
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Wed_Jan_15_19:20:09_PST_2025
Cuda compilation tools, release 12.8, V12.8.61
Build cuda_12.8.r12.8/compiler.35404655_0
6) GUI 활성화
sudo systemctl start graphical.target
2. cuDNN 설치하기
1) 아래 경로에서 원하는 cuDNN 버전 찾아서 다운로드 ( tar 파일 )
https://developer.nvidia.com/cudnn-archive
cuDNN Archive
developer.nvidia.com
주의) .deb로 설치하면 경로 문제로 인해 torch 같은 모듈들이 cuda를 찾지 못해 추가 설정을 해야하므로 tarball로 설치할 것을 추천
2) 다운로드 및 파일 압축 풀기
wget https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.7.0.66_cuda12-archive.tar.xz
tar -xvf cudnn-linux-x86_64-9.7.0.66_cuda12-archive.tar.xz
3) 압축 푼 경로로 이동
cd cudnn-linux-x86_64-9.7.0.66_cuda12-archive/
4) /usr/local/cuda 경로로 파일 복사
sudo cp include/cudnn*.h /usr/local/cuda/include
sudo cp lib/libcudnn* /usr/local/cuda/lib64
5) 설치된 cuDNN 버전 확인
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
# 출력 결과
#define CUDNN_MAJOR 9
#define CUDNN_MINOR 7
#define CUDNN_PATCHLEVEL 0
'dev' 카테고리의 다른 글
YOLOv12: Attention-Centric Real-Time Object Detectors (0) | 2025.03.04 |
---|---|
[Jetson] Jetson Orin Nano GPIO 에러 Exception: Could not determine Jetson model 해결 (0) | 2025.01.20 |
[Label Studio] Ultralytics YOLOv8로 라벨링 작업 자동화 해보기 (2) | 2024.11.14 |
YOLO11 (2) | 2024.10.07 |
Apple Depth Pro: Sharp Monocular Metric Depth in Less Than a Second (0) | 2024.10.07 |