Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU not detected / tf.test.is_built_with_cuda returns False #47147

Closed
carlmwilson opened this issue Feb 14, 2021 · 4 comments
Closed

GPU not detected / tf.test.is_built_with_cuda returns False #47147

carlmwilson opened this issue Feb 14, 2021 · 4 comments
Assignees
Labels
comp:gpu GPU related issues TF 2.3 Issues related to TF 2.3 type:support Support issues

Comments

@carlmwilson
Copy link

Please go to Stack Overflow for help and support:

https://stackoverflow.com/questions/tagged/tensorflow

If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with the
    documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.
  3. It shouldn't be a TensorBoard issue. Those go
    here.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • Have I written custom code (as opposed to using a stock example script
    provided in TensorFlow)
    : N/A
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue
    happens on a mobile device
    : N/A
  • TensorFlow installed from (source or binary): conda
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.8.5 [Anaconda 2020.11]
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: 10.1 / 7.6.4 [graphics driver 461.40]
  • GPU model and memory: GeForce RTX 3080 / 10GB [EVGA Black]
  • Exact command to reproduce: import tensorflow as tf, tf.test.is_built_with_cuda()

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with:

python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the problem

-Installed MSVS 2019 Community Edition
-Installed Cuda Toolkit 10.1 [in preparation for TensorFlow 2.3.0 from conda]. NOTE: Did custom installation, not installing the graphics or physics drivers as I already have the most up to date drivers.
-Installed / copied drivers across from cuDNN 7.6.4
-Installed Anaconda 2020.11
-Created environment and installed TensorFlow-GPU [conda create -n tf-gpu tensorflow-gpu]
-Activated tf-gpu environment [conda activate tf-gpu]
-started python [python]
-imported tensorflow [import tensorflow as tf]
-checked installation [tf.test.is_built_with_cuda()]
returns False
-checked for GPU [tf.config.list_physical_devices('GPU')
returns []

I'm not sure what I'm missing or doing wrong during the installation. I don't have the CPU only tensorflow installed. Is it because I am not installing the graphics drivers with CUDA Toolkit? Any help is much appreciated.

Source code / 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. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

@carlmwilson carlmwilson added the type:build/install Build and install issues label Feb 14, 2021
@carlmwilson
Copy link
Author

As an update I ran the deviceQuery program and CUDA seems to be able to see by GPU; but tensorflow doesn't?

C:\Users\XXXX>cd C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\demo_suite

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\demo_suite>deviceQuery.exe
deviceQuery.exe Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce RTX 3080"
CUDA Driver Version / Runtime Version 11.2 / 10.1
CUDA Capability Major/Minor version number: 8.6
Total amount of global memory: 10240 MBytes (10737418240 bytes)
MapSMtoCores for SM 8.6 is undefined. Default to use 64 Cores/SM
MapSMtoCores for SM 8.6 is undefined. Default to use 64 Cores/SM
(68) Multiprocessors, ( 64) CUDA Cores/MP: 4352 CUDA Cores
GPU Max Clock rate: 1710 MHz (1.71 GHz)
Memory Clock rate: 9501 Mhz
Memory Bus Width: 320-bit
L2 Cache Size: 5242880 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: zu bytes
Total amount of shared memory per block: zu bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: zu bytes
Texture alignment: zu bytes
Concurrent copy and kernel execution: Yes with 5 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: No
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.2, CUDA Runtime Version = 10.1, NumDevs = 1, Device0 = GeForce RTX 3080
Result = PASS

@amahendrakar
Copy link
Contributor

@deepLearner84,
Please try installing TensorFlow v2.4 with CUDA 11.0 and cuDNN 8 as mentioned in the tested build configurations and check if you are facing the same issue.

Version Python version Compiler Build tools cuDNN CUDA
tensorflow_gpu-2.4.0 3.6-3.8 MSVC 2019 Bazel 3.1.0 8.0 11.0
tensorflow_gpu-2.3.0 3.5-3.8 MSVC 2019 Bazel 3.1.0 7.6 10.1
tensorflow_gpu-2.2.0 3.5-3.8 MSVC 2019 Bazel 2.0.0 7.6 10.1

Thanks!

@amahendrakar amahendrakar added comp:gpu GPU related issues stat:awaiting response Status - Awaiting response from author TF 2.3 Issues related to TF 2.3 type:support Support issues and removed type:build/install Build and install issues labels Feb 15, 2021
@carlmwilson
Copy link
Author

@amahendrakar Thank you for your quick response, this has resolved the issue. What had I done wrong? My understanding was that cuDNN 7.6 / CUDA 10.1 was the tested build configuration for tensorflow 2.3.0? Cheers

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Feb 17, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:gpu GPU related issues TF 2.3 Issues related to TF 2.3 type:support Support issues
Projects
None yet
Development

No branches or pull requests

4 participants