【Bug解决】Could not load dynamic library ‘cudart64_110.dll‘; dlerror: cudart64_110.dll

问题描述

安装完tensorflow-gpu后,使用下面的程序段可以查看能否能读取显卡。

import tensorflow as tf

if tf.test.gpu_device_name():
    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
else:
    print("Please install GPU version of TF")

然而运行之后,没有打印出显卡名称,出现了一堆缺少dll文件的报错。
这里只是其中一个,还有好多文件。

Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll

解决方法

下载所有的dll文件,放置在 C:\Windows\System路径下,如图所示。
下载链接:https://download.csdn.net/download/qq1198768105/85087045

【Bug解决】Could not load dynamic library ‘cudart64_110.dll‘; dlerror: cudart64_110.dll
注:如果名称不完全吻合,可以手动修改文件名,这与cuda的版本有关,根据报错的提示信息修改即可。

再次运行,显卡能够被读取到。

【Bug解决】Could not load dynamic library ‘cudart64_110.dll‘; dlerror: cudart64_110.dll

; 其它问题

运行时,我还出现一个警告

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.

这说明CPU性能没有发挥到极致,和AVX2编码有关,但影响不大,可以通过下面的语句将其忽略。

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2'

参考资料

该方法参考了博文解决Could not load dynamic library ‘cudnn64_7.dll’; dlerror cudnn64_7.dll not found,由于原博文的dll文件少了一个,特再整理一遍。

Original: https://blog.csdn.net/qq1198768105/article/details/124004146
Author: zstar-_
Title: 【Bug解决】Could not load dynamic library ‘cudart64_110.dll‘; dlerror: cudart64_110.dll

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/522122/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球