Could not load library cudnn_cnn_infer64_8.dll. Error code 126
Hi **@Tanishq-JM** ,

Update GPU drivers: 
Ensure that you have the latest NVIDIA drivers installed for your gpu(Nvidia Quadro T2000). You can download the latest drivers from the NVIDIA website and follow the installation instructions.

Check CUDA and cuDNN installation:
Make sure that CUDA and cuDNN are installed correctly and that the paths to their binaries are included in your system's PATH environment variable.

Verify TensorFlow installation: 
Reinstall TensorFlow using pip to ensure that it's correctly installed and compatible with your system configuration. You can do this by running:
```
pip install --upgrade tensorflow
```
Here i am providing [gist](https://colab.sandbox.google.com/gist/Venkat6871/64bb3ffc5bf441523b308f8e5444cd0c/63455_2-15-v.ipynb) for your reference, Once go through it.

Thank you!

 # Thank You @Venkat6871 for your guidance i installed VS and Nvidia graphic drivers .
But The problem is still there when i am using another version of tensorflow it uses CPU instead  but TF 2.1 needs some .dll file and its unable to access it .

#code 
`import tensorflow as tf
import subprocess
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

def get_gpu_info():
    try:
        result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE)
        return result.stdout.decode('utf-8')
    except FileNotFoundError:
        return "nvidia-smi not found. Make sure NVIDIA drivers are installed."

from keras import layers, models, datasets
import time

(train_images, train_labels), (_, _) = datasets.mnist.load_data()
train_images = train_images.reshape(-1, 28, 28, 1).astype('float32') / 255.0
model = models.Sequential([
    layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(64, (3, 3), activation='relu'),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(64, (3, 3), activation='relu'),
    layers.Flatten(),
    layers.Dense(64, activation='relu'),
    layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

start_time = time.time()
end_time = start_time + 30

while time.time() < end_time:
    gpu_info = get_gpu_info()
    print(gpu_info)

model.fit(train_images, train_labels, epochs=1, batch_size=64, verbose=0)
loss, accuracy = model.evaluate(train_images, train_labels, verbose=0)
print(f"Loss: {loss}, Accuracy: {accuracy}")
`

# Output : 


(ML) PS D:\python> & d:/python/ML/Scripts/python.exe d:/python/test.py
2024-03-14 11:50:53.845372: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-14 11:50:55.378833: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1616] Created device /device:GPU:0 with 2128 MB memory:  -> device: 0, name: Quadro T2000, pci bus id: 0000:01:00.0, compute capability: 7.5
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 12036372220610172862
xla_global_id: -1
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 2232156160
locality {
  bus_id: 1
  links {
  }
}
incarnation: 1063671899388078998
physical_device_desc: "device: 0, name: Quadro T2000, pci bus id: 0000:01:00.0, compute capability: 7.5"
xla_global_id: 416903419
]
2024-03-14 11:50:55.686954: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1616] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 2128 MB memory:  -> device: 0, name: Quadro T2000, 
pci bus id: 0000:01:00.0, compute capability: 7.5
Thu Mar 14 11:50:55 2024  

![image](https://github.com/tensorflow/tensorflow/assets/138287162/07545d1a-8795-496d-a2eb-f3f2ecec31b9)



2024-03-14 11:50:57.159136: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8600
Could not load library cudnn_cnn_infer64_8.dll. Error code 126
Please make sure cudnn_cnn_infer64_8.dll is in your library path!
(ML) PS D:\python>

Here in the Photo is showing a process is present and there is some GPU getting used at start .

# where i am doing mistake ?

> ` Environment variables  `
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\extras\CUPTI\lib64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\extras\CUPTI\include
D:\Tanishq games\google install\New folder\cuda\bin
D:\Tanishq games\google install\New folder\cuda\include

>` Cuda == 11.2 and cudnn == 8.1 (11.2)`
 Hi **@Tanishq-JM** ,
-Could you please confirm if this issue is resolved for you ? Please feel free to close the issue if it is resolved.

Thank ypu!
### Issue type
bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.10.0

### Custom code

Yes

### OS platform and distribution

windows 10

### Mobile device

Thinkpad p53

### Python version

3.10

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

11.2 / 11.2(8.1 I think)

### GPU model and memory

Nvidia T2000 4GB

### Current behavior?

# Problem :
I expect this problem to be resolved soon. I am unable to use my GPU for training, as it remains at 0% usage. When I try another version, it only uses my CPU, which takes days and causes my computer (laptop) to overheat.

`python code `

import tensorflow as tf
import subprocess
physical_devices = tf.config.list_physical_devices('GPU')
print("Num GPUs Available:", len(physical_devices),physical_devices)
print(f"tensor version : {tf.__version__}")

def get_gpu_info():
    try:
        result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE)
        return result.stdout.decode('utf-8')
    except FileNotFoundError:
        return "nvidia-smi not found. Make sure NVIDIA drivers are installed."

gpu_info = get_gpu_info()
print(gpu_info)

if physical_devices:
    for i, gpu in enumerate(physical_devices):
        print("GPU", i, physical_devices,":", gpu)

from keras import layers, models, datasets
import time
import os

(train_images, train_labels), (_, _) = datasets.mnist.load_data()
train_images = train_images.reshape(-1, 28, 28, 1).astype('float32') / 255.0

model = models.Sequential([
    layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(64, (3, 3), activation='relu'),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(64, (3, 3), activation='relu'),
    layers.Flatten(),
    layers.Dense(64, activation='relu'),
    layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

start_time = time.time()
end_time = start_time + 30

while time.time() < end_time:
    model.fit(train_images, train_labels, epochs=1, batch_size=64, verbose=0)

loss, accuracy = model.evaluate(train_images, train_labels, verbose=0)
print(f"Loss: {loss}, Accuracy: {accuracy}")

# environment variables
![image](https://github.com/tensorflow/tensorflow/assets/138287162/8c705629-b380-445e-85bd-63c52b1a0827)

all the libs are copy and pasted already in the bin and lib folder


### Standalone code to reproduce the issue

```shell
# Error
I am unable to utilize my NVIDIA Quadro T2000 GPU for training, as it remains at 0% usage. Additionally, when I attempt to use a different version, I encounter the following error: "Could not load library cudnn_cnn_infer64_8.dll. Error code 126. Please make sure cudnn_cnn_infer64_8.dll is in your library path." This forces the training to use only my CPU, which is inefficient and causes my laptop to overheat. Despite having a good GPU (NVIDIA Quadro T2000), Intel Core i7 9th Gen processor, and 32GB of RAM, I am unable to leverage my GPU for training. I have already tried setting up the environment variables and other dependencies, as well as using CUDA 11.2 with cuDNN 8.1.
```


### Relevant log output

```shell
d:/python/test.py
Num GPUs Available: 1 [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
tensor version : 2.10.0
Tue Mar 12 03:11:23 2024       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 529.08       Driver Version: 529.08       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro T2000       WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   39C    P8     3W /  30W |      0MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

GPU 0 [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] : PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')
Could not load library cudnn_cnn_infer64_8.dll. Error code 126
Please make sure cudnn_cnn_infer64_8.dll is in your library path!
```
