Zexin Li

Please keep honest, open, patient, happy and visionary.

0%

CUDA reinstallment

Synopsis

Save your PC/server in CUDA driver crashed down.

Prequisite

  1. Host machine: A PC/laptop/server with Intel/AMDx86 architeture and Ubuntu installed, can be connected to network.
  2. Physical disk: >10GB available.
  3. sudo

Remove old driver

1
2
3
4
5
sudo apt purge nvidia*
sudo apt purge cuda*
sudo apt clean
sudo apt update
sudo apt upgrade

Follow instructions in NVIDIA official website

For example: NVIDIA

Reboot and configure environmental variables

1
2
3
4
5
sudo reboot
export PATH=/usr/local/cuda/bin:$PATH
# or write into ~/.bashrc
nvcc --version
# check nvcc for verfication

Download cuDNN package and copy them into CUDA PATH

1
2
3
4
wget ...
sudo dpkg -i ...
ls | grep cudnn | xargs -I{} sudo cp {} /usr/local/cuda/include
ls | grep cudnn | xargs -I{} sudo cp {} /usr/local/cuda/lib64

Or goes to NVIDIA Official Site to download: https://developer.nvidia.com/cudnn

Verification

1
2
3
4
5
6
sudo apt-get install libfreeimage3 libfreeimage-dev # install dependencies
cp -r /usr/src/cudnn_samples_v8/ ~
cd cudnn_samples_v8/
cd mnistCUDNN/
make
./mnistCUDNN

Welcome to my other publishing channels