Alex Zaitsev
Alex Zaitsev

Reputation: 2766

ImportError: Could not find 'cudart64_100.dll

I'm trying to install tensorflow-gpu==2.0.0-beta1 on my Windows 10 machine and got this error:

ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive

I made all things from:

But error still occurs

How can I fix this?

Upvotes: 34

Views: 84820

Answers (10)

surendra Allam
surendra Allam

Reputation: 61

Renaming the libraries might find a way to solve this issue, but that is not advised, as the root cause for this issue is due to version mismatch of CDNN and cuDNN. It's advised to install the right CDNN and cuDNN versions.

I too have faced similar issues and realized that the issue was with CUDA and CUDNN version mismatch.

Can refer here for the proper CDNN and cuDNN versions. From the reference below for TensorFlow 2.4.0 it is recommended to use CUDA 11.0 and cuDNN 8.0. CUDA & CUDNN reference for TensorFlow

Or you can refer here to download cuDNN for suitable CUDA. cuDNN for CUDA

Upvotes: 1

nstoichkov
nstoichkov

Reputation: 61

*EDIT
Every Tensorflow version requires a specific version of CUDA. The easiest way is to open https://www.tensorflow.org/install/gpu and read which version did you need.

ex. CUDA® Toolkit —TensorFlow supports CUDA® 11.2 (TensorFlow >= 2.5.0)

If you want to install Tensor Flow v 2.5.0 you must have exactly CUDA v 11.2 installed.

TensorFlow 2.2 try to import cudart64_101.dll, cusparse64_10.dll and cublas64_10.dll but they are part from CUDA 10.1 If you have OTHER cuda version will get ImportError: Could not find 'cudart64_100.dll as this files are only available in cuda 10.1.

If you want to use older tensorflow version you have to use it with appropriate cuda version

Upvotes: 2

yaya
yaya

Reputation: 8243

The actual fix is to download and install CUDA Toolkit

But if you're in hurry, you can also disable gpu, before importing tensorflow.

import os
# BAD IDEA ::::: Disabling gpu . The actual fix is to download and install cuda toolkit.
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import tensorflow as tf

Upvotes: 1

David C.
David C.

Reputation: 1001

NVidia maintains a download archive of older CUDA driver releases. I would recommend downloading the installer from here instead of a third-party archive:

https://developer.nvidia.com/cuda-toolkit-archive

That page has a link to a page for downloading version 10.0:

https://developer.nvidia.com/cuda-10.0-download-archive

For the CUDA-NN libraries, the archive may be found here:

https://developer.nvidia.com/rdp/cudnn-archive

You need to be a member of the NVidia developer program to access this archive, but it is free to sign-up.

There should be no problem installing multiple versions at once, since the CUDA installer uses a separate installation directory for each version and the library files have different names. You will, however, want to select a custom installation to avoid replacing your display drivers, since you're installing older versions.

The CUDA-NN libraries (at least for Windows) are distributed as zip files. Copy the contents where you would like them (I installed each as a subdirectory under the corresponding CUDA driver installation directory).

Finally, add all of the various CUDA and CUDA-NN directories to your PATH, if they aren't already there so Python and Tensorflow can find them.

Upvotes: 0

Hardy
Hardy

Reputation: 19

you can find the cudart64_100.dll file in this website link. and extract it, add cudart64_100.dll to your C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin after you run your python script you will see: Successfully opened dynamic library cudart64_100.dll

Upvotes: 0

Cibi SL
Cibi SL

Reputation: 61

I had similar error:

cudart64_101.dll not found

It is because the latest version of CUDA requires older CUDA-version.dll files to work properly. The solution would be try installing the previous version of CUDA.

Once you have downloaded CUDA 10.1 run the .exe file which will first extract the necessary files in C:\Users\your_user_name\AppData\Local\Temp\CUDA.

Once the extraction is completed do not proceed with the installation navigate to the directory C:\Users\your_user_name\AppData\Local\Temp\CUDA\cudart\bin and here you will find the missing DLL file cudart64_101.dll and cudart32_101.dll copy both the files to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin and then cancel the installation.

Follow the same steps for any CUDA version will work for sure. Hope this helps thank you!!!

Upvotes: 6

Andi Schroff
Andi Schroff

Reputation: 1334

I also was dealing with the current situation that tensorflow expects cudart64_101.dll and NVIDIA offers Version 10.2 as main version (including cudart64_102.dll).

I simply installed both versions. I have both versions in the windows path. Beside disc space, I did not have problems so far and GPU is used in tensorflow.

Upvotes: 1

Joe
Joe

Reputation: 17

Just rename

\program files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\cudart64_102.dll 

to cudart100.dll

Upvotes: 0

munney
munney

Reputation: 121

I have faced similar issue. I have added the directory of the cudart64_100.dll file to the PATH variable but still it prompts the error "cudart64_100.dll" not found. In the end I finally manage to make it work by adding the following codes. Hope it helps.

import ctypes

hllDll = ctypes.WinDLL("C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin\\cudart64_100.dll")

Upvotes: 12

jjj
jjj

Reputation: 2672

The simplest way to fix is to install the latest ‘NVIDIA GPU Computing Toolkit’, because if it's not there, you'll be missing the 'cudart64_100.dll' library. The only issue is that the latest copy of CUDA has this particular library upgraded to 'cudart64_101.dll', while the latest TensorFlow still requires the older 'cudart64_100.dll'. Anyways, one way to deal with this issue is to install the latest CUDA + CUDA from September 2018 and then copy 'cudart64_100.dll' library from old install to the new one.

Or just visit my site where I linked the 'cudart64_100.dll' library downloaded from the CUDA Toolkit 10.0 (Sept 2018), to make it easier to copy it into the latest CUDA directory.

Here are some screenshots to illustrate the process: https://www.joe0.com/2019/10/19/how-resolve-tensorflow-2-0-error-could-not-load-dynamic-library-cudart64_100-dll-dlerror-cudart64_100-dll-not-found/

Upvotes: 15

Related Questions