Windows + anaconda + pycharm + nvidia + cuda + cudnn + pytorch installation tutorial
I want to learn pytorch, so I can't install a sub-environment?
View graphics card information
Operation: Start - Right click - Device Manager - Display Adapters.
View cuda version
Operation: NVIDIA in the lower right corner - right click - NVIDIA Control Panel - System Information - Components.
install cuda
Go to the CUDA official website to download the cuda10.2 version.
After downloading, double-click the exe file, change the directory, and decompress it.
After the decompression is complete, it will automatically enter the installation process.
Follow the installation prompts to install by default.
installing.
Check if the installation was successful.
nvcc -V
Success!
install cudnn
Go to the CUDNN official website to download the cudnn corresponding to the cuda10.2 version.
After downloading, unzip and copy the bin, include, and lib files in the CUDNN package directly to the CUDA installation directory (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2).
There will be an admin rights issue here.
Click the checkmark before "Do this for all current projects" and then click Continue.
Configure cuda environment variables
There are already two.
Three more to be added.
The CUDA Samples are not found at first, but the start menu is visible.
Just open it.
Later, it was found that there are bin and libnvvp in the PATH of the system variable.
Configure cudnn environment variables
install pytorch
Check the python version in conda.
Create a virtual environment in conda.
wxm_pytorch is the virtual environment name.
conda create -n wxm_pytorch python=3.7
Click y.
Activate the virtual environment.
conda activate wxm_pytorch
Enter the pytorch official website and select the configuration item.
conda install
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
Enter y and wait for the installation.
Okay.
Wrong.
Delete the failed virtual environment first.
Again.
pip install
pip3 install torch==1.10.2+cu102 torchvision==0.11.3+cu102 torchaudio===0.10.2+cu102 -f https://download.pytorch.org/whl/cu102/torch_stable.html
It's ready.
have a test:
happy heart.
I saw torch.
first demo
finally! ! !