cuda10.2安装paddle的踩坑历程

因为有个作业要求paddle里的包,在paddle官网https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/windows-pip.html

有详细的安装步骤,我的电脑装了cuda10.2+cudnn7.6.5,应该都是匹配的,但是在最后验证的时候,报错:RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured correctly. (error code is 126)

base) C:\Users\fengx>conda activate paddle_gpu

(paddle_gpu) C:\Users\fengx>python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:35:01) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle.fluid
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
W0328 19:32:02.899677 13852 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 5.0, Driver API Version: 11.3, Runtime API Version: 10.2
W0328 19:32:02.901669 13852 dynamic_loader.cc:258] Note: [Recommend] copy cudnn into CUDA installation directory.
 For instance, download cudnn-10.0-windows10-x64-v7.6.5.32.zip from NVIDIA's official website,
then, unzip it and copy it into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
You should do this according to your CUDA installation directory and CUDNN version.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\utils\install_check.py", line 196, in run_check
    _run_static_single(use_cuda)
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\utils\install_check.py", line 124, in _run_static_single
    exe.run(startup_prog)
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\fluid\executor.py", line 1262, in run
    six.reraise(*sys.exc_info())
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\six.py", line 719, in reraise
    raise value
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\fluid\executor.py", line 1260, in run
    return_merged=return_merged)
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\fluid\executor.py", line 1402, in _run_impl
    use_program_cache=use_program_cache)
  File "D:\DeepLearning\envs\paddle_gpu\lib\site-packages\paddle\fluid\executor.py", line 1492, in _run_program
    [fetch_var_name])
RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured correctly. (error code is 126)
  Suggestions:
  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
  - Windows: set PATH by `set PATH=XXX; (at ..\paddle\fluid\platform\dynload\dynamic_loader.cc:285)

可以看到报错原因是缺少cudnn64_7.dll文件,对应的目录是自己的cuda安装路径:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2

我重新下载了cudnn64_7.dll文件,放到对应的目录,重新验证发现成功:PaddlePaddle is installed successfully!

>>> import paddle.fluid
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
W0328 20:32:03.417174 14928 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 5.0, Driver API Version: 11.3, Runtime API Version: 10.2
W0328 20:32:03.576746 14928 device_context.cc:465] device: 0, cuDNN Version: 7.6.
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

根据引用内容,安装PaddlePaddle需要在Anaconda Prompt中执行一些命令。引用\[1\]中提到了安装PaddlePaddle的命令,但是只支持到CUDA 11.6版本。如果你的CUDA版本是12,可以尝试使用引用\[3\]中提到的命令来安装PaddlePaddle。具体步骤如下: 1. 打开Anaconda Prompt。 2. 激活你的conda环境,可以使用命令:conda activate internet_plus。 3. 输入以下命令来安装PaddlePaddle: ``` python -m pip install paddlepaddle-gpu==2.3.1.post116 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html ``` 这个命令会安装PaddlePaddle的GPU版本,并且指定了CUDA 12所对应的安装包。 请注意,以上命令是基于引用内容提供的信息,如果官方有更新的安装指南,请参考官方文档进行安装。 #### 引用[.reference_title] - *1* [anaconda安装paddle(安装CUDACUDNN)](https://blog.csdn.net/weixin_43912621/article/details/128136290)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [paddle GPU 终极安装教程](https://blog.csdn.net/apodx/article/details/123819148)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [百度飞桨paddle安装 包括CUDA,cuDNN,opencv的安装](https://blog.csdn.net/qq_43237333/article/details/125894250)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

f~shuai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值