I am running deep learning pytorch.
The environment has been configured on four empty computers, and the whole set takes no more than two hours.
The computer hardware of pytorch readers of cuda+cudnn+anaconda+pycharm+gpu version
is different, and there may be differences in version selection.
The versions of the 4 computers I configured are also different, but the steps are the same, only the version selection is slightly different.
The following shows the steps I configured on 2022.7.19.
Computer configuration: RTX3060 graphics card
cuda11.6.XX
1. Install cuda
Check the cuda version that is compatible with the computer
NVIDIA Control Panel-"System Information-"Components
Check whether the graphics card driver is downloaded
Method 1:
NVIDIA Control Panel-"System Information-"Display
Method 2:
cmd-"nvidia-smi and method 1 see It is the same
https://developer.nvidia.com/cuda-toolkit-archive Download the corresponding version of cuda.
The above is 11.6, just download 11.6, I can’t get used to the latest version, choose the next new version
After downloading, run it as an administrator
. The path is the decompression path of the installation package. After the software is installed, it will be automatically deleted. The
installation location should be remembered
. The temporary decompression directory should not be the same as the cuda installation path, otherwise the installation directory will not be found after the installation is complete
. After completion, System Environment Variables - "System Variables -" will have the following new variables.
I also want to add two variables myself
to check whether cuda is installed successfully
. It is the same as in the picture, enter the corresponding path, and then enter nvcc -V
2. Install cudnn
https://developer.nvidia.com/rdp/cudnn-archive
download needs to log in to NVIDIA, and readers who do not have it need to register by themselves. Here I log in directly~
Download the compressed file, unzip it,
copy these three folders to the path of cuda, "replace the file"
to check whether cudnn is installed successfully, enter
the bandwidthTest.exe and deviceQuery.exe under the installation directory extras\demo_suite just now to check whether it is installed Success
indicates that cuda toolkit and cudnn are installed correctly.
3. Install anaconda
Download the anaconda installation package. It is not recommended to go to the official website to download. The official website download is too slow. It is recommended to download the Tsinghua Park address https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
It is not recommended to install the latest version, which is prone to errors【 I tried to install the latest version, but the system environment variables cannot be added automatically later]
The first item will automatically add system environment variables to the installation path. It is strongly recommended to check it, which can save a lot of trouble in the future. (No need to manually add environment variables)
The second item uses the version of python by default
. Check whether there is a Python environment
. Press ctrl+z to exit from python
. Check whether there is a conda environment.
Four. Install pycharm
https://www.jetbrains.com
5. Install the Cuda version of pytorch
https://pytorch.org/get-started/locally/Choose
your own version, followed by Tsinghua source -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install torch torchvision torchaudio --extra-index -url https://download.pytorch.org/whl/cu116 -i https://pypi.tuna.tsinghua.edu.cn/simple
6. Check whether the installation is successful
Some authors on the Internet said that <function…> appears because the version has not been downloaded, but I did not find any abnormalities when using it.
That's it. The code runs smoothly~
Many authors on the Internet have explained the installation steps. The steps are generally similar, and many authors have written more details than me.
But mine is relatively complete and relatively new~
I wish the readers here can work smoothly and do their research well~