Hi,
Illegal memory access error occur when your program is trying to access an memory location for which the program does not have permission to access.
By setting CUDA_LAUNCH_BLOCKING=1 , you can see where the error comes from.