Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install multiple versions of CUDA and cuDNN

Tags:

I am currently using CUDA version 7.5 with cuDNN version 5 for MatConvNet. I'd like to install version 8.0 and cuDNN version 5.1 and I want to know if there will be any conflicts if I have the environment paths pointing to both versions of CUDAand cuDNN.

like image 497
Kong Avatar asked Dec 26 '16 11:12

Kong


People also ask

Can I have 2 different CUDA versions?

There is only one requirement, that one needs to satisfy in order to install multiple CUDA on the same machine. You need to have latest Nvidia driver that is required by the highest CUDA that you're going to install. Usually it is a good idea to install precise driver that was used during the build of CUDA.

Can I install multiple cuDNN versions?

Yes, its possible. You'll need to install the CUDNN (i.e. unzip the tar file on linux) to separate locations, and then provide appropriate -I (include) and -L (link) path switches, on linux, when compiling.

What is the difference between cuDNN and CUDA?

What is the difference between cuDNN and CUDA? The cuDNN library is a library optimized for CUDA containing GPU implementations. Think of cuDNN as a library for Deep Learning using CUDA and CUDA as a way to talk to the GPU.


2 Answers

The only environment variables that matter are PATH and LD_LIBRARY_PATH. There shouldn't be any conflicts due to LD_LIBRARY_PATH since all the libs' sonames seem to be bumped properly in each version. As for PATH, the shell will execute the version from the path that appears first in the variable. So there is no point for PATH to contain both versions at the same time, you'll need to decide which version to use at a time.

like image 51
Jakub Klinkovský Avatar answered Sep 24 '22 05:09

Jakub Klinkovský


There's a good article that describes all the steps. The important ones for me were:

  • Run the CUDA install script with the --silent --toolkit --override options.
  • Set the LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64.
  • Change the /usr/local/cuda symbolic link to point back to the default version.
like image 26
Don Kirkby Avatar answered Sep 23 '22 05:09

Don Kirkby