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.

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2022年3月29日 下午6:06
下一篇 2022年3月29日 下午6:11

相关推荐