One, cuda, cudnn installation
1. View the highest version supported by this machine
Open the NVIDIA Control Panel - click System Information - Components to see the highest version currently supported.
2. Installation
If you don't want to download, you can see the link I have downloaded
: https://pan.baidu.com/s/1rHr7Af_0Hu98Q75KDlwGjA?pwd=4869
Extraction code: 4869
Here we take cuda11.6 as an example:
The cuda installation can be directly defaulted, there is no need to set different paths, and setting the same path will not affect each other.
Multiple cuda versions can be installed on one computer, and different versions will not be overwritten.
To switch between different versions of cuda, just put the path of the environment variable in front.
cudnn is not an installer, but a C++ runtime library, including header files, lib files, and dll files. After the download is complete, you need to copy the corresponding files to the cuda directory.
Unzip the cudnn compressed file, you will get the following files:
It is to select the files in the cudaa folder and copy them to the corresponding cuda folder (the Lib file needs to be copied to x64)! ! !
Open the system environment variables, you can see that there are two more CUDA_PATH and CUDA_PATH_V11_6 in the system variables, these two variables are automatically added after installing cuda.
Then create the following environment variables:
Generally, the newly added ones are at the bottom, so you need to click "Move Up" repeatedly to move these four lines to the top.
3. Test
You're done! Test it;
open cmd and type nvcc -V;
if the installation is successful and the environment variables are configured, the cuda version information will be output.
( If you want to change the color and background of cmd, you can refer to it )
二、Paddle—GPU
It is recommended to create , as follows:
python -m pip install paddlepaddle-gpu==2.3.2.post116 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
Generally also need paddlex:
pip install paddlex -i https://mirror.baidu.com/pypi/simple
test:
import paddle
print(paddle.utils.run_check())
3. Pytorch—GPU
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
test:
import torch
print(torch.cuda.is_available())
四、TensorFlow—GPU
Domestic use of the pip command to download and install often encounters situations where the download speed is very slow, or even the connection is disconnected, and the response times out, which leads to the installation failure. At this time, we can choose the domestic image configuration pip source, just add "-i source address" after the "pip install" command.
Now we use the domestic Tsinghua source to install the latest version of TensorFlow.
pip install -U tensorflow-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple
test:
import tensorflow as tf
# print(tf.test.is_gpu_available())
print('Num GPUs Available:',len(tf.config.list_physical_devices('GPU')))
print(tf.config.list_physical_devices('GPU'))
output:
Daily "Big Pie":
The meaning of life is always to expand rather than stick to it Never mind who I am today I want to be a better self