RuntimeError: cuda runtime error (30) : unknown error

Someone from Stackoverflow recommended to me to post my question here:

I’m getting a runtime error everytime I try to debug pytorch code for the second time. It seems like after restarting the ipython console some of the cuda programs are not canceled properly so that this error occurs while trying to rerun the code. Has anyone had the same experience / knows how to solve it? Is there a way to manually flush all cuda activities from my GPU?

I’m using

  • pytorch version 0.1.12_1
  • ipython 4.2.0
  • as IDE spyder 3.2.4.
  • cuda 8.0
  • Titan X (pascal)

Alternatively: Can someone tell me a working combination of pytorch / ipython / spyder versions? Maybe mine is simply buggy.

Hello,I have the same problem ,I also need help .Hope someone could tell us how to solve this problem.

i got the same problem, did you solve this for now?
can you tell me how to solve it?
Hoping for your reply.
Thanks in advance.


You’re using pytorch v0.1, please upgrade to 0.3 as many interface has changed since then.

thanks for replying,
i use this command " conda update pytorch torchvision ", but i can only update my pytorch to 0.2.
Can you tell me how to update?
Is that pytorch version 0.3 can only install in python3?

You might need to update your conda install to be able to use the latest version of pytorch.

Hi, I encounter the same problem. It can be repeated by the following link. Thank you very much in advance.

I encounter the same problem, but I can run my code through sublime-text 3 (sublime-text 3 was started as root (sudo)). Then I execute ‘sudo chmod 777 -R ~/anaconda2’, the problem disappeared.