Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load dynamic library 'cudart64_101.dll' #40804

Closed
GhassenBenMakhlouf opened this issue Jun 25, 2020 · 11 comments
Closed

Could not load dynamic library 'cudart64_101.dll' #40804

GhassenBenMakhlouf opened this issue Jun 25, 2020 · 11 comments
Assignees
Labels

Comments

@GhassenBenMakhlouf
Copy link

GhassenBenMakhlouf commented Jun 25, 2020

System information

  • Windows 10
  • Laptop: Asus gl553vw
  • TensorFlow installed with pip
  • tensorflow-gpu 2.2.0
  • Python 3.8.3
  • CUDA version 10.1 (update2)
  • cudnn-10.1-windows10-x64-v7.6.5.32
  • Nvidia GTX 960M

I want to use tensorflow with GPU but I keep receiving this error Could not load dynamic library 'cudart64_101.dll' when I import Tensorflow.

the output of `pip list`:
Package                  Version
------------------------ -----------
absl-py                  0.9.0
astunparse               1.6.3
cachetools               4.1.0
certifi                  2020.6.20
chardet                  3.0.4
gast                     0.3.3
google-auth              1.18.0
google-auth-oauthlib     0.4.1
google-pasta             0.2.0
grpcio                   1.30.0
h5py                     2.10.0
idna                     2.9
Keras-Preprocessing      1.1.2
Markdown                 3.2.2
numpy                    1.19.0
oauthlib                 3.1.0
opt-einsum               3.2.1
pip                      19.2.3
protobuf                 3.12.2
pyasn1                   0.4.8
pyasn1-modules           0.2.8
requests                 2.24.0
requests-oauthlib        1.3.0
rsa                      4.6
scipy                    1.4.1
setuptools               41.2.0
six                      1.15.0
tensorboard              2.2.2
tensorboard-plugin-wit   1.6.0.post3
tensorflow-gpu           2.2.0
tensorflow-gpu-estimator 2.2.0
termcolor                1.1.0
urllib3                  1.25.9
Werkzeug                 1.0.1
wheel                    0.34.2
wrapt                    1.12.1
the output of `pip debug --verbose`:
pip version: pip 19.2.3 from c:\users\ghassen\downloads\lisadetection\lisadetection\venv2\lib\site-packages\pip (python 3.8)
sys.version: 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
sys.executable: c:\users\ghassen\downloads\lisadetection\lisadetection\venv2\scripts\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp1252
sys.platform: win32
sys.implementation:
  name: cpython
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Compatible tags: 15
  cp38-cp38-win_amd64
  cp38-none-win_amd64
  py3-none-win_amd64
  cp38-none-any
  cp3-none-any
  py38-none-any
  py3-none-any
  py37-none-any
  py36-none-any
  py35-none-any
  py34-none-any
  py33-none-any
  py32-none-any
  py31-none-any
  py30-none-any

For import tensorflow as tf this is the output:

2020-06-24 14:50:11.230153: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-06-24 14:50:11.236957: 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.
and for `tf.test.is_gpu_available()` the output is: ``` WARNING:tensorflow:From :1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version. Instructions for updating: Use `tf.config.list_physical_devices('GPU')` instead. 2020-06-24 14:51:00.146205: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-06-24 14:51:00.171655: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x21868deee70 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-06-24 14:51:00.182635: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2020-06-24 14:51:00.190956: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll 2020-06-24 14:51:01.031439: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:01:00.0 name: GeForce GTX 960M computeCapability: 5.0 coreClock: 1.176GHz coreCount: 5 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 74.65GiB/s 2020-06-24 14:51:01.045344: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2020-06-24 14:51:01.051842: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found 2020-06-24 14:51:01.058515: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found 2020-06-24 14:51:01.065241: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found 2020-06-24 14:51:01.072266: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found 2020-06-24 14:51:01.080353: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found 2020-06-24 14:51:01.087954: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found 2020-06-24 14:51:01.095638: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] 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... 2020-06-24 14:51:01.186835: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-06-24 14:51:01.194906: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 2020-06-24 14:51:01.198498: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N 2020-06-24 14:51:01.206694: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x21876e35be0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2020-06-24 14:51:01.214517: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 960M, Compute Capability 5.0 False ```
@reedwm
Copy link
Member

reedwm commented Jun 25, 2020

@chsigg any ideas?

@reedwm reedwm assigned chsigg and unassigned reedwm and Saduf2019 Jun 25, 2020
@Marxvans
Copy link

Marxvans commented Jul 7, 2020

I solve this problem by cd into the folder of anaconda,and find cudart64_101.dll, copy it into c:/window/system32

@Ramesh-X
Copy link

For me also, it worked after I copied the dll file to the System32 folder. Every CUDA related directory is in the PATH but still didn't work until I copy it to the System32.

But is there any way of doing that without copying every dll file..?

I'm using Python3.8 from Windows Store.
CUDA 10.1 Update 2.
Tensorflow was installed using pip inside a virtualenv.

@Ramesh-X
Copy link

Ramesh-X commented Aug 10, 2020

For me, the problem was the python installation.
Don't use the python from the windows. Download the python installation file from the official site.

After that I configured my python environment again, now it is working like a charm.. ☺️

@Saduf2019
Copy link
Contributor

@GhassenBenMakhlouf
Is this still an issue.

@GhassenBenMakhlouf
Copy link
Author

@Saduf2019
Yes, when I copy it into c:/window/system32, it solves the problem.
Actually I had to copy all these files into c:/window/system32, otherwise my script won't use GPU:

  • cublas64_10.dll
  • cublasLt64_10.dll
  • cudart64_101.dll
  • cudnn64_7.dll
  • cufft64_10.dll
  • curand64_10.dll
  • cusolver64_10.dll
  • cusparse64_10.dll
  • nvcuda.dll

This is a dirty solution, I hope you find a better one.

@Saduf2019 Saduf2019 self-assigned this Sep 8, 2020
@Saduf2019
Copy link
Contributor

@GhassenBenMakhlouf
As confirmed this solves the problem, please feel free to move this issue to closed status.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@Yangwenchao1998
Copy link

@Saduf2019
Yes, when I copy it into c:/window/system32, it solves the problem.
Actually I had to copy all these files into c:/window/system32, otherwise my script won't use GPU:

  • cublas64_10.dll
  • cublasLt64_10.dll
  • cudart64_101.dll
  • cudnn64_7.dll
  • cufft64_10.dll
  • curand64_10.dll
  • cusolver64_10.dll
  • cusparse64_10.dll
  • nvcuda.dll

This is a dirty solution, I hope you find a better one.

Download CUDA and cuDNN from NVIDIA, and try again.

@rednag
Copy link

rednag commented Feb 26, 2021

I've installed CUDA Toolkit 11.2.135 already, but I'm having the same issue. I've tried downloading an other version, but NVIDIA driver says the installed is newer than the downloaded - so?!

@LeoJuh
Copy link

LeoJuh commented Sep 4, 2021

I solve this problem by cd into the folder of anaconda,and find cudart64_101.dll, copy it into c:/window/system32

This worked for me, thank you!

@tensorflow tensorflow locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants