当前位置:网站首页>Solve the problem that CUDA cannot accelerate GPU in pytoch
Solve the problem that CUDA cannot accelerate GPU in pytoch
2022-07-27 01:12:00 【Although Beihai is on credit, Fuyao can take it】
solve Pytorch in Cuda unable GPU Speed up the problem
List of articles
Preface
In the installation pytorch There will be unusable GPU The problem of acceleration , Just install GPU Version of Pytorch Record the process .
Refer to the post :https://blog.csdn.net/qq_46126258/article/details/112708781
One 、 Test computer CUDA edition
On computer cmd Enter the following command to view the graphics card driver and CUDA Version information
nvcc -V
nvidia-smi
Let me show you the information :
NVIDIA-SMI 465.89 Driver Version: 465.89 CUDA Version: 11.3
Judge your own CUDA Whether the version meets the requirements ( Installed CUDA and cuDNN bring into correspondence with , The version number can be compared with 11.3 low )
Two 、 Check the video card cudnn edition
Install well cudnn after , open cudnn Folder , My is on the following path :
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include
open cudnn.h file , I use notepad++ open
ctrl+F retrieval CUDNN_MAJOR , give the result as follows
cudnn:8.2.1
Check the version corresponding problem :
cuDNN Official website :https://developer.nvidia.com/rdp/cudnn-archive
3、 ... and 、 Installation and downloading PyTorch
1、 Command line installation
download PyTorch You can check the information on the official website :
https://pytorch.org/get-started/locally/#no-cuda-1
torch If torch-cpu, Indicates that... Is installed cpu Version of torch.
You can install directly from the installation command given on the official website
pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113
You can see that the installed packages are the following three packages
torch == 1.10.2+cu113
torchvision == 0.11.3+cu113
torchaudio === 0.10.2+cu113
But one problem with this is , Installation speed is very slow , So we can adopt the method of offline installation .
2、 Offline installation
Get into Pytorch Installation package website , Download the corresponding package file :
PyTorch Download Web page :https://download.pytorch.org/whl/torch_stable.html
The following figure is the same as the above package , In fact, you only need to download torch, The other two bags are smaller .

among ,cu113 Express cuda edition 11.3,torch1.10.2 by torch edition ,cp38 Indicates an adaptation python 3.8.
adopt cmd Download the path of their three packages before entering ;
Install one by one in the virtual environment :
pip install torch-1.10.2+cu113-cp38-cp38-win_amd64.whl
pip install torchvision-0.11.3+cu113-cp38-cp38-win_amd64.whl
pip install torchaudio-0.10.2+cu113-cp38-cp38-win_amd64.whl
Four 、 Running tests
After activating the environment cmd Enter the following statement in :
python
import torch
torch.cuda.is_available()
Show True That is success
边栏推荐
- flink需求之—ProcessFunction(需求:如果30秒内温度连续上升就报警)
- MySQL - how to determine a field suitable for building an index?
- MYSQL中的行锁升级表锁的原因
- What is kubernetes?
- 无重复字符的最长子串
- Spark on yarn's job submission process
- Best getting started guide for flask learning
- 李宏毅机器学习(2017版)_P13:深度学习
- MTCNN
- Solve the problem of direct blue screen restart when VMware Workstation virtual machine starts
猜你喜欢

Spark on yarn's job submission process

Spark----- RDD 的 Shuffle 和分区

MySQL index optimization: scenarios where the index fails and is not suitable for indexing

Solve the problem of direct blue screen restart when VMware Workstation virtual machine starts

adb.exe已停止工作 弹窗问题

李宏毅机器学习(2017版)_P6-8:梯度下降

(Spark调优~)算子的合理选择

Flink 1.15 local cluster deployment standalone mode (independent cluster mode)

基于Flink实时项目:用户行为分析(一:实时热门商品统计)

被围绕的区域
随机推荐
ContextCompat.checkSelfPermission()方法
MySQL索引优化:索引失效以及不适合建立索引的场景
VIS工作流 - PlantCV
腾讯云直播插件MLVB如何借助这些优势成为主播直播推拉流的神助攻?
Flink based real-time project: user behavior analysis (I: real-time popular product statistics)
x 的平方根
李宏毅机器学习(2017版)_P5:误差
What is kubernetes?
通过FlinkCDC将MySQL中变更的数据写入到kafka(DataStream方式)
flink需求之—SideOutPut(侧输出流的应用:将温度大于30℃的输出到主流,低于30℃的输出到侧流)
The difference between forward and redirect
MySQL index optimization: scenarios where the index fails and is not suitable for indexing
移动直播选择 RTMP 还是RTC协议
Choose RTMP or RTC protocol for mobile live broadcast
Status management in Flink
Redisson working principle - source code analysis
Flink's fault tolerance mechanism (checkpoint)
基于Flink实时项目:用户行为分析(二:实时流量统计)
基于Flink实时计算Demo—关于用户行为的数据分析
Flink based real-time project: user behavior analysis (II: real-time traffic statistics)