Anaconda+PyCharm+CUDA+CUDNN+PyTorch
1. Anaconda installation
Download path: https://www.anaconda.com/
Installation method: Install as administrator
Intermediate option:
Enter conda -V in cmd to check the version and determine whether the installation of conda is complete.
2. PyCharm installation
Download path: https://www.jetbrains.com/pycharm/, just download the community version
Installation method: run as administrator
Intermediate option:
3. CUDA installation
View the CUDA driver version: Type nvidia-smi in the command line window to view the CUDA driver version number
Note: Confirm the file version of NVCUDA. If the file version is above 30, the CUDA runtime library version must be above 11. The two versions must be consistent. It is said that the running version cannot exceed the driver version.
The left side of the Bilibili icon
Download path: https://developer.nvidia.com/cuda-downloads
Select Archive of Previous CUDA Releases, view the historical version,
find the CUDA that suits your system and version, and confirm whether the Version is win10 or win11. Some versions only have win10, but not win11.
Installer Type select exe (local)
Installation method: run as administrator
Intermediate options:
cmd, enter nvcc -V to view the installation results
4. CUDNN installation
Download path: https://developer.nvidia.com/rdp/cudnn-archive
Note: Registration is required for downloading, and it seems that you have to join the community. The downloaded version must be consistent with CUDA. The downloaded file
is a compressed package. After decompression,
the first three folders copied to the CUDA folder
5.pytorch installation
Installed version: Find the historical command line on the official website. It must be consistent with the installed CUDA version. Currently, pytorch supports up to CUDA11.3. If it exceeds 11.3, it may be confirmed by Baidu. My 11.4 can be downloaded using the 11.3 command line.
Pay attention to using the mirror source when downloading, it will be faster.
First enter the following command in the command line window:
conda -v//查看版本号
activate//激活,进入base环境
conda create -n name python=3.7//创建名字为name,版本为3.7.x的python环境,如果已经创建,会提示删除原先环境再创建,输入y即可
conda activate name//激活创建的环境
After that download pytorch
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/
注:我这里直接用了镜像源,把官网命令行最后的pytorch换成镜像源路径即可