2
votes

I have both CPU and a GPU version of tensorflow installed in Windows 10.

conda list t.*flow
# packages in environment at C:\Users\Dell\anaconda4:
#
# Name                    Version                   Build  Channel
tensorflow                2.3.1                    pypi_0    pypi
tensorflow-estimator      2.3.0                    pypi_0    pypi
tensorflow-gpu            2.3.1                    pypi_0    pypi
tensorflow-gpu-estimator  2.3.0                    pypi_0    pypi

Also, I have already installed CUDA and cuDNN by following the steps at this link https://towardsdatascience.com/installing-tensorflow-with-cuda-cudnn-and-gpu-support-on-windows-10-60693e46e781 the only difference is that I downloaded the latest versions of CUDA and cuDNN to conform with the requirements of tensorflow 2.3.1 but still I could not access my GPU, which is a NVIDIA GeForce MX150.

import tensorflow as tf
tf.test.is_built_with_cuda()

return True.

tf.test.is_gpu_available(cuda_only=False, min_cuda_compute_capability=None)

output:

WARNING:tensorflow:From :1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version. Instructions for updating: Use tf.config.list_physical_devices('GPU') instead.

False

Any thoughts as to why tensorflow 2.3.1 cannot access/find the GPU? Please help me solve this problem.

2
What's the full output of Tensorflow's log when you run a sample program?GPhilo

2 Answers

1
votes

I believe tensorflow-gpu does not require tensorflow in order to work, and by having both installed you may be importing the cpu version instead.

First uninstall the standard tensorflow and see if that fixes.

The NVIDIA GeForce MX150 does support CUDA, but there may still be compatibility issues with the most recent versions of tensorflow, CUDA and CUDNN.

The discusson here claims a working combination with with CUDA 9.1 and CUDNN 7.0.5. My advice would be to remove your installed versions and try these, though this will probably require a downgrade of tensorflow-gpu to make it compatible.

1
votes

Your warning showing that tf.test.is_gpu_available is deprecated. If you visit the tensorflow doc here: https://www.tensorflow.org/api_docs/python/tf/test/is_gpu_available. It is mentioned on the doc that this method to check the access to GPU is deprecated.

You should use tf.config.experimental.list_physical_devices('GPU'). To be more precise, use below:

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

Your expected output should be as below if you have one GPU:

# Num GPUs Available:  1