CUDA、pytorch、配置环境教程合集

1.CUDA卸载

参考:

【环境搭建】卸载&重新安装cuda+cudnn+anaconda+gpu版pytorch_卸载cuda-CSDN博客

【cuda】cuda安装与卸载升级_升级cuda-CSDN博客

检测代码:

https://www.zhihu.com/question/482335084

python 复制代码
import torch
print('CUDA版本:',torch.version.cuda)
print('Pytorch版本:',torch.__version__)
print('显卡是否可用:','可用' if(torch.cuda.is_available()) else '不可用')
print('显卡数量:',torch.cuda.device_count())
print('是否支持BF16数字格式:','支持' if (torch.cuda.is_bf16_supported()) else '不支持')
print('当前显卡型号:',torch.cuda.get_device_name())
print('当前显卡的CUDA算力:',torch.cuda.get_device_capability())
print('当前显卡的总显存:',torch.cuda.get_device_properties(0).total_memory/1024/1024/1024,'GB')
print('是否支持TensorCore:','支持' if (torch.cuda.get_device_properties(0).major >= 7) else '不支持')
print('当前显卡的显存使用率:',torch.cuda.memory_allocated(0)/torch.cuda.get_device_properties(0).total_memory*100,'%')

2.5070ti出现bug

参考:更新5070ti适配pytorch,解决pytorch不支持sm_120问题-陌上玉台咏新桑-陌上玉台咏新桑-哔哩哔哩视频

【5070TI启动Stable Diffusion时报pytorch capability sm_120 is not compatible ...的解决方案】_5070ti pytorch-CSDN博客

从40系显卡换5070TI后CUDA出现问题,解决方法_5070ti cuda版本-CSDN博客

【torch报错】RuntimeError: CUDA error: no kernel image is available for execution on torch解决方案_torch.cuda.deferredcudacallerror: cuda call failed-CSDN博客

出现错误(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA ker-CSDN博客

深度学习环境配置避坑-CUDA11.0+DGL1.8_dgl cuda 11.0-CSDN博客

最后的解决方案是:

CUDA12.8+pytorch2.7.0

可以向下兼容pytorch2.5.1版本的代码,成功跑通

3.相关官方网站

pytorch:

Start Locally | PyTorch

清华镜像源:

Index of /anaconda/cloud/pytorch/win-64/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

CUDA:

CUDA Toolkit - Free Tools and Training | NVIDIA Developer

相关推荐
全栈技术负责人1 天前
AI驱动开发 (AI-DLC) 实战经验分享:重构人机协作的上下文工程
人工智能·重构
Wu_Dylan1 天前
智能体系列(二):规划(Planning):从 CoT、ToT 到动态采样与搜索
人工智能·算法
一招定胜负1 天前
OpenCV轮廓检测完全指南:从原理到实战
人工智能·opencv·计算机视觉
毕设源码-郭学长1 天前
【开题答辩全过程】以 基于python电商商城系统为例,包含答辩的问题和答案
开发语言·python
black0moonlight1 天前
win11 isaacsim 5.1.0 和lab配置
python
知乎的哥廷根数学学派1 天前
基于多尺度注意力机制融合连续小波变换与原型网络的滚动轴承小样本故障诊断方法(Pytorch)
网络·人工智能·pytorch·python·深度学习·算法·机器学习
网安CILLE1 天前
PHP四大输出语句
linux·开发语言·python·web安全·网络安全·系统安全·php
xiatianxy1 天前
云酷科技用智能化方案破解行业难题
人工智能·科技·安全·智能安全带
jjjddfvv1 天前
超级简单启动llamafactory!
windows·python·深度学习·神经网络·微调·audiolm·llamafactory
星云数灵1 天前
大模型高级工程师考试练习题8
人工智能·机器学习·大模型·大模型考试题库·阿里云aca·阿里云acp大模型考试题库·大模型高级工程师acp