【问题标题】:Tensorflow GPU: Could not load dynamic library 'cudart64_110.dll'Tensorflow GPU:无法加载动态库 \'cudart64_110.dll\'
【发布时间】:2022-10-18 20:00:55
【问题描述】:

我正在尝试机器学习,为此我想使用我的 gpu。

完整的错误

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-09-28 20:46:10.458853: 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.
2022-09-28 20:46:15.734698: 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-09-28 20:46:15.735244: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2022-09-28 20:46:15.735713: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2022-09-28 20:46:15.736190: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2022-09-28 20:46:15.736661: 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-09-28 20:46:15.737111: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2022-09-28 20:46:15.737551: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2022-09-28 20:46:15.737998: 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-09-28 20:46:15.738241: 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...
2022-09-28 20:46:15.739282: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-09-28 20:46:15.776016: 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...

以下测试代码:

import tensorflow as tf
from tensorflow.python.client import device_lib
#import os
#os.add_dll_directory(r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin")

print(tf.add(1, 2))
print(tf.test.is_built_with_cuda())
print(tf.test.is_built_with_gpu_support())
print(tf.config.list_physical_devices('GPU'))
print(device_lib.list_local_devices())

结果是 :

tf.Tensor(3, shape=(), dtype=int32)
True
True
[]
2022-09-28 20:46:15.776016: 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...
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 8872492517262768871
xla_global_id: -1
]

我的系统

  • GTX GeForce 1650 Ti,应该对 CUDA 有好处

tensorflow安装后:https://www.tensorflow.org/install/pip

  • 我使用的是 C:\Program Files\NVIDIA GPU Computing Toolkit 中的 CUDA 11.2
  • cuDNNN 8.0.1,我从中复制了相应 bin、include、lib 文件夹中的文件(因此 bin 文件夹中存在 cudart64_110.dll)
  • 我的视觉工作室来自:https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
  • 我在 pycharm venv 中工作,安装了 packagas:keras、tensorflow、tensorflow-gpu、tf-nightly、cudatools

使用通用 cmd 终端(不在 ide 中),nvcc --version 会返回良好的结果,nvidia-smi 也是如此

尝试了来自https://github.com/tensorflow/tensorflow/issues/43193 的一些东西,但我尝试过的都没有奏效。 任何帮助,将不胜感激

【问题讨论】:

    标签: python c++ tensorflow gpu


    【解决方案1】:

    我有同样的问题和相同的 GPU。你找到任何解决方案了吗?

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 2021-07-25
      • 2021-05-18
      • 2022-01-24
      • 2021-04-12
      • 2022-11-16
      • 2021-11-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多