'Can I train in tensorflow with separate CUDA version in anaconda environment

I need to train a model in TensorFlow-gpu==2.3.0 which needs the CUDA version to be 10.1. But when I type 'nvidia-smi' it shows CUDA version to be 10.0.

I created a conda environment using, "conda create -n tf2-gpu tensorflow-gpu cudatoolkit=10.1" after initiating training, it throws an error as tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

How can I train using tensorflow-gpu in conda environment with another version of CUDA? And, I still need CUDA 10.0 to be there, as it helps my other training setup.



Solution 1:[1]

Yes, you can create two virtual environments in Anaconda with different tensorflow version. But CUDA and CuDNN will be installing compatible to that specified tensorflow-gpu.

You can find tensorflow-gpu build configuration details here to check supporting CUDA and cuDNN version.

Please check this similar issue link to create virtual environment in anaconda and to install specific tensorflow-gpu.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TFer2