Try to run your code on the CPU and see, if you get a proper error message.
If it’s running fine on the CPU, run the script on the GPU again via:
CUDA_LAUNCH_BLOCKING=1 python script.py args

which should give you a stacktrace pointing out the line of code, which raised the issue.