lina
lina

Reputation: 1707

using nsight to debug

I am using NSight to debug my CUDA code and I have question: how can I place a breakpoint for a specific thread and block?

When I place a breakpoint on the kernel the debugger always stops at thread 0 of block 0.

Upvotes: 2

Views: 1584

Answers (2)

scatman
scatman

Reputation: 14575

try to use CUDA Debug Focus. you can debug any thread in any block you want...

Upvotes: 4

talonmies
talonmies

Reputation: 72372

As discussed in the online help in Nsight, you can set a breakpoint and make it conditional on block and thread id like this:

To set a block or thread condition on a CUDA C breakpoint:

  1. Set a breakpoint on a line of source code.
  2. Right-click on the breakpoint.
  3. From the drop-down menu, select Condition...
  4. Type:

    @blockIdx(0,2,0) && @threadIdx(5,0,0)

  5. Click OK. The breakpoint glyph shows a plus sign.

Upvotes: 9

Related Questions