Nvidia driver, cuda, cudnn

Halo·2022년 5월 6일
0

Linux

목록 보기
3/4
post-thumbnail

nvidia 드라이버 고급 검색

# 설치확인
nvidia-smi
# 드라이버제거
sudo apt-get --purge -y remove 'cuda*'
sudo apt-get --purge -y remove 'nvidia*'
sudo apt-get --purge -y remove "*nvidia*"
sudo apt-get autoremove --purge cuda
sudo rm -rf /usr/local/cuda*

sudo /usr/local/cuda-11.2/bin
sudo /usr/bin/nvidia-uninstall

drm error
stackoverflow

cuda toolkit achive

# 설치확인
nvcc -V

# cuda 경로 설정
# 1
vi /etc/profile

# 열린 파일안 하단에 작성
export PATH=$PATH:/usr/local/cuda-11.3/bin 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.3/lib64 
export CUDADIR=/usr/local/cuda-11.3

# 2
gedit ~/.bashrc

export PATH=/usr/local/cuda-11.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:$LD_LIBRARY_PATH

source ~/.bashrc

cudnn achive

# 설치
tar xvzf cudnn-11.3-linux-x64-v8.2.1.32.tgz
sudo cp cuda/include/cudnn* /usr/local/cuda-11.3/include 
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.3/lib64 
sudo chmod a+r /usr/local/cuda-11.3/include/cudnn.h /usr/local/cuda-11.3/lib64/libcudnn*

# 하단을 실행하는 이유
# cudnn을 카피시 심볼릭 링크가 사라져서 다시 잡아주기 위함
sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 

sudo ln -sf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn.so.8.2.1.32 /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn.so.8

# 설치확인 1
ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep libcudnn

# 설치확인 2
sudo ldconfig

# 설치확인 3
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
profile
일단 해보자 !

0개의 댓글