Installation record of paddlepaddle installation in Win10 environment

Posted by CookieDoh on Sun, 26 Dec 2021 10:41:50 +0100

Write in front

This problem was solved on July 8, 2021. New changes may occur in subsequent versions. Please refer to it carefully.

Problem description and mental process

According to Baidu paddlepaddle official website The download method is one-way operation.
The result is finally verified, a pad utils. run_ Check() to directly report an error:

Running verify PaddlePaddle program ...
W0708 22:16:42.470225  3684 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.0, Runtime API Version: 11.0
W0708 22:16:42.471462  3684 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.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "X:\...\Python\Python37\lib\site-packages\paddle\utils\install_check.py", line 196, in run_check...
    [fetch_var_name])
RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.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_release2\paddle\fluid\platform\dynload\dynamic_loader.cc:265)

Why are all in English? I directly copied and pasted it and asked Du Niang. As a result, I didn't find a particularly good solution.
I thought that I had passed CET-4. Why don't you calm down and see what it means

Start running Paddle Propeller verification program
 Warning specific time device_context.cc(Device context) file:Line 404] Please note that: Equipment number: 0, GPU Computational power: 6.1, drive API edition: 11.0, Runtime API edition: 11.0
 Warning specific time dynamic_loader.cc(Dynamic library (load) file:Line 238] notes: [recommend] take cudnn Copy relevant files to CUDA Directory.
for example, from NVIDIA Downloaded from the official website cudnn-10.0-windows10-x64-v7.6.5.32.zip after,
Unzip and copy the files to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0 Directory.
Error traceability (Last backtracking):
  File "<stdin>", line 1, in <module>
  File "X:\...\Python\Python37\lib\site-packages\paddle\utils\install_check.py", line 196, in run_check...
    [fetch_var_name])
Please according to your CUDA Version and CUDNN Version to perform specific operations.
RuntimeError:(Prerequisites not met)Paddle Third party dynamic library on which the propeller depends( cudnn64_8.dll)The configuration has not been successful. (error code 126)
  Recommendations:
  1. Please check your installed third-party dynamic link library (for example CUDA,CUDNN)Is it installed correctly and check that the version is the same as the one you installed paddlepaddle-gpu Supported CUDA Version match.
  2. Please configure the third-party dynamic link library into the environment variable, for example:
  - Linux System: through command line statements`export LD_LIBRARY_PATH=...`To set environment variables LD_LIBRARY_PATH
  - Windows System: through command line statements`set PATH=XXX;`You can set environment variables PATH(The error message comes from C:\home\workspace\Paddle_release2\paddle\fluid\platform\dynload\dynamic_loader.cc(Dynamic library (load) file:Line 265)

CUDA not installed? Impossible? I remember before Install pyTorch Did you check the CUDA version at the time of? Should there be no problem?
What is this CUDNN?

After a fierce search, I found:
Both CUDA and CUDNN! No! Pack!

(as a result, it took me at least 2.46GB of hard disk space (excluding the installation package) to install them.
So AI Studio is still fragrant 48 hours a week. At least the environment doesn't have to pretend [smile].
By the way, it is suggested to change note: [recommended] to Note: [Required])

To put it simply, CUDA is the pre installed driver runtime of the graphics card, that is, it is used for playing games, not the API used by developers.
The remarkable feature is whether you can find the path of C:\Program Files\NVIDIA GPU Computing Toolkit in the computer instead of only C:\Program Files\NVIDIA Corporation. If you have the front one, you can basically skip CUDA installation; If not, come and see the next step.

Installation of CUDA

Usually choose to go directly Download from the official website The way 1.
And it is recommended to use the exe (network) version for installation. After all, it is relatively small.
But because of the official 2 Say:

Windows 7/8/10 supports CUDA 10.1/10.2/11.0/11.2 single card mode

So I still suggest starting from Historical version page Download after indexing.

Here are some common network installation packages, which can be downloaded by clicking:

editionOfficial website link (estimated size)
CUDA 10.1.105Click download (18.23MB)
CUDA 10.2.89Click download (19.20MB)
CUDA 11.0.2Click download (56.39MB)
CUDA 11.2.0Click download (57.72MB)

Note: the above links may change over time and cannot be downloaded! It can still be used as of 2021-08.

The specific version of CUDA that can be installed depends on the version driven by the computer N card (as shown in the figure below, control panel - Search - NVIDIA control panel - help (H) - system information (I))

If the driver version of CUDA 10.1 is installed, it must be > = 418.96. The following table is used as a reference: 3

CUDA 10.1 (10.1.105 general release, and updates) Driver version > = 418.96 CUDA 10.2.89 Driver version > = 441.22 CUDA 11.0.2 GA Drive version > = 451.48 CUDA 11.2.0 GA Driver version > = 460.82

It can be seen from the example above that this computer can install CUDA 11.0 at most 2.

After you download the installation package, you will be asked to select a location to extract the installation package. Generally, it is good to press the default. Unless the space of Disk C is tight, the extracted content will be automatically cleared after restart. Generally, there is no problem:
Then follow its steps, mindless, the next step is basically no problem, but you must remember your CUDA installation path, which is useful in the next step. What other problems can be discussed in the comment area.

Installation of cuDNN

This has some trouble, but the problem is not big. You can start from the official website first Find it:

Click download to find that you actually need membership!

That's not a big problem. As far as I'm concerned, the problem of registering a member is still free. There's only one blank to fill in the company, which may stop some student parties, but it's not a big problem. It seems that it's passed to invent one.

After logging in to the developer account, go back to Download page for cuDNN , click I Agree to download.
Here we choose the version of for CUDA 10.2 (because the propeller does not support CUDA 11.4 at present) 2 , so choose the lower installation package)

The contents of the installation package are as follows:

What we need to do is to compare all the contents in the CUDA folder in the compressed package with the previous CUDA installation path (generally C: \ program files \ NVIDIA GPU computing toolkit \ CUDA \ v11.0) (here is the specific version number, which can be changed by ourselves) 1 )Merge (i.e. directly copy, paste / unzip the past, the process should be error free, all new things), and finally it will be like this:

Add PATH environment variable

Use the key combination win+pause or right-click the computer icon - properties to call the system properties dialog box, and then add the PATH environment variable as follows:
If you are the default path, fill in C: \ program files \ NVIDIA GPU computing toolkit \ CUDA \ V11 in steps 6 (unnecessary) and 7 0 (here is the specific version number, which can be changed by yourself) \ bin
If it is customized, please fill in the customized path, such as F:\NVIDIA\bin as shown in the figure.
*Note: the path must be written to the bin folder path, or there will be a previous bug..

Verification test

Test the following code in python:

>>> import paddle
>>> paddle.utils.run_check()

If these two sentences go on, they should appear:

Running verify PaddlePaddle program ...
W...] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.0, Runtime API Version: 11.0
W...] device: 0, cuDNN Version: 8.2.
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

Translated as:

Start the propeller verification procedure ...
warning...] Please note that: Device 0 detected, GPU Computational power: 6.1, CUDA drive API Version number: 11.0, Runtime API edition: 11.0
 warning...] Device 0 detected, cuDNN Version number: 8.2.
The propeller is in 1 GPU It works well on the.
The propeller is in 1 GPUs It works well on the.
The propeller is installed successfully! Now, let's start deep learning with the paddle.

Officials say that when the GPU computing power is higher than 5.0, this computer can be used to run neural networks. 4
I have 6.1 here, so I can burn my graphics card happily!

reference material

  1. Install CUDA, cuDNN and paddlepaddle under Windows 10_ huyongchao98 ↩︎ ↩︎

  2. Installation guide_ PaddlePaddle deep learning platform ↩︎ ↩︎

  3. NVIDIA CUDA Toolkit Release Notes - Table 3_NVIDIA Developer Zone ↩︎

  4. NVIDIA NVIDIA GPU graphics card computing power list (including Tesla, GeForce, TITAN and RTX Series) programmer base ↩︎

Topics: Python bug paddlepaddle