CUDA Error: no kernel image is available for execution on device

4 篇文章 0 订阅
2 篇文章 0 订阅

RuntimeError: CUDA error: misaligned address 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


最近在运行stable diffusion的时候,出现了这个问题。查看stable diffusion的issue发现没人遇到和我一样的问题,记录一下解决过程:

首先按照提示,进行debug:在程序的运行开始之前加上环境变量

import os
os.environ['CUDA_LAUNCH_BLOCKING']='1'

可以很快的发现有一个usewarning

UserWarning: 
NVIDIA GeForce RTX 3090 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.
If you want to use the NVIDIA GeForce RTX 3090 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))

 这一段的提示是我的显卡是3090的,算力与我安装的pytorch版本不对应。我查看了一下我的pytorch版本:

import torch
print(torch.__version__)
###
'1.12.1+cu102'

可以看到我的pytorch版本是1.12.1的版本,版本太低了,因此需要升级pytorch的版本。升级pytorch的版本很多,可以直接从官网上下载最新的版本。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值