tensorflowgpunvidiacudnn

TensorFlow 2.16.2 does not detecting my GPU


I got RTX 4060 with driver 560.76. I installed CUDA 11.8 and copied cuDNN 8.9.7. files to the correct directories in the CUDA installation folder. I added the right paths to the System variables Environment. Finally, I installed Tensorflow 2.16.2.

When I run the code below I got no GPU detection:

print("Num GPUs Available: ", len(tf.config.list_physical_devices(‘GPU’)))

What am I doing wrong?


Solution

  • Actually, from TensorFlow 2.11 and newer versions do not have anymore native support for GPUs on Windows, so everything was okay from your side. See from the TensorFlow website:

    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-cpu and, optionally, try the TensorFlow-DirectML-Plugin.

    From TensorFlow 2.11 onwards, to get GPU support on Windows, you need to use WSL2 or if you don't want to use WSL(Windows Subsystem for Linux), use older version of TensorFlow that supports native GPU on Windows.