0

I'm trying to use Tensorflow-GPU but it seems to be still running on the CPU. I have seen this Question on how to install Tensorflow-GPU and everything seems right until I try to verify it by executing

from tensorflow.python.client import device_lib 
print(device_lib.list_local_devices())

When I do that then I get following output:

[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 4000308941676664793
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 7883418274751980843
physical_device_desc: "device: XLA_CPU device"
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 13103704949076676658
physical_device_desc: "device: XLA_GPU device"
]

Tensorflow only seems to find my CPU and apparently a XLA_CPU and a XLA_GPU. Do I just have to set the GPU manually or have I done anything wrong? I'm using a NVIDIA GeForce GTX 1050 Ti BTW.

  • What is the outcome of these prints? `value = tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None ) print ('***If TF can access GPU: ***\n',value) print ("Number of GPUs: ",len(tf.config.experimental.list_physical_devices('GPU')))` – Rishabh Sahrawat Apr 21 '20 at 17:41
  • First some deprecation notes and the following: ***If TF can access GPU: *** False Number of GPUs: 0 ​ – Lukas Sokcevic Apr 21 '20 at 17:43
  • That means TF can not see your GPU. The installations haven't been done properly. Please follow this [page](https://www.tensorflow.org/install/gpu#software_requirements). – Rishabh Sahrawat Apr 21 '20 at 17:50

2 Answers2

0

maybe you should confirm whether the NVIDIA drive, cuda and cudnn is installed and their version

Connor He
  • 1
  • 2
  • Checked everything again and CUDA and CUDnn is definetly installed, the driver of the GPU is also on the newest version – Lukas Sokcevic Apr 21 '20 at 15:19
  • e....when I use tensorflow2.0, I added code below in training scripts: ```python from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession config = ConfigProto() config.gpu_options.allow_growth = True session = InteractiveSession(config=config) ``` I hope it can help you. – Connor He Apr 22 '20 at 02:24
0

Only CUDA version 10.1 works. Version 9 and 10.2 are not compatible with the latest version of Tensorflow.