Suppose we have already installed Nvidia GPU driver which should be equal to or newer than the required.
- Download cuda runfile (installer type: runfile (local)) from https://developer.nvidia.com/cuda-downloads
- For example: https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_**418.39**_linux.run
- Make sure the GPU driver is equal to or newer than 418.39
- Extract what we want:
toolkit
following the interactive prompt orsudo sh cuda-10.1.run --silent --toolkit --toolkitpath=/usr/local/cuda-10.1
- To maintain a cudatoolkit with different versions of cudnn, we can name the dicrectory
cuda-10.1_cudnn-v7.5
- To maintain a cudatoolkit with different versions of cudnn, we can name the dicrectory
- Check the installation status
- If
/usr/local/cuda-10.1_cudnn-v7.5
contains onlybin
andpkgconfig
, the installation failed.InstallUtils.pm
is needed../cuda_8.0.61_375.26_linux.run --tar mxvf
to extractInstallUtils.pm
sudo cp InstallUtils.pm /usr/lib/x86_64-linux-gnu/perl-base/
(ubuntu)export $PERL5LIB
sudo sh cuda-10.1.run --silent --toolkit --toolkitpath=/usr/local/cuda-10.1_cudnn_v7.5
sudo rm /usr/lib/x86_64-linux-gnu/perl-base/InstallUtils.pm
- If
- Remove or recreate
/usr/local/cuda
, which is the default cuda path - Extract cuDNN file:
tar -xzvf cudnn-10.1-linux-x64-v7.5.tgz
sudo cp ~/Gode/cudnn-10.1-linux-x64-v7.5/include/cudnn.h /usr/local/cuda-10.1_cudnn_v7.5/include
sudo cp ~/Gode/cudnn-10.1-linux-x64-v7.5/lib64/libcudnn* /usr/local/cuda-10.1_cudnn_v7.5/lib64
sudo chmod a+r /usr/local/cuda-10.1_cudnn_v7.5/lib64/libcudnn*
- Manually set environment variables for different virtual environments
export PATH=/usr/local/cuda-10.1_cudnn_v7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1_cudnn_v7.5/lib64:$LD_LIBRARY_PATH
- Or follow this blog, update conda's
activate
anddeactivate
command.