本文主要是介绍RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronously re,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
RuntimeError: CUDA error: device-side assert triggered
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.
关于Ubuntu18.04运行yolov5时出现这个错误的解决方法:
它显示的问题是cuda内核出现了错误,那么就是与cuda版本有关
我所运行的电脑配置为 RTX3060 + ubuntu18.04 + 10.2 CUDA 以及所对应的cudnn
后来我查阅的大多数文章显示我的3060显卡算力为8.6
官方网站:https://developer.nvidia.com/cuda-gpus
于是我下载了cuda 11.1 和对应的cudnn v8.0.5
下载anaconda3
推荐博主
(12条消息) linux上下载Anaconda3_西海燃风的博客-CSDN博客_anaconda linux 下载
pytorch
在pytorch里我选择cuda11.1
# 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
下载搭配好后测试
python
import torch
print(torch.cuda.is_available()) #正确会显示true
print(torch.version.cuda) #显示版本
然后问题解决!
这篇关于RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronously re的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!