码迷,mamicode.com
首页 > 其他好文 > 详细

CUDA error: device-side assert triggered

时间:2021-05-03 12:58:43      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:code   native   运行时   amp   ati   dev   size   font   index   

运行时出现下面的错误:

C:/cb/pytorch_1000000000000/work/aten/src/ATen/native/cuda/IndexKernel.cu:142: block: [0,0,0], thread: [17,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:/cb/pytorch_1000000000000/work/aten/src/ATen/native/cuda/IndexKernel.cu:142: block: [0,0,0], thread: [61,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:/cb/pytorch_1000000000000/work/aten/src/ATen/native/cuda/IndexKernel.cu:142: block: [0,0,0], thread: [62,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:/cb/pytorch_1000000000000/work/aten/src/ATen/native/cuda/IndexKernel.cu:142: block: [0,0,0], thread: [63,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
...
RuntimeError: CUDA error: device-side assert triggered

这是因为Tensor下标越界,造成CUDA断言错误,不让下标越界就正常了.

CUDA error: device-side assert triggered

标签:code   native   运行时   amp   ati   dev   size   font   index   

原文地址:https://www.cnblogs.com/mstk/p/14724470.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!