Download Anaconda
Then configure the environment variable yourself:
Next, enter the NVIDIA Control Panel, click Help-System Information:
You can check the driver version.
Install CUDA 11.6 here.
Install CUDA
Start after downloading the installation package,
For testing, enter nvcc -V in the terminal and return the CUDA version number, which means the installation is successful.
Install cuDNN
Unzip the compressed package, and then add the three folders to the cuda installation directory,
Here is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6
Paste it directly.
***Current system environment variables:
In system variables:
Install
pytorch
Choose according to the corresponding model version:
More model version options:
Find the corresponding version installation command in it:
# CUDA 11.6
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge
Note that before entering the above installation instructions, a new environment should be created first:
conda create -n name python==3.10.9
Now is to create a conda environment called pytorch:
Enter conda info --envs to view the existing environment :
Switch to the created environment,
Then enter the install pytorch command:
-------------------------------------------------------------------------------------------------------------------------------
The conda update method is also given here:
==> WARNING: A newer version of conda exists. <==
current version: 23.1.0
latest version: 23.3.1
Please update conda by running
$ conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.3.1
Just use conda update -n base -c defaults conda.
-------------------------------------------------------------------------------------------------------------------------------
test
Finally make a demo:
At this point, the pytorch installation is complete.