window10 paddle-gpu环境安装错误

最烦的就是开发环境的配置,经常掉进坑里弄个一两天时间。

W0922 10:00:26.824364 14340 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 10.2
W0922 10:00:26.830348 14340 dynamic_loader.cc:238] 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.


一、晒一下nvidia-smi

>nvidia-smi
Wed Sep 22 10:03:47 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 471.68       Driver Version: 471.68       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:65:00.0  On |                  N/A |
|  0%   44C    P8    13W / 240W |    425MiB /  8192MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1184    C+G   Insufficient Permissions        N/A      |
|    0   N/A  N/A      7884    C+G   ...y\ShellExperienceHost.exe    N/A      |
|    0   N/A  N/A      8860    C+G   ...es.TextInput.InputApp.exe    N/A      |
|    0   N/A  N/A     10204    C+G   ...018.2.4\bin\pycharm64.exe    N/A      |
|    0   N/A  N/A     15916    C+G   ...lPanel\SystemSettings.exe    N/A      |
+-----------------------------------------------------------------------------+
 

二、运行paddlepaddle 验证程序

D:\work\2021\>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle

>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
Traceback (most recent call last):
  File "", line 1, in
  File "D:\programData\python38\lib\site-packages\paddle\utils\install_check.py", line 196, in run_check
    _run_static_single(use_cuda)
  File "D:\programData\python38\lib\site-packages\paddle\utils\install_check.py", line 124, in _run_static_single
    exe.run(startup_prog)
  File "D:\programData\python38\lib\site-packages\paddle\fluid\executor.py", line 1110, in run
    six.reraise(*sys.exc_info())
  File "D:\programData\python38\lib\site-packages\six.py", line 703, in reraise
    raise value
  File "D:\programData\python38\lib\site-packages\paddle\fluid\executor.py", line 1098, in run
    return self._run_impl(
  File "D:\programData\python38\lib\site-packages\paddle\fluid\executor.py", line 1231, in _run_impl
    return self._run_program(
  File "D:\programData\python38\lib\site-packages\paddle\fluid\executor.py", line 1328, in _run_program
    self._default_executor.run(program.desc, scope, 0, True, True,
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 C:\home\workspace\Paddle_release\paddle\fluid\platform\dynload\dynamic_loader.cc:265)

三、从上面的日志可以看出,加载cudnn64_7.dll失败

打开目录 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin

发现确实没有cudnn64_7.dll,只有cudnn64_8.dll

 看来是版本装的太高了,之前下载的是cudnn-10.1-windows10-x64-v8.0.5.39.zip,只好重新下载

cudnn-10.1-windows10-x64-v7.6.5.32.zip 

四、重新验证

D:\work\2021\>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
W0922 10:34:10.044379  6852 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 10.2
W0922 10:34:10.108378  6852 device_context.cc:422] 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.

成功!!!

你可能感兴趣的:(深度学习,paddle)