smthPyTorch Dev, Facebook AI Research
Feb '17
Because of the asynchronous nature of cuda, the assert might not point to a full correct stack trace pointing to where the assert was triggered from.
if you run the program with CUDA_LAUNCH_BLOCKING=1 python script.py
this will help get a more exact stack trace
The blocking will make it run on CPU and may give you a more helpful trace
See RuntimeError: cuda runtime error (59) - #5 by smth - PyTorch Forums