tensorflow
tensorflow copied to clipboard
Could not load library cudnn_cnn_infer64_8.dll. Error code 126
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
2.10.0
Custom code
No
OS platform and distribution
windows 10
Mobile device
No response
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.
Error
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!
Output
Standalone code to reproduce the issue
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}")
Relevant log 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
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>
Hi @Tanishq-JM , Sorry for the dealy, Confirm that TensorFlow-GPU is installed correctly by running a simple GPU-enabled TensorFlow script. You can use the following code snippet to check if TensorFlow can detect and use your GPU:
import tensorflow as tf
print("Num GPUs Available:", len(tf.config.experimental.list_physical_devices('GPU')))
If this script doesn't detect your GPU, there may be underlying issues with your TensorFlow installation or GPU setup.
Here i am providing the documentation how to install. Please go through it once.
Here i am providing updated gist with some corrections for your reference. Please check this too.
Thank you!
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
Hi @Venkat6871 Thank you for your time , i am still facing same issue and now i think i would go for the google colab instead it would me more easy for me to maintain and run it . Thank you for your time and kind support 😃.
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 you!
Hello I am still facing this issue
Hi @Tanishq-JM ,
- Here you are using old version(2.10.0). Could you please try to upgrade latest version(2.16.1) and starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin. Thank you!
Hi @Tanishq-JM ,
- Here you are using old version(2.10.0). Could you please try to upgrade latest version(2.16.1) and starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin. Thank you!
Ok sir i will try and let you know as soon as possible
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.