Multiple Cuda

Imran Bangash
1 min readNov 2, 2023

Its possible to install multiple Cuda

Create symlink /usr/local/cuda to default version

$ cd /usr/local
$ sudo rm cuda
$ sudo ln -s cuda-11.8 cuda

By default, through environment variables, the system will use the version of CUDA that the symlink /usr/local/cuda points to, and this symlink is updated when you install the new version in the previous step. If you have a certain version that you want to use as the default, update the symlink to point to that version’s installation.

4. Add each CUDA lib directory to LD_LIBRARY_PATH in order

export PATH="/usr/local/cuda-11.8/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH"
source .bashrc

To proceed, we must install Pytorch and TensorFlow. We can choose to install using either pip or conda environment. If you prefer to avoid manual installation of CuDNN, it would be advisable to use anaconda. Anaconda will take care of installing CuDNN for you and prevent unnecessary complications. I will be utilizing anaconda to install both GPU versions of Pytorch and TensorFlow.

https://medium.com/@peterjussi/multicuda-multiple-versions-of-cuda-on-one-machine-4b6ccda6faae

--

--

Imran Bangash

Imran is a computer vision and AI enthusiast with a PhD in computer vision. Imran loves to share his experience with self-improvement and technology.