purge -> 패키지와 그 패키지의 환경설정을 모두 삭제함. remove와 명령어가 거의 같지만, 환경설정도 삭제함.
sudo apt-get purge remove "*nvidia*" (드라이버 삭제 안하려면 사용X)
If you have installed via source files (assuming the default location to be /usr/local) then remove it using:
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*" (cuda toolkit 제거)
sudo rm -rf /usr/local/cuda*
apt-get --purge remove 'cuda*'
apt-get autoremove --purge 'cuda*'
dpkg -l | grep nvidia
이걸로 뭔가 나올 경우 -> apt-get remove --purge 나은 이름
sudo apt-get autoremove
sudo apt-get autoclean
autoremove는 예전에 다른 패키지의 의존성 때문에 설치되었지만 지금은 사용되지 않는 패키지를 삭제함.
autoclean은 불완전하게 다운로드된 패키지나 오래된 패키지를 삭제하고자 할 때 실행합
lspci | grep -i nvidia
gcc --version
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt-get update
sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda-11-1 cuda-drivers
-> 11.4는 왠지 모르겠지만 안 됨
https://velog.io/@kite_day/cuda-%EC%9E%AC%EC%84%A4%EC%B9%98-cuda-11-cudnn-%EC%84%A4%EC%B9%98
여기 참고
https://developer.nvidia.com/cuda-toolkit-archive
https://www.tensorflow.org/install/source?hl=ko#gpu
echo 'export PATH=/usr/local/cuda-11.1/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
sudo ldconfig
CUDNN_TAR_FILE="cudnn-11.1-linux-x64-v8.0.4.30.tgz"
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.4/11.1_20200923/cudnn-11.1-linux-x64-v8.0.4.30.tgz
tar -xzvf ${CUDNN_TAR_FILE}
sudo cp -P cuda/include/cudnn*.h /usr/local/cuda-11.1/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-11.1/lib64/
sudo chmod a+r /usr/local/cuda-11.1/lib64/libcudnn*
sudo apt install nvidia-cuda-toolkit
nvidia-smi
nvcc -V
출처
https://gist.github.com/hungntt/836a3862dbe09dd643758ecbcbec043f