Is the code running fine on CPU?
Usually the error messages on the CPU side are a bit clearer to understand.
If so, try to run your code with CUDA_LAUNCH_BLOCKING=1 python script.py args and post the stack trace again, since CUDA calls are asynchronous and the current stack trace might point to a wrong code location.