cuda-gdb and driver api loading ptx file

Hi - I am attempting to load a ptx file into a program using the driver api functions cuModuleLoad, cuModuleGetFunction, etc… but I’m having trouble using cuda-gdb to debug it, specifically I would like to set a breakpoint into my .ptx file which gets loaded with cuModuleLoad. Does anyone have any tips on how to accomplish this or a better option?


Hi, Justin!

For a hand-coded PTX (i.e. one with no debugging symbols) I’ve managed to set a breakpoint only on kernel (.entry) name.
However, almost nothing can be accomplished that way, save inspecting the kernel arguments.
Even that is painful, since one has to obtain a base address of the shared memory parameter space (via objdump, for example) and manually calculate the corresponding offsets.
I haven’t tried cuda-gdb on a PTX produced by nvcc with all the right symbols, though.