failed on cuStreamCreate: CUDA_ERROR_ILLEGAL_ADDRESS

  • an illegal memory access was encountered

I was executing a program that send tasks to GPU, the launch was successful, but the call back function returned CUresult status = CUDA_ERROR_ILLEGAL_ADDRESS.

Do you have any clue what could have happened? I know it maybe caused by illegal access to memory, but any suggestion to debug further or any detailed error message to get the context of what happened inside the kernel program?

cuda-memcheck may help. If you have no understanding of GPUs, and don’t want to learn, it probably won’t help.

coupled with the -lineinfo compile switch, cuda-memcheck can actually narrow the scope of the illegal address error down to a specific line of kernel code for you.

at that point, using in-kernel printf may be feasible

txbob, thanks for replying. I already found the bug in my kernel program. But your tip can help next time. Thanks.