Home > Back-end >  Trying to use tensorflow with GPU but got "Could not load dynamic library 'cudart64_110.dl
Trying to use tensorflow with GPU but got "Could not load dynamic library 'cudart64_110.dl

Time:11-16

I'nm new to the tensorflow and I'm trying to train a CNN for image classification. Here is the error I got:

2022-11-15 11:18:50.087877: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-11-15 11:18:50.088548: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
nd
2022-11-15 11:19:04.824435: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found2022-11-15 11:19:04.824617: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found2022-11-15 11:19:04.824783: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found      
2022-11-15 11:19:04.825030: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found2022-11-15 11:19:04.825218: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found2022-11-15 11:19:04.825408: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found      
2022-11-15 11:19:04.825483: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1934] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.Skipping registering GPU devices...

I do have GPU available and CUDA version is 11.2Here is what I got when I checking the CUDA version Here is my tf version

Tried to many methods but still not working, no idea waht's going on. Really appreciate for your help.

Followed the instruction on https://www.tensorflow.org/install/pip couple times.

CodePudding user response:

try 'nvidia-smi -L' I try and check with the compatibility matrix from the Nvidia website 515.43.04 (CUDA 11.7) CUDA and Driver compatibility

Version Python version Compiler Build tools cuDNN CUDA

2.10.0__ 3.7-3.10_______ GCC 9.3.1 Bazel 5.1.1 __ 8.1_ _ 11.2

  1. Download https://bootstrap.pypa.io/pip/2.7/get-pip.py
  2. python get-pip.py
  3. Install MSYS2 : https://www.tensorflow.org/install/source_windows#install_msys2
  4. Install Visual C Build Tools 2019 : https://www.msys2.org/

____________Pre-Installation: Add this to system PATH

____________a. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin

____________b. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\extras\CUPTI\lib64

____________c. F:\msys64\mingw64\bin

____________d. F:\msys64\usr\bin

  1. python3 -m pip install --upgrade pip
  2. python3 -m pip install -U six numpy wheel packaging
  3. python3 -m pip install -U keras_preprocessing --no-deps
  4. python3 -m pip install tensorflow
  5. python3 -m pip install tensorflow-gpu

Ref[0]: Tensorflow install

CodePudding user response:

my problem just solved. Did couple research and find the problem might caused by installing Tensorflow with cmd. I solved the problem by download a "cudart64_110.dll" file from downoad link

1.unzip the file and get a "cudart64_110.dll" file.

  1. copy that file to C:\Windows\System32

This method works for me, hope anyone can find it helpful. Cheers.

  • Related