Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find where does program crashed when Cuda API error detected: cudaMemcpy returned (0xb)

Tags:

c++

cuda

cuda-gdb

I am debugging a cuda program and got the following warning:

warning: Cuda API error detected: cudaMemcpy returned (0xb)

warning: Cuda API error detected: cudaMemcpy returned (0xb)

warning: Cuda API error detected: cudaGetLastError returned (0xb)

Error in kernel
GPUassert: invalid argument

when I type "where" in cuda-gdb, it says "no stack."

(cuda-gdb) where
No stack.

How should find where my program crashed ?

like image 947
Xing Shi Avatar asked Feb 19 '16 18:02

Xing Shi


1 Answers

Find the answer here : http://on-demand.gputechconf.com/gtc/2012/presentations/S0027A-Monday-Debugging-Experience-CUDA.pdf @ page 27.

You need to first:

(cuda-gdb) set cuda api_failures stop

Then when error happens, it will stop:

Cuda API error detected: cudaMemcpy returned (0xb)
(cuda-gdb) where
#0  0x00007fffea6a06d0 in cudbgReportDriverApiError () from       /usr/lib64/nvidia/libcuda.so.1
#1  0x00007fffea6a2c36 in cudbgReportDriverInternalError () from /usr/lib64/nvidia/libcuda.so.1
#2  0x00007fffea6eed93 in cudbgGetAPIVersion () from /usr/lib64/nvidia/libcuda.so.1
...
like image 111
Xing Shi Avatar answered Oct 26 '22 23:10

Xing Shi