New TensorFlow(Compatible for GPU) Not Detecting GPU: CUDA 12.6, cuDNN, and Environment Variables Issues

I’m having trouble getting TensorFlow to recognize my GPU. Despite following several guides, TensorFlow still reports no GPUs available. Here are the details of my setup and the issue:

System Information:

Operating System: Windows 11 Home

GPU: NVIDIA GeForce RTX 4070 Laptop GPU

NVIDIA Driver Version: 560.81

CUDA Version: 12.6

cuDNN Version: 9.3.0

 !nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Fri_Jun_14_16:44:19_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.20
Build cuda_12.6.r12.6/compiler.34431801_0



  !nvidia-smi
Wed Aug 14 09:18:01 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.81                 Driver Version: 560.81         CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                  Driver-Model | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4070 ...  WDDM  |   00000000:01:00.0 Off |                  N/A |
| N/A   51C    P3             13W /   55W |       0MiB /   8188MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

    import tensorflow as tf

2024-08-14 09:18:06.027008: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-08-14 09:18:06.960623: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.

gpus = tf.config.list_physical_devices('GPU')

print("Available GPUs: ", gpus)
Available GPUs:  []

I looking for a solution since i bought this RTX 4070.Hope someone help me

3 Likes

Hello, I am having the same issue with my rtx 3060. Nvidia-smi shows the GPU, however tensorflow did not find it: GPU [ }. Did you solve your prloblem?

I have the same problem with a RTX4080 Cuda version 12.6. Any suggestions?

the same issue, tensorflow v2.18.0, CUDA v12.6, cuDNN v9.5, GPU RTX 3050 Laptop.
Is it because I didn’t use the gpu version of tensorflow?

I have the same issue too! I am using windows 11, python version 3.10, I had tried a lot version of CUDA and the CUDNM it still couldnt able to find the GPU too. Is it possible was due too the windows 11?

I’m not sure😂please tell me why when you find out the solution. Thanks!