Hi,
By running your script as CUDA_LAUNCH_BLOCKING=1 python your_script.py, you will get the same error but a potentially different stacktrace. This is because this disable the asynchronous part of the cuda api and the error will be raised as soon as it happens and not on the next cuda op that is unrelated.