当前位置: 首页 > news >正文

【Pytorch】CUDA error: no kernel image is available for execution on the device

记录一下pytorch安装的cuda版本和GPU cuda不一致的解决。

RuntimeError: CUDA error: no kernel image is available for execution on the device

一般就是pytorch和cuda安装的不匹配。

如果我安装的torch配的cuda信息如下,
torch.__version__:  1.8.1+cu102
torch.version.cuda:  10.2
torch.backends.cudnn.version():  7605

# 检测torch、cuda、cudnn版本
print("torch.__version__: ", torch.__version__)
print("torch.version.cuda: ", torch.version.cuda)
print("torch.backends.cudnn.version(): ", torch.backends.cudnn.version())

然后报错,

NVIDIA A100-SXM4-40GB with CUDA capability sm_80 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA A100-SXM4-40GB GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

翻译一下,

具有 CUDA 功能 sm_80 的 NVIDIA A100-SXM4-40GB 与当前 PyTorch 安装不兼容。
当前的 PyTorch 安装支持 CUDA 功能 sm_37 sm_50 sm_60 sm_70。

https://blog.csdn.net/weixin_42642296/article/details/115598760
sm_80对应的cuda是11.1,而我安装的cuda是10.2

改一下就好了,根据官网 Previous PyTorch Versions | PyTorch

# CUDA 11.1
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

http://www.lryc.cn/news/144337.html

相关文章:

  • dolphinschedule配置企微告警服务(WeChat群组)
  • Git中smart Checkout与force checkout
  • Java“牵手”1688商品跨境属性数据,1688API接口申请指南
  • Win解答 | 解决键盘中 字母+空格 导致的输入法弹窗导致的一系列问题
  • WPF读取dicom序列:实现上一帧、下一帧、自动播放、暂停
  • homeassistant ubuntu自启动 网络设置
  • 生成式AI背景下编程工作者的技术和高级软考理论的演进融合之路
  • RabbitMQ的镜像队列
  • 【Spring Boot】数据库持久层框架MyBatis — Spring Boot构建MyBatis应用程序
  • 【校招VIP】专业课考点之session cookie
  • IDEA集成Git相关操作知识(pull、push、clone)
  • Springboot 整合 Redis配置
  • Spark 启动时,报JAVA_HOME is not set
  • 运用Python解析HTML页面获取资料
  • 硬件名词--单片机,开发板和芯片
  • Ubuntu20.04下安装搜狗输入法Linux版
  • springboot RabbitMQ客户端连接故障恢复
  • centos下配置SFTP且限制用户访问目录
  • A - 最短路径
  • 自然语言处理(三):基于跳元模型的word2vec实现
  • 1.1 数据库系统简介
  • WebGL 绘制圆点
  • 迅为RK3588开发板Android12 设置系统默认不锁屏
  • 香港服务器速度快的原因
  • 过滤器,监听器与拦截器的区别
  • clickhouse ssb-dbgen数据构造 及 clickhouse-benchmark简单压测
  • 【数据分析】统计量
  • 【通用消息通知服务】0x4 - 目前进展 阶段复盘
  • vue若依导出word文件,简单的实现
  • 【LeetCode75】第四十题 最大层内元素和