不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

pytorch与gpu版本的适配问题

今天跑了一下yolov5报了一个错误:

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

于是乎,根据显卡的型号对应的运算能力是否匹配:

主机显卡是3060ti,上面却没有能找到,真的是无语泪三行。没得办法只能看报错信息:

.local/lib/python3.8/site-packages/torch/cuda/__init__.py:104: UserWarning:
GeForce RTX 3060 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 sm_75.
If you want to use the GeForce RTX 3060 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

warnings.warn(incompatible_device_warn.format(device_name, capability, ” “.join(arch_list), device_name))
Using torch 1.7.1 CUDA:0 (GeForce RTX 3060 Ti, 7973.875MB)

根据错误信息可知:当前的GPU版本计算能力是8.6与之当前的PyTorch的版本不匹配。降cuda版本显然不可能的了,所以就能去pytorch官网查找适配的版本了。

查看主机显卡的cuda版本:nvidia-smi

很显然pytorch没有完全匹配的cuda适配的版本,但是还是有11.0的版本,试着安装该版本,再运行yolov5的脚本,输出如下信息:

赞(0) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » pytorch与gpu版本的适配问题

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏