tensorflow 无法加载动态库“cudnn64_8.dll”; dlerror:找不到cudnn64_8.dll文件

6kkfgxo0  于 2022-11-25  发布在  其他
关注(0)|答案(7)|浏览(658)

使用tensorflow 2.4.1
当我运行我的程序时,我得到这个错误,不能使用我的gpu
我使用的是CUDA 11.0cudnn 8.0

  1. 2021-02-07 03:36:18.132005: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
  2. WARNING:tensorflow:From D:/PycharmProjects/pythonProject/models/kpş,i.py:5: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
  3. Instructions for updating:
  4. Use `tf.config.list_physical_devices('GPU')` instead.
  5. 2021-02-07 03:36:19.735127: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
  6. To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
  7. 2021-02-07 03:36:19.739052: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll
  8. 2021-02-07 03:36:20.715634: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
  9. pciBusID: 0000:01:00.0 name: GeForce GTX 1650 computeCapability: 7.5
  10. coreClock: 1.56GHz coreCount: 16 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 119.24GiB/s
  11. 2021-02-07 03:36:20.716281: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
  12. 2021-02-07 03:36:20.723519: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
  13. 2021-02-07 03:36:20.724040: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
  14. 2021-02-07 03:36:20.729436: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
  15. 2021-02-07 03:36:20.731800: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
  16. 2021-02-07 03:36:20.741580: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusolver64_10.dll
  17. 2021-02-07 03:36:20.745576: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
  18. 2021-02-07 03:36:20.746657: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
  19. 2021-02-07 03:36:20.746971: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1757] 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.
  20. Skipping registering GPU devices...
  21. 2021-02-07 03:36:20.836861: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
  22. 2021-02-07 03:36:20.837144: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0
  23. 2021-02-07 03:36:20.837314: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N
  24. 2021-02-07 03:36:20.837493: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
gc0ot86w

gc0ot86w1#

我想我可以帮助您提供一个cudnn64_8.dll文件(这是下载链接:https://www.dll-files.com/cudnn64_8.dll.html),当你得到这个文件的时候,你可以直接放在你的bin目录下,比如通常在windows平台下,你可以放在C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin下。

ecr0jaav

ecr0jaav2#

丢失的dll文件位于cuDNN文件夹中。我能够通过将cudnn64_8.dll文件复制到CUDA文件夹中来解决这个问题,即C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
cuDNN被列为TensorFlow工作的一个要求,你可以下载它here。不过你需要先注册一个开发者帐户。

eqzww0vc

eqzww0vc3#

观看video来解决这个问题,
由于CUDA文件夹中缺少Microsoft Visual Studio C++可复制文件,因此会出现找不到此文件错误。
附加;
对于PyTorch in conda environment,没有额外的CUDA和Cudnn安装,因为在键入conda install pytorch之后,conda会将CUDA和Cudnn安装到该conda环境中。

tcomlyy6

tcomlyy64#

我在按照CuDNN的所有安装说明安装之后也遇到了这个问题。问题的根本原因非常简单。在安装说明中,它告诉你将<root>\NVIDIA\CUDNN\v8.x添加到你的PATH。至少对于Tensorflow来说,这是错误的。你需要将<root>\NVIDIA\CUDNN\v8.x\bin添加到你的PATH。这应该可以解决这个问题。它对我来说是这样的。
我看到了一些关于将cudnn64_8.dll文件移动到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin的答案。之所以这样做是因为CUDA会在安装PATH时自动将bin目录添加到您的PATH中。因此,将cudnn64_8.dll移动到那里实际上会将其添加到您的PATH中。
我宁愿把东西放在合适的位置,所以我更喜欢这样。

qvsjd97n

qvsjd97n5#

我也遇到了这个错误,我发现cudnn需要一个不同的安装。这里有一个安装指南和需要的包https://developer.nvidia.com/cudnn
*edit -〉在上面的链接中,您可以下载tensorflow需要的cuddn版本,然后将它们放在所需的文件夹中,这将解决您的问题。

6tr1vspr

6tr1vspr6#

这将解决您的问题:

  1. conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
ukdjmx9f

ukdjmx9f7#

我遇到了同样的错误。this link中提出的解决方案对我有效。他们提出安装cuDNN并解释如何安装here
对我个人来说,我们最重要的解释是ZLIB(或者更具体地说是Zlibwapi),我通过Anaconda安装了它。

相关问题