因为有个作业要求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:Usersfengx>conda activate paddle_gpu (paddle_gpu) C:Usersfengx>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 FilesNVIDIA GPU Computing ToolkitCUDAv10.0 You should do this according to your CUDA installation directory and CUDNN version. Traceback (most recent call last): File "", line 1, in File "D:DeepLearningenvspaddle_gpulibsite-packagespaddleutilsinstall_check.py", line 196, in run_check _run_static_single(use_cuda) File "D:DeepLearningenvspaddle_gpulibsite-packagespaddleutilsinstall_check.py", line 124, in _run_static_single exe.run(startup_prog) File "D:DeepLearningenvspaddle_gpulibsite-packagespaddlefluidexecutor.py", line 1262, in run six.reraise(*sys.exc_info()) File "D:DeepLearningenvspaddle_gpulibsite-packagessix.py", line 719, in reraise raise value File "D:DeepLearningenvspaddle_gpulibsite-packagespaddlefluidexecutor.py", line 1260, in run return_merged=return_merged) File "D:DeepLearningenvspaddle_gpulibsite-packagespaddlefluidexecutor.py", line 1402, in _run_impl use_program_cache=use_program_cache) File "D:DeepLearningenvspaddle_gpulibsite-packagespaddlefluidexecutor.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 ..paddlefluidplatformdynloaddynamic_loader.cc:285)
可以看到报错原因是缺少cudnn64_7.dll文件,对应的目录是自己的cuda安装路径:C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.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.



