# Cublas runtime error

**URL:** <https://discuss.pytorch.org/t/cublas-runtime-error/11243>\
**Category:** Uncategorized\
**Created:** [December 17, 2017, 2:37am UTC](https://discuss.pytorch.org/t/cublas-runtime-error/11243 "2017-12-17T02:37:41Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mbarnes1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mbarnes1/32/2737_2.png) [@mbarnes1](https://discuss.pytorch.org/u/mbarnes1)\
**Post date:** [December 18, 2017, 5:02pm UTC](https://discuss.pytorch.org/t/cublas-runtime-error/11243/7 "2017-12-18T17:02:20Z")

</div>

Okay. Just to clarify, even though the traceback (below) shows the error at torch.nn.Linear and I’ve checked the inputs to this layer, the issue could be caused by advanced indexing happening somewhere else? Doesn’t exactly make sense to me, but I can certainly go through and check the indexing in the rest of my code. Thanks

Traceback (most recent call last):  
File “example\_server.py”, line 74, in   
validate\_every=100, validater\_examples=validater\_examples, validate\_examples\_every=1000, use\_cuda=True)  
File “/zfsauton/home/mbarnes1/aggrevated/aggrevated-coco/train.py”, line 61, in train  
\_, logprobs = decoder.forward(V, y\_0, state\_attention, state\_language, y\_true=caption\_true\_packed)  
File “/zfsauton/home/mbarnes1/aggrevated/aggrevated-coco/models/networks.py”, line 78, in forward  
(state\_language[0][0:batch\_size\_t], state\_language[1][0:batch\_size\_t]))  
File “/zfsauton/home/mbarnes1/aggrevated/aggrevated-coco/models/networks.py”, line 158, in forward  
v\_hat = self.attention.forward(V, new\_state\_attention[0]) # N x D  
File “/zfsauton/home/mbarnes1/aggrevated/aggrevated-coco/models/networks.py”, line 191, in forward  
V\_hidden = [self.image\_linear(v) for v in V] # List of length N, containing 1 x k x H  
File “/zfsauton/home/mbarnes1/miniconda2/envs/torch/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 325, in **call**  
result = self.forward(\*input, \*\*kwargs)  
File “/zfsauton/home/mbarnes1/miniconda2/envs/torch/lib/python2.7/site-packages/torch/nn/modules/linear.py”, line 55, in forward  
return F.linear(input, self.weight, self.bias)  
File “/zfsauton/home/mbarnes1/miniconda2/envs/torch/lib/python2.7/site-packages/torch/nn/functional.py”, line 837, in linear  
output = input.matmul(weight.t())  
File “/zfsauton/home/mbarnes1/miniconda2/envs/torch/lib/python2.7/site-packages/torch/autograd/variable.py”, line 386, in matmul  
return torch.matmul(self, other)  
File “/zfsauton/home/mbarnes1/miniconda2/envs/torch/lib/python2.7/site-packages/torch/functional.py”, line 191, in matmul  
output = [torch.mm](http://torch.mm)(tensor1, tensor2)  
RuntimeError: cublas runtime error : the GPU program failed to execute at /pytorch/torch/lib/THC/THCBlas.cu:246  
/pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor\_gatherKernel(TensorInfo\<Real, IndexType\>, TensorInfo\<Real, IndexType\>, TensorInfo\<long, IndexType\>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [29,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.

---

_[View the full topic](https://discuss.pytorch.org/t/cublas-runtime-error/11243)._
