CUDA GDB and conditional breakpoints

I am attempting to debug a program that is fairly simple. It basically does an operation on a pixel from each of two images then returns a third image. About half of the resulting image is correct and the second half is wrong. I am trying to set a conditional breakpoint such that when the thread id gets to a certain number (the index at which the image is no longer correct) it breaks and lets me look at the variables to see what is going wrong. When I break at the first kernel then set a conditional breakpoint to break when the thread id gets high enough within the kernel and run it, it takes an extremely long time and then returns a SIGTRAP. The thread id at this point is zero. So my question is first: is this the proper way to try to debug this or am I missing something much easier?

So I decided to try to narrow this down a little and see if cuda-gdb is functioning the way it is supposed to so i went through the cuda-gdb tutorial in this document: http://developer.download.nvidia.com/compu…DA_GDB_v3-0.pdf

After copying the code into a text document, running it in cuda-gdb, and setting the breakpoints. I run the program and it stops right after the kernel definition line at ‘{’ (line 9 in the source code in the pdf) then when i type next it just skips to the end of the kernel at the ‘}’ (line 19) completely ignoring the lines inbetween. I am logged into the machine I am running this on via ssh and the machine has no X server running (via init 3 run by root). NVCC version 3.0

Any hints of how to fix this would be greatly appreciated.

Once the program stops at the breakpoint which is set at the kernel function entrance, and then you can set up another breakpoint inside the kernel. You can try it. Even in the process of debugging, you can set up the breakpoint to let the program stop. Cuda-gdb 3.0 doesn’t support conditional breakpoint.