Help needed: TensorFlow Not detecting my GPU

Good Morning All,

I have installed multiple versions of TensorFlow and multiple versions of CUDA and cuDNN and I am unable to successfully install TensorFlow with GPU Support.
I have scoured Google and ChatGPT for help and all the tutorials are basically the same. Find and use the most current versions of TensorFlow and CUDA that are approved for each other.

I am obviously doing something wrong. I have installed CUDA and cuDNN and I can see the dll’s in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8.

I have added the directories to my System Path variable. No Matter what I try, I cannot get the system to recognize my installation.
Here is the output of a Python script to display the system and installation versions. As you can see, it does not find cuDNN.
Would anyone offer any procedural changes that would enable the recognition of cuDNN?

Operating System: Windows 11 10.0.22631 AMD64

CPU: AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
CPU Model: AMD Ryzen Threadripper 2970WX 24-Core Processor
Number of Cores: 24
Number of Logical Processors: 48

Installed RAM: 127.88 GB

GPU: NVIDIA GeForce RTX 3070, Total Memory: 8192 MB

Installed CUDA Versions:

cuDNN is not installed.

Python Version: 3.12.2

TensorFlow Version: 2.16.1


Welcome @Ron_Barnes to the TensorFlow Forum.

Unfortunately as it is clearly stated here :

Caution: TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11, you will need to install TensorFlow in WSL2, or install tensorflow or tensorflow-cpu and, optionally, try the TensorFlow-DirectML-Plugin

Ah - Thank you!
I will try one of those options

1 Like

Do yourself a favor and use Torch.

Read Here

I only use TF because I want to reproduce some github code written in TF. TF makes you hate your life.

1 Like

Why do you say that?

I have only good things to report about TF. GNN, DF (via Yggdrasil Decision Forests) and a whole bunch of TF goodness including TFJS and TF Lite - awesome toolset.

Yes you need WSL2 to run with GPU.

1 Like

Apart from things you can read here, I have faced so many irregularities with the incompatibilities of Tensorflow, their new commands for installations that are not clearly communicated (e.g., I still don’t understand why I had to write pip install tensorflow[and-cuda], while last year I did not need to do that.

I faced an enormous amount of technical problems, such as missing .dll files from cuda libraries.

Of course, having all the computer knowledge required to use it makes it better, but given that:

  1. Pytorch took 1/20th of the time to make it work
  2. People are working in interdisciplinary settings (i.e., I’ve seen doctors needing to train neural networks nowadays), therefore it’s not a given that they know everything about the intricacies of Docker, conda, cuda, WS2, nor that time is in their favor —> more streamlined processes for installations should be prioritized. But I guess it’s happening already. Everyone tells me to avoid TF, I just use it when I need to reproduce code I clone from github

Thanks for sharing. I can relate to your frustration. Native Windows is challenging for the TF team to support given their limited resources. Hence them moving to WSL2 is understandable because it’s the best of both worlds, being both a Linux environment and having access to the GPU. The other option would be to boot direct from Linux from say an external SSD.

For professionals coming from other fields who have to work with neural nets Collab would be a quick option. Nothing to fuss about. And if you have the budget and need performance, TPUs are a great choice.

Overall, the best environment to run TF with GPU support is on Linux x86-64 with the appropriate drivers installed.

@Simon_Au-Yong regarding TensorFlow installation for Linux OS:

Even if you pip install tensorflow[and-cuda] you still have some additional steps to make in order to utilize your GPU. More specifically, you should appropriately configure environment variables ($LD_LIBRARY_PATH and $PATH). For more details see the respective open issue submitted from Mar 10 and the respective pull request created on April 8 and still pending review.

1 Like

Exactly the same feeling. When you update PyTorch, it only needs one line of command. However, when it comes to TensorFlow, the huge differences between versions (minor versions of TF2) make it hard to succeed.
The time I try to update TF from 2.10 to 2.16, I need to install WSL2, and then config CUDA, and then try to adapt the minor incompatibility between the dependency packages. Oh my god! Though the project finally runs, I give up.

1 Like