ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

【软件环境安装与使用】GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch in

2022-06-29 18:35:58  阅读:662  来源: 互联网

标签:installation sm torch compatible pytorch CUDA 版本 cuda


前言

博主在运行edgeai_yolov5的时候,出现了一些意料之外的错误,记之。

问题

NVIDIA GeForce RTX 3080 Ti with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

原因

从log可以看出与pytorch、CUDA版本之间是否匹配有关;

通过以下代码不能确定cuda是否可用

import torch
# 在python的命令环境测试该命令 返回是True的,但是在run torch程序的时候报错
torch.cuda.is_available()

要测试显卡算力与当前pytorch是否匹配,可以进入python命令行,依次输入如下两行代码:

如果想要测是你的cuda版本torch是否可以使用,使用以下命令测试可能会更好。

import torch
torch.zeros(1).cuda()
 根据对应算力的话,算力为8.x的显卡使用的cuda版本应该大于等于11.0。 上面表面上是说PyTorch,实际上是PyTorch依赖的CUDA版本的问题。 RTX 3080的算力是8.6,3080Ti只能适用CUDA11.0以上的版本;需要重新安装对应CUDA可用版本的pytorch版本; 具体的nvidia、CUDA以及和pytorch版本之间的关系,可以参考here,个人感觉总结的非常清晰到位,点个赞~   解决方法: 出现这个问题主要是edgeai_yolov5中requirements.txt指定安装pytorch=1.9.0版本,
pip install -r requirements.txt

pip之后默认安装的环境是torch1.9.0+cuda10.2,而3080ti的算力是8.6,支持的cuda版本应该不小于11.0,所以出错。

解决办法是修改requirements.txt中的torch相关内容的版本,直接使用conda安装指定的torch和cuda版本即可;

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch  # 最新版本的pytorch,也可以指定pytorch版本
pip install -r requirements.txt

 

参考

1. GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation.

2. nvidia显卡和CUDA版本关系

标签:installation,sm,torch,compatible,pytorch,CUDA,版本,cuda
来源: https://www.cnblogs.com/happyamyhope/p/16404790.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有