Request: call cudaDeviceReset() after assert

Currently after a cuda assert in a REPL such as jupyter notebook, it’s necessary to restart the REPL since cudaDeviceReset() isn’t called after the assert. This makes it rather hard to prototype in such an environment, since every bug requires a complete restart!

Is there any reason not to always reset after a cuda assert? If this isn’t a trivial change, perhaps you at least surface a python wrapper for cudaDeviceReset() we could call from python code?


This issue has been coming up on a bit too so hopefully it’s OK to bump it since it’s been quite a while. @apaszke is this a reasonable idea?


This is a much needed feature for developing pytorch models in jupyter. This issue is preventing incremental development which is the essence of notebooks so that there is no need to re execute the entire code.

1 Like