wsl - cuda 다중 버전 관리

paradeigma·2024년 10월 29일

1. 현 상황

1.1 세팅

gpu: rtx 4060 labtop
nvidia-driver: 556.05
computer compatibility:8.9

1.2 목표

python 3.11 + gcc 13/ g++ 13 + cuda 12.4 + cudnn 9.5.1 + tensorrt 10.5

python 3.9 + gcc 11/ g++ 11 + cuda 11.8 + cudnn 8.6.0 + tensorrt 10.5

이 때 반드시

sudo update-alternatives --config python3
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo update-alternatives --config cuda

이렇게 4가지를 바꿔가며 진행해야 한다.

2. 절차

2.1 python 버전 다중화

완료

2.2 cuda 버전 다중화

완료

2.3 cudnn 버전 다중화

cudnn은 각 cuda 내에 설치하는 것이라 cuda 버전을 바꾸면 자동으로 함께 바꿀 수 있게 해야 한다.

2.3.1 cudnn 9.5.1

아래 글의 방법을 통해 설치 완료
https://velog.io/@paradeigma/WSL-nvidia-driver-computer-compatibility-cuda-cudnn-버전-확인

2.3.2 cudnn 8.6.0

아래 글을 참조하여 설치
https://hjh1023.tistory.com/59

tar -xvf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
sudo cp cudnn-linux-x86_64-8.6.0.163_cuda11-archive/include/cudnn*.h /usr/local/cuda-11.8/include
sudo cp -P cudnn-linux-x86_64-8.6.0.163_cuda11-archive/lib/libcudnn* /usr/local/cuda-11.8/lib64
sudo chmod a+r /usr/local/cuda-11.8/lib64/libcudnn*
profile
AI Engineer

0개의 댓글