>>(); cudaDeviceSynchronize(); return 0; } It looks like stepping via gdb/mi doesn’t work. When the breakpoint is reached, cuda-gdb reports that the program is stopped on thread-id=1: <*stopped,CudaFocus={device="0",sm="0",warp="0",lane="0",kernel="0",grid="1",blockIdx="(0,0,0)",threadIdx="(0,0,0)"},reason="break...">

Cuda-gdb client via the gdb/mi interface (original) (raw)

February 15, 2025, 4:52pm 1

I’m debugging the following program using cuda-gdb 12.8:

#include <cstdio>

__global__ void kernel() {
  printf("ok\n"); //break
  printf("ok\n");
}

int main() {
  kernel<<<1, 1>>>();
  cudaDeviceSynchronize();
  return 0;
}

It looks like stepping via gdb/mi doesn’t work. When the breakpoint is reached, cuda-gdb reports that the program is stopped on thread-id=1:

<*stopped,CudaFocus={device="0",sm="0",warp="0",lane="0",kernel="0",grid="1",blockIdx="(0,0,0)",threadIdx="(0,0,0)"},reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000000701a4e610",func="kernel",args=[],file="/home/nd/w/a/CLionProjects/cuda-test/main.cu",fullname="/home/nd/w/a/CLionProjects/cuda-test/main.cu",line="4",arch="m68k"},thread-id="1",stopped-threads="all",core="10"

An attempt to step to the next line using the -exec-next command fails with the error:

>38-exec-next --thread 1
<38^error,msg="Cannot find bounds of current function"

Is it possible to use cuda-gdb via gdb/mi interface? If it is possible, what commands should be used?

veraj February 20, 2025, 4:54am 2

Hi, @dmitry.neverov

Thanks for using cuda-gdb. Regarding to gdb/mi interface, our dev plan on documenting this in the future but at the moment it is not officially supported.

veraj Closed March 6, 2025, 4:54am 3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.