win10 cuda11.8 and torch2.0 installation

(1) Install cuda11.8

1) First determine the cuda version

nvcc -V 

In order not to pollute the existing development environment, create a new conda environment, here I choose Python3.11 version

2) Install cuda 11.8, because torch2.0 currently only supports cuda11.7 and cuda 11.8

cuda download link: cuda

Go to the archve to find the 11.8 version

Direct installation, first extract the temp directory

After installing cuda, you will be prompted to restart. After the reboot is complete, the installation is successful.

After cuda is installed, two environment variables will be created CUDA_PATHand CUDA_PATH_V11_8:

3) Install cudnn

Install cuDNN, link https://developer.nvidia.com/rdp/cudnn-download :

Find the cudnn corresponding to this cuda 11.x window version

After the download is complete, unzip the compressed package, and find binthe , include, libfolders:

Copy it to the cuda installation directory 11.8`:

At this time, check pathwhether there is the following path in the system variables:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp

4) Verify

  1. cuda verification

Now to verify whether cuda and cudnn are normal, you need to use cuda's deviceQuery.exe and bandwidthTest.exe to verify, enter in powershell, enter C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\extras\demo_suite , then enter:

.\bandwidthTest.exe:


.\deviceQuery.exe:

(2) Install pytorch2.0

Installation instructions:

pip3 install numpy --pre torch --force-reinstall --index-url https://download.pytorch.org/whl/nightly/cu118

You can also use local installation packages:

download link:

Link: Click here
Extraction code: ycsm

Guess you like

Origin blog.csdn.net/qq_40905284/article/details/129692061