Could not load dynamic library ‘cusolver64_10.dll‘; dlerror: cusolver64_10.dll not found

本文记录了一次使用NVIDIA GeForce RTX 3090显卡安装TensorFlow-GPU的过程及遇到的问题。安装CUDA 11.1后,尝试通过pip安装TensorFlow-GPU 2.4版本时遇到了缺少库文件cusolver64_10.dll的情况,导致无法正常识别GPU。通过将cusolver64_11.dll重命名为cusolver64_10.dll后,问题得以解决。
部署运行你感兴趣的模型镜像

显卡3090安装tensorflow,根据这篇进行安装的

cuda_11.1.0_456.43_win10.exe
pip install tensorflow-gpu==2.4 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

安装tensorflow后,执行下面的语句报错。

import tensorflow as tf
print(tf.__version__)
print('GPU', tf.test.is_gpu_available())
In [5]:  print('GPU', tf.test.is_gpu_available())
WARNING:tensorflow:From <ipython-input-5-43aed12af548>: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.
2021-01-18 23:38:13.759875: 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
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-01-18 23:38:13.762330: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll
2021-01-18 23:38:13.791002: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 3090 computeCapability: 8.6
coreClock: 1.755GHz coreCount: 82 deviceMemorySize: 24.00GiB deviceMemoryBandwidth: 871.81GiB/s
2021-01-18 23:38:13.791180: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
2021-01-18 23:38:14.168357: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
2021-01-18 23:38:14.168453: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
2021-01-18 23:38:14.432808: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
2021-01-18 23:38:14.460454: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
2021-01-18 23:38:14.460988: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2021-01-18 23:38:14.622638: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
2021-01-18 23:38:14.636385: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll
2021-01-18 23:38:14.636461: 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.
Skipping registering GPU devices...
2021-01-18 23:38:14.756086: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-18 23:38:14.756195: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267]      0
2021-01-18 23:38:14.756990: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0:   N
2021-01-18 23:38:14.757188: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
GPU False

解决方案,参考github
cuda安装bin目录,搜索cusolver64_11.dll ,将这个文件修改成cusolver64_10.dll,重新执行上面的语句,发现成功了。

In [6]:  print('GPU', tf.test.is_gpu_available())
2021-01-18 23:40:18.248938: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 3090 computeCapability: 8.6
coreClock: 1.755GHz coreCount: 82 deviceMemorySize: 24.00GiB deviceMemoryBandwidth: 871.81GiB/s
2021-01-18 23:40:18.248999: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
2021-01-18 23:40:18.249028: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
2021-01-18 23:40:18.249054: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
2021-01-18 23:40:18.249647: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
2021-01-18 23:40:18.249736: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
2021-01-18 23:40:18.258045: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusolver64_10.dll
2021-01-18 23:40:18.258104: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
2021-01-18 23:40:18.258432: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll
2021-01-18 23:40:18.258561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0
2021-01-18 23:40:18.614029: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-18 23:40:18.614138: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267]      0
2021-01-18 23:40:18.614941: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0:   N
2021-01-18 23:40:18.615345: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/device:GPU:0 with 21821 MB memory) -> physical GPU (device: 0, name: GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6)
2021-01-18 23:40:18.616915: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
GPU True

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

### 关于 CUDA 动态链接库 `cudart64_110.dll` 的解决方案 当遇到虚拟环境中的 `CUDA cudart64_110.dll` 文件丢失或无法找到的情况时,通常是因为系统缺少对应的 CUDA 工具包版本,或者路径配置不正确。以下是详细的分析和解决办法: #### 1. **确认 CUDA 版本匹配** 如果当前使用的 Python 虚拟环境中依赖的是特定的 CUDA 和 cuDNN 版本,则需要确保所安装的 CUDA 驱动与之相适应。例如,在引用中提到应选用 `py3.7_cuda100_cudnn_7_0` 包以适配某些环境设置[^1]。因此,需先核实项目所需的 CUDA 版本。 - 如果目标是支持 CUDA 11.0 (对应文件名中的 `_110`),则应当下载并安装 NVIDIA 提供的 CUDA Toolkit 11.0。 #### 2. **检查本地是否存在所需 DLL** 通过以下方式验证计算机上是否已存在 `cudart64_110.dll`: - 打开命令提示符窗口; - 输入 `where cudart64_110.dll` 查看其位置;如果没有显示任何结果,则表明该文件缺失。 #### 3. **重新安装或更新 CUDA Toolkit** 假如发现上述 DLL 缺失,可以从官方资源页面手动获取相应组件: - 前往[NVIDIA 官方网站](https://developer.nvidia.com/cuda-toolkit-archive),选取适合操作系统的 CUDA Toolkit 11.0 下载链接完成安装过程。 - 此外,也可以单独提取必要动态库至指定目录下(比如 `%CONDA_PREFIX%\Library\bin`\ 或者其他被加入 PATH 环境变量的地方)。 #### 4. **调整环境变量配置** 即使已经具备正确的 CUDA 库文件,仍可能出现加载失败现象。这可能是由于操作系统未能识别到这些新增加的内容所致。为此建议执行如下步骤: - 将包含 `cudart64_110.dll` 的实际存储路径追加进全局环境变量 `PATH` 中去; - 对于 Anaconda 创建出来的独立工作区而言,可能还需要额外修改 `.condarc` 设置或是直接编辑启动脚本来显式声明相关参数。 #### 5. **测试 TensorFlow 是否正常运作** 一旦解决了底层硬件加速接口层面的问题之后,就可以进一步检验框架本身能否顺利初始化 GPU 设备了。这里给出一段基于 TensorFlow 的简单算例用于初步判断效果[^3]: ```python import tensorflow as tf a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') with tf.device('/GPU:0'): c = tf.matmul(a, b) sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True)) print(sess.run(c)) ``` 以上代码片段会尝试将矩阵乘法运算分配给第一个可用图形处理器处理,并打印日志消息展示具体设备分配情况。 --- ###
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值