Can cuda-gdb just directly get all the execution logs of a kernel?

What I mean is that this execution log includes the assembly instructions, the values of registers in the instructions, the thread that is executing the current instruction, and the current thread’s active mask.
Can we?

Hi @halomoooonk
Thank you very much for the question.

What I mean is that this execution log includes the assembly instructions, the values of registers in the instructions, the thread that is executing the current instruction, and the current thread’s active mask.

While there is no direct way to get the execution trace from the debugger, you should be able to get this information from the interactive debugging session:

  • Assembly instruction can be obtained with the disas command. The current instruction is denoted with a => CUDA-GDB
  • Registers can be obtained from the info registers command. CUDA-GDB
  • The cuda command without arguments can be used to obtain specific information about current focus. For example:
(cuda-gdb) cuda block thread
block (0,0,0), thread (0,0,0)

The active mask can be obtained with info cuda warps :

(cuda-gdb) info cuda warps
  Wp Active Lanes Mask Divergent Lanes Mask          Active PC Kernel BlockIdx First Active ThreadIdx 
Device 0 SM 0
*  1        0x0000ffff           0x00000000 0x00007fffd328dff0      0  (0,0,0)                (0,0,0) 

You should be able to single step (using ni command) though your kernel and issue the instructions above on each step. Would that work for you?

Unfortunately cuda-gdb doesn’t support kernel execution trace or record/replay debugging.

Thanks, I got it.