So if you use a plain Python int, the code works fine, but crashes randomly if you pass a np.int32?
Also, this issue still occurs on the latest master build?
Did you make sure to run your code with CUDA_LAUNCH_BLOCKING=1 python script.py args?
Otherwise the stack trace might point to the wrong line of code, since CUDA calls are asynchronous.