When one types make dbg=1 in the :~/NVIDIA_GPU_Computing_SDK/C$ it will of course compile the CUDA examples and allow one to
run cuda-gdb on the executable to walk through the program’s code. However, how does one get to all of the source code programs? For example matrixMul
has several programs that provide source code to the executable. They are
Makefile matrixMul.cu matrixMul_gold.cpp matrixMul.h matrixMul_kernel.cu
I want to walk through the code in matrixMul_kernel.cu (which has the subprogram matrixMul) it truly is the most interesting part of the program for me. But when I compile as decribed above and then issue the commmand;
everything is fine. When I issue the command break matrixMul (the program in matrixMul.cu) I get :
(cuda-gdb) break matrixMul
Function “matrixMul” not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (matrixMul) pending.
Now the idea is to get to the matrixMul subprogram (it is awkward that the subprogram and the main program’s computer file have the same name:matrixMul).
First, it puts a conditional on this break point (I answer yes) and an when I run the program it goes to the end not stopping in matrixMul.
Starting program: /home/errol/NVIDIA_GPU_Computing_SDK/C/bin/linux/debug/matrixMul
[Thread debugging using libthread_db enabled]
[New process 27468]
[New Thread 140314278946560 (LWP 27468)]
Processing time: 1.270000 (ms)
Press ENTER to exit…
How do I stop at matrixMul in matrixMul_kernel.cu so I can walk through the code?
All I can think of is that the CUDA program source is in a separate computer file and that may be a reason it skips over the source.
What is happening here?
Of course, I shut down Xwindows before starting this debugging session. It just does not stop at matrixMul which is a CUDA program.