cuda9.1+cuDNN7.1+pytorch1.1-GPU installation under win10

1. cuda download installation and configuration

1.1 Check to see if your computer can install cuda. Methods as below:

打开控制面板,然后在右上方的搜索框里输入NVIDIA,如下图所示:第一张是打开控制面板时的图,第二张是输入NVIDIA之后,从图中的左上角可以看到搜索出来的NVIDIA。

insert image description here
insert image description here
After completing the previous step, enter the following interface, where you can view some information about NVIDIA and the driver version of the graphics card, as shown in the left menu of the figure below.
insert image description here
Click the Help menu, and select the System Information option in the drop-down menu, as shown in the red box in the figure below.
insert image description here
There are two menu pages in the pop-up system information window: Display and Components, select components, you can see many file names, find NVCUDA in the file name, and you can see the version of NVCUDA in the product name column, as shown in the red box in the figure below. The CUDA is version 9.1.
insert image description here
Of course, if the computer does not support cuda, it will not be displayed as above.

1.2 cuda download and configuration

After knowing which version you should download, go to the cuda official website to download it.
insert image description here
insert image description here
It is recommended to choose local here, which can solve some related packages at one time and avoid trouble in the future. At the bottom, there are still patches that can be installed, which can be done after cuda is installed.

Then there is the installation process, double-click to open and display the temporary decompression directory, no need to change, the default is fine.

Then enter the NVIDIA installation process, I chose the custom installation method, and unchecked the VS and the 3 options for showing off, because I have already installed VS and do not want to install the following components. As for the CUDA installation directory, you can install it on the C drive by default.
insert image description here
insert image description here
After the installation is complete, the environment variables are configured. The environment variable configuration is shown in the figure below.
insert image description here
To test whether cuda is successfully installed, you only need to open cmd with win+R, and enter nvcc -V. If the version number is displayed, it is successful.

2. Download and configuration of CUDNN

Click here to enter the official website, choose to download cudnn, but here you need to register an account, and then you can go to the download page after completing the questionnaire, anyway, you can do it step by step.

The version of CUDA in my last step was 9.1. In principle, the versions of cuDNN and cuda are required to be the same. However, since cuDNN was updated later, there is no corresponding version of cuda9.1. So, I down-selected the version for cuda9.0.
insert image description here
After downloading, unzip, copy the bin, include, and lib files in the CUDNN compressed package directly to the CUDA installation directory, and directly overwrite the installation.
insert image description here

3. Installation of pytorch-gpu

Go directly to Pytorch's official website . I used conda to install at the beginning, but the conda installation was always unsuccessful. The reason I found out was that reposd failed would appear in the URL when using conda. This seems to be a problem with the official website. Later I tried installing with pip and it worked. However, the conda method is also feasible, whether it can be determined depends on the character (now the Tsinghua mirror is gone!).
insert image description here
Both arrows are available, the upper one is conda, and the lower one is pip.

Then the command line verifies whether the pytorch GPU version is installed successfully, and returns true to indicate that the installation is successful. You can also check the version number.
insert image description here
insert image description here

just enjoy it now!

Guess you like

Origin blog.csdn.net/qq_42194665/article/details/104999962