Could you rerun the code via:
CUDA_LAUNCH_BLOCKING=1 python script.py args

and post the stack trace here?
Also, check the memory usage on your device, as this error message is sometimes raised instead of a proper message pointing towards an out of memory issue.