0

I am trying to debug a program in cuda-gdb. I am able to successfully set breakpoints in code that runs on the host (CPU), but whenever I try to set a breakpoint in code that runs on the GPU, the debugger skips over the breakpoints and gives me the following error:

"warning: Cuda API error detected: cudaLaunchKernel returned (0x7)"

It then continues to successfully execute the rest of the code. How can I make these work?

DankMasterDan
  • 1,900
  • 4
  • 23
  • 35

1 Answers1

2

I was able to get the breakpoints to work based on this answer from NVIDIA dev forums. Namely, in the nvcc compiler options you need to limit the amount of registers used by using the maxrregcount flag, e.g:

nvcc -arch sm_60 -g -G -dc --maxrregcount=64 --compiler-options -Wall -std=c++14 basic.cu

(Note: to see how much registers you have, enter info cuda devices into cuda-gdb and check the Regs/Lane column)

DankMasterDan
  • 1,900
  • 4
  • 23
  • 35
  • I get "No Cuda devices" although `nvcc --version` shows correct output and I can compile and run, just not debug. – mLstudent33 Nov 26 '22 at 12:35