Hi Oana,

Can I reproduce this? This seems like a CUDNN bug, and if you give a way to reproduce this, NVIDIA will be interested to fix this.

Hi smth,

That’d be great. I’ve created this repo with the snli mode from pytorch examples and the dockerfile I used:

I’ve got the following error this time:

55901af1922b:/home/trial$ python 
downloading word vectors from
glove.42B.300d: 100%|████████████████████████████████████████████████████████████████████████████████████████████▉| 1.88G/1.88G [02:32<00:00, 8.12MB/s]extracting word vectors into /home/trial/.data_cache
glove.42B.300d: 1.88GB [03:26, 9.07MB/s]                                                                                                               
Loading word vectors from /home/trial/.data_cache/glove.42B.300d.txt
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 1917494/1917494 [06:24<00:00, 4987.26it/s]

  Time Epoch Iteration Progress    (%Epoch)   Loss   Dev/Loss     Accuracy  Dev/Accuracy
Traceback (most recent call last):
  File "", line 71, in <module>
    answer = model(batch)
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/trial/", line 71, in forward
    prem_embed = self.relu(self.projection(prem_embed))
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/trial/", line 12, in forward
    out = super(Bottle, self).forward(input.view(size[0]*size[1], -1))
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/", line 54, in forward
    return self._backend.Linear()(input, self.weight, self.bias)
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/_functions/", line 10, in forward
    output.addmm_(0, 1, input, weight.t())
RuntimeError: cublas runtime error : the GPU program failed to execute at /py/conda-bld/pytorch_1493674854206/work/torch/lib/THC/

Hope this helps.


Thank you. Reported to NVIDIA, will let you know if they suggest a workaround.

The problem is with your docker file, you are supposed to do
conda install -y pytorch cuda80 -c soumith
if you want to run on P100. FWIW, you would not have this problem if you used either devel Dockerfile (in pytorch root directory) or runtime Dockerfile (in tools/docker). You’d have to modify either of them to install torchtext and its dependencies, or, alternatively, build a base image with the provided Dockerfile and have a separate Dockerfile that would reference this base image in the FROM line and install whatever add-ons you need.

I am also getting the error, torch.backends.cudnn.CuDNNError: 8: b'CUDNN_STATUS_EXECUTION_FAILED'. Did anyone find any workaround to solve the issue?

Yes me too, I get this bug sometimes when training to 400 epochs.

I get this error as well from time to time. It’s hard to reproduce it, but it always happens in the middle of execution (so some epochs have correctly run without any trouble).

Never had this error before updating to the latest pytorch.
I’m doing one fairly complicated broadcasting operation, so I will take a look at the “Important Breakages and Workarounds” section in the docs and update.

I encountered this issue too. It seems to be related to passing too large of an input to the CUDNN RNN layer (in my case, a GRU). I found that reducing the batch size made the problem go away (and the original batch size would have been way too big for me not to run out of memory anyway since even with a smaller batch size that didn’t cause the error I still ran out of memory and had to reduce further). Also, for me it was not an intermittent problem but happened every time.


This happens also in the windows port of PyTorch, the only way to overcome this when using (in my case) large CNN’s is to use: torch.backends.cudnn.enabled=False.

Any update on this issue? I also encountered the same problem. The environment is:
GPU: GTX 1080
Driver Version: 384.111
Pytorch: 0.3.0.post4

The most likely reason you are encountering CUDNN_STATUS_EXECUTION_FAILED is that you have run out of memory. Unfortunately, when you run out of memory on the GPU, you can get one of a few different error messages, so it is not always obvious that this is what happened.

If you are completely sure you are not running out of memory then you should open a new issue and give specifics about your problem.

Note that the OP was (assuming ngimel was correct) encountering a different problem from you relating to using a P100 with the wrong version of PyTorch. Probably no one else who posted in this thread has had the OP’s problem, and it may well be that everyone else who posted in this thread has just run out of memory.

1 Like

i had this error while installing
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/pip/”, line 215, in main
status =, args)
File “/usr/local/lib/python3.5/dist-packages/pip/commands/”, line 342, in run
File “/usr/local/lib/python3.5/dist-packages/pip/req/”, line 784, in install
File “/usr/local/lib/python3.5/dist-packages/pip/req/”, line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File “/usr/local/lib/python3.5/dist-packages/pip/req/”, line 1064, in move_wheel_files
File “/usr/local/lib/python3.5/dist-packages/pip/”, line 345, in move_wheel_files
clobber(source, lib_dir, True)
File “/usr/local/lib/python3.5/dist-packages/pip/”, line 316, in clobber
File “/usr/local/lib/python3.5/dist-packages/pip/utils/”, line 83, in ensure_dir
File “/usr/lib/python3.5/”, line 241, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/torch’
please can you help.

Hi greaber, Thanks for your reply, I found that this problem happened when doing the evaluation(inference). Actually, during the inference, only one instance was used, which is pretty small. Also, I monitored the memory and it was not out-of-memory. I am really confused.

I just follow this repo, and try to run the code. seq2seq_batched

The error is:

torch.backends.cudnn.CuDNNError: 8: b’CUDNN_STATUS_EXECUTION_FAILED’

Hi ShilinHE, I can’t tell what the problem is from your description. I guess you will need to report more info to get help. But just monitoring memory usage won’t necessarily tell you if running out of memory is the issue since it could fail on a big allocation or very quickly rather than gradually running out of memory.

Hi, I had the same issue.

This is because of an error in the evaluate() function, the input_lengths array incorrectly contains the number of characters in the sentence, instead of the number of words. Replace

input_lengths = [len(input_seq)]


input_lengths = [len(input_seq.split())]

and the error should go away.

I had similar issue during evaluation only but as @greaber mentioned it was a memory issue. When I decrease the training batch size, it went away

@ngimel, it would be awesome if we could reliably get an “out of memory” error when running out of memory on the GPU.


Cannot agree more! Sometimes it turns out to be out of memory suddenly, and monitoring GPU does not work.

I had the same problem,
and cuda.empty_cache works for me

1 Like

This worked for me too