简体   繁体   中英

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.

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

在此处输入图片说明

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM