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.
它显示的问题是cuda内核出现了错误,那么就是与cuda版本有关
我所运行的电脑配置为 RTX3060 + ubuntu18.04 + 10.2 CUDA 以及所对应的cudnn
后来我查阅的大多数文章显示我的3060显卡算力为8.6
官方网站:
于是我下载了cuda 11.1 和对应的cudnn v8.0.5
推荐博主
(12条消息) linux上下载Anaconda3_西海燃风的博客-CSDN博客_anaconda linux 下载
在pytorch里我选择cuda11.1
# CUDA 11.1
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f .html
下载搭配好后测试
python
import torch
print(torch.cuda.is_available()) #正确会显示true
print(torch.version.cuda) #显示版本
然后问题解决!
本文发布于:2024-02-04 22:52:44,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170718211960466.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |