pytorch 安装 GPU版本 1030也能装

已经安装了anaconda

核实是否为英伟达显卡,我电脑是入门级1030,在英伟达算力表上没有,但是也可以装。

nvidia-smi

1.安装CUDA

CUDA Toolkit Archive | NVIDIA Developer

CUDA 版本根据系统来,不用安装最新版,根据pytorch 支持的来选择。

文件很大,不要安装错了。

新增环境变量,将nvcc.exe所在目录添加至环境变量。

核实是否完成 cmd

nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2021 NVIDIA Corporation

Built on Fri_Dec_17_18:28:54_Pacific_Standard_Time_2021

Cuda compilation tools, release 11.6, V11.6.55

Build cuda_11.6.r11.6/compiler.30794723_0

2.安装 cuDNN

cuDNN Archive | NVIDIA Developer

需要账号,注册就好

将文件复制到CUDA中,插入式组件,为了加速GPU的计算。

3.安装pytorch

Start Locally | PyTorch

在pytorch管网找到对应的pytorch地址

打开anaconda PowerShell prompt

创建pytorch 环境

 conda info -e
# 查看已有的环境

conda create -n pytorch
# 注意不要开vpn

根据自己电脑情况输入pytorch 安装代码,文件有点大,我用的pip ,conda安装太慢。

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

 4.检查是否安装成功

import torch
print("hello {}".format(torch.__version__))
print(torch.cuda.is_available())

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

细节处有神明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值