Debugging CUDA How to step into a kernel function


I’m trying to debug the CUDA code, but I can’t step into any kernel function. I always get to the line, where the kernel function is called, then if I try to step in, the gdb outputs an information about new thread, but does not actually step in.
I tried to put some breakpoints into the kernel functions, but it still does not break on them.

Could anyone give me some advices. I would greatly appreciate any help on debugging kernel functions in any linux IDE (it doesn’t have to be gdb). Thanks

You need to compile in emudebug mode (nvcc -G -g -deviceemu

Thanks for fast reply… I got this

nvcc  -o ../bin/obj/emudebug/kdtraverse.cu_o -c  -G3 -D_DEBUG -DEBUG -emudebug  -deviceemu  -I ../inc -I. -I/usr/local/cuda/include -I../common/inc -DUNIX -g

nvcc fatal  : Unknown option 'emudebug'

Any ideas?

Thank you


My mistake, nvcc -G -g -deviceemu

Thanks… ehm… I have to admit my own stupidity. The compiler flags were OK, even on the very beginning of my debugging attemps. However, why I expected the kernel function to be executed, when the block dimension was set to (1,0,0), is the correct question, I should have asked myself first :ermm:.
Well, prof. Farnsworth would probably say:
“So, that’s what things would be like if I did invented the fing-longer… ohh… a man can dream… a man can dream.”

Thanks for the help anyway.