Max
Max

Reputation: 537

Can I install cuda 10.2 for using tensorflow 2.1 or it has to be cuda 10.1?

Can I install cuda 10.2 for using tensorflow 2.1 or it has to be cuda 10.1? I am using ubuntu 18.04 and I have a NVIDIA Quadro P5000.

Upvotes: 3

Views: 5919

Answers (2)

Xiao BAI
Xiao BAI

Reputation: 41

Pytorch need CUDA 10.2 but Tensorflow need cuda 10.1. Is it a joke?

No, you can use cuda version 10.2 with tensorflow 2.0. It is quite simple.

WHY:

When run "import tensorflow", the tensorflow will search a library named 'libcudart.so.$.$' in LD_LIBRARY_PATH. For tensorflow 2.1.0-2.3.0 with cuda 10.1, it's 'libcudart.so.10.1'. With cuda 10.2, we don't have 'libcudart.so.10.1', so there will be a error.

In fact there are not any difference between cuda 10.1 and cuda 10.2, so we can solve this problem through the soft links.

HOW

cd /usr/local/cuda-10.2/targets/x86_64-linux/lib/
ln -s libcudart.so.10.2.89 libcudart.so.10.1

/usr/local/cuda-10.2/extras/CUPTI/lib64
ln -s libcupti.so.10.2.75 libcupti.so.10.1

cd /usr/local/cuda-10.2/lib64
ln -s libcudnn.so.8 libcudnn.so.7

vim /etc/profile
export CUDA_HOME=/usr/local/cuda-10.2
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/extras/CUPTI/lib64
export PATH=${CUDA_HOME}/bin:${PATH}
source /etc/profile

Click the button to see the picture. Done!

Upvotes: 4

user11530462
user11530462

Reputation:

Providing the solution here (Answer Section), even though it is present in the Comment Section, for the benefit of the community.

No, as per Tensorflow documentation, TensorFlow supports CUDA 10.1 (TensorFlow >= 2.1.0), please refer compatible version details

enter image description here

Upvotes: 3

Related Questions