jwm
jwm

Reputation: 5040

Tensorflow 1.15 cannot detect gpu with Cuda10.1

I have installed both tensorflow 2.2.0 and tensorflow 1.15.0(by pip install tensorflow-gpu==1.15.0). The tensorflow 2 is installed in the base environment of Anaconda 3, while the tensorflow 1 is installed in a separate environment.

The tensorflow 2.2.0 can recognize gpu based on a simple test:

if tf.test.gpu_device_name():
    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))

//output: Default GPU Device: /device:GPU:0

But the tensorflow 1.15.0 can not detect gpu.

For your information, my system environment is python + cuda 10.1 + vs 2015.

Upvotes: 0

Views: 7893

Answers (4)

Leandro Gomide
Leandro Gomide

Reputation: 1008

Tensorflow 1.15 expects cuda 10.0 , but I managed to make it work with cuda 10.1 by installing the following packages with Anaconda: cudatoolkit (10.0) and cudnn (7.6.5). So, after running

conda install cudatoolkit=10.0
conda install cudnn=7.6.5

tensorflow 1.15 was able to find and use GPU (which is using cuda 10.1).

PS: I understand your environment is Windows based, but this question pops on Google for the same problem happening on Linux (where I tested this solution). Might be useful also on Windows.

Upvotes: 1

jwm
jwm

Reputation: 5040

The tensosflow versions 1.15.0 to 1.15.3 (the latest version) are all compiled against Cuda 10.0. Downgrading the cuda 10.1 to cuda 10.0 solved the problem.

Also be aware of the python version. It is recommended to install the tensorflow .whl file (as listed at https://nero-mirror.stanford.edu/pypi/simple/tensorflow-gpu/) for the specific python version. As for installation, see How do I install a Python package with a .whl file?

Upvotes: 1

TheEngineer
TheEngineer

Reputation: 832

It might have to do with the version compatibility of TF, Cuda and CuDNN. This post has it discussed thoroughly.

Upvotes: 0

davcli
davcli

Reputation: 121

Have you tried installing Anaconda? it downloads all the requirements and make it easy for you with just a few clicks.

Upvotes: 0

Related Questions