tensorflow: Tensorflow see's GPU but only uses xla_cpu and crashes when told to use xla_gpu

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): True (I’m not using a code example but I have not written custom code within Tensorflow)

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ms Windows 10 Home - 10.0.18363

  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A

  • TensorFlow installed from (source or binary): TensorFlow 2.2.0 installed using: pip install --upgrade tensorflow

  • TensorFlow version (use command below): Code: import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION) Output: 2020-05-26 09:27:35.360714: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll v2.2.0-rc4-8-g2b96f3662b 2.2.0

  • Python version: 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]

  • Bazel version (if compiling from source):

  • GCC/Compiler version (if compiling from source): N/A

  • CUDA/cuDNN version: nvcc: NVIDIA ® Cuda compiler driver Copyright © 2005-2019 NVIDIA Corporation Built on Fri_Feb__8_19:08:26_Pacific_Standard_Time_2019 Cuda compilation tools, release 10.1, V10.1.105

  • GPU model and memory: incarnation: 17283739609840781326 physical_device_desc: “device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1” , name: “/device:XLA_GPU:0” device_type: “XLA_GPU” memory_limit: 17179869184 locality { } incarnation: 2207722455070197847 physical_device_desc: “device: XLA_GPU device” You can collect some of this information using our environment capture script You can also obtain the TensorFlow version with:

  1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
  2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior I was training my models when it felt like they were running very slowly. After some digging I noticed that device GPU 0 is type xla_cpu and is not going through my gpu. device xla_gpu is listed but when forcing tensforflow to use it just crashes saying it can’t find ptaxs.

Describe the expected behavior I was hoping that TensorFlow would be able to use my gpu by default.

Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/Jupyter/any notebook.

I don’t think this would be very useful but the error happens on the line with tf.device(‘/… if I remove ‘with tf.device(’/device:XLA_GPU:0’):’ everything works but tensorflow use my cpu with xla_cpu

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

I’ve posted more information here (I think it would be more readable than if I were to just copy and paste it here): https://stackoverflow.com/questions/62009497/tensorflow-sees-gpu-but-only-uses-xla-cpu-and-crashes-when-told-to-use-xla-gpu

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (4 by maintainers)

Most upvoted comments

Is there any other information I can provide that could help with this bug?

Have you solved this issue? I have the same problem.