TensorFlow fails to use gpu

Viewed 764

I'm getting started with TensorFlow, but I cannot make it use GPU instead of CPU with TensorFlow 1.2.1.

I've got a laptop equipped with a NVIDIA GTX 850M which is CUDA 5.0 compatibility.

The CUDA Toolkit is installed with the latest version available.

cuDNN is installed with the latest version available.

I've set up the environment variables just as is shown here : https://nitishmutha.github.io/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html

If I install the latest version of TensorFlow via pip: "pip install tensorflow-gpu" in the cmd prompt, then TensorFlow does not recognize my GPU and acts like I've got none: 'Device mapping: no known device'.

If instead I install tensorflow via 'pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.1-cp35-cp35m-win_amd64.whl' then everything works fine.

Has anyone an idea why the latest version of TF does that?

1 Answers

In the latest version of Tensorflow, you can check the GPU availability as

gpu_available = tf.test.is_gpu_available()
is_cuda_gpu_available = tf.test.is_gpu_available(cuda_only=True)
is_cuda_gpu_min_3 = tf.test.is_gpu_available(True, (3,0))

tf.test.is_gpu_available will be removed in a future version. Instructions for updating: Use tf.config.list_physical_devices('GPU') instead

Related