Conda cuda version and local cuda path synchronizing issues


I suffering from cuda version issues.
In my case likes below :

  1. A case : pytorch 1.5, cuda 11.0
  2. B case : pytorch 1.0, cuda 9.0

To run A case project, then i correct my cuda local path to 11.0.
Likewise B case project also correct my cuda local path to 9.0.

It’s really inconvenient job.

But someone said that if i installed conda virtual environment using specific version of cudatoolkit then do not change local cuda path.

For example, A project based on CUDA 9.0.
And my local machine linked with CUDA 11.0 but if i installed conda virtual environment with cudatoolkit 9.0 then not necessary change local cuda path. A project works clear through CUDA 9.0.

Is it right or have any other opinion?
Thank you for reading my question.

The conda binaries and pip wheels ship with their own CUDA (cudnn, NCCL, etc.) runtimes and your local installations won’t be used in built-in PyTorch methods.
If you need to build a custom CUDA extension, your local CUDA installation will be used and you should make sure the binaries use the same CUDA version as your local one.

Besides that your local libs will be used if you build PyTorch from source.

Hi, @ptrblck
Thank you for your timely reply.

I already install on local machine that CUDA 10.1, 11.0, 9.0.
And my local machine’s /usr/local/cuda was linked at CUDA 9.0.
At that time, i want to running B project which based on CUDA 11.0.
Also already constructed conda virtual environment using pytorch 1.5 cuda 11.0.

At this point, should i re-linked my local machine’s cuda path from 9.0 to 11.0 ? Or no require to change local machine’s cuda path because my conda virtual environment already constructed that included CUDA 11.0 and cudatoolkit ?
On the other words, In anaconda virtual environment pytorch equaly calculate like CUDA 11.0 ?

Sorry for poor english and thank you for reply.

If you’ve built PyTorch using different CUDA versions (local installations) in different conda environments, you wouldn’t need to change the CUDA path as long as you are not rebuilding PyTorch or CUDA extensions.
I.e. running PyTorch operators alone would work in your conda environments using the libraries built with the different CUDA compilers.

1 Like