33

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?

talonmies
  • 70,661
  • 34
  • 192
  • 269
Alex Zaitsev
  • 2,544
  • 5
  • 18
  • 27
  • Sounds like it should be able to find it. Check out the `PATH` that the Python interpreter is seeing in `os.environ['PATH']` (in Python 3 you can read it more easily with `import os; print(*os.environ['PATH'].split(';'), sep='\n')`). If you have just changed the environment variables, you may need to open a new command line or even restart the system. – jdehesa Aug 16 '19 at 17:06
  • @jdehesa, thanks for you comment. I did system restart, that didn't help me. Also I have `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin` in `os.environ['PATH']` – Alex Zaitsev Aug 16 '19 at 18:01
  • https://download.mersenne.ca/CUDA-DLLs/CUDA-10.0 In this link you find cudart64_100.dll file. just download it and paste in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin . Your Problem will be solved . InshaAllah. – Humza Ismail Jan 11 '20 at 21:12
  • Fixing this leads to another error - `Could not find 'cudnn64_7.dll'`, [here's an answer with all the steps](https://stackoverflow.com/a/65524506/38368). – Danny Varod Dec 31 '20 at 18:41
  • Find my solution to a similar issue [here](https://stackoverflow.com/a/74370496/10477257) – surendra Allam Nov 10 '22 at 06:07
  • It's old, but to be correct the link displayed here is the one for CUDA 9.0. The correct one for CUDA 10.0 is here: https://developer.nvidia.com/cuda-10.0-download-archive. Thanks anyway, your question helped solve my problem. – Ando Jurai Jun 13 '23 at 21:27

10 Answers10

15

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/

jjj
  • 2,594
  • 7
  • 36
  • 57
  • 5
    The most usefull comment regarding TF2.0 state as of Jan2020. Such a disgrace that TF crashes due to cudart64_101.dll not being cudart64_100.dll. (both CUDA 10.1). – Bear Jan 23 '20 at 15:36
  • Note that Tensorflow 2.1–2.2 supports CUDA 10.1 and not 10.2. Not quite the latest CUDA. – mic May 20 '20 at 17:21
12

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")
munney
  • 121
  • 1
  • 3
  • Sad that this ended up being the solution -- but this was the only solution that worked in my case. Reinstalls, restarts, etc. all failed – Zachary Canann Dec 08 '19 at 01:51
  • How come this has to be the fix? Shouldn't Tensorflow automatically do something like this? How could I get a more permanent solution? – Jake Armstrong Sep 10 '20 at 02:42
  • This solution was the only one that worked for me as well. I had to include all my DLL files like this. I was using the python version installed from the Windows Store... after uninstalling it and installing Python from python.org, I no longer had to include the WinDLL statements. – Chacal Mar 14 '21 at 01:24
6

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!!!

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Cibi SL
  • 61
  • 2
  • 6
  • download cudart64_101.dll, cudart32_101.dll --> https://download.mersenne.ca/CUDA-DLLs/CUDA-10.1 – Carson Apr 14 '20 at 08:26
2

*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

nstoichkov
  • 41
  • 1
  • 4
1

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.

Andi Schroff
  • 1,156
  • 1
  • 12
  • 18
1

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
yaya
  • 7,675
  • 1
  • 39
  • 38
1

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

0

Just rename

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

to cudart100.dll

Dharman
  • 30,962
  • 25
  • 85
  • 135
Joe
  • 17
  • 1
  • 3
    This doesn't really work. It seems to load but there are run time errors later. Better downgrade to 10.0 instead. – Joe Dec 10 '19 at 00:37
0

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

Hardy
  • 19
  • 1
  • 4
0

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.

David C.
  • 777
  • 8
  • 18