NVIDIA GPU Breakpoints
Breakpoints affect all GPU threads, and cause the program to stop when a thread reaches the breakpoint. Where kernels have similar workload across blocks and grids, threads tend to reach the breakpoint together and the kernel pauses once per set of blocks that are scheduled, that is, the set of threads that fit on the GPU at any one time.
Where kernels have divergent distributions of work across threads, timing may be such that threads within a running kernel hit a breakpoint and pause the kernel. After continuing, more threads within the currently scheduled set of blocks will hit the breakpoint and pause the program again.
To apply breakpoints to individual blocks, warps, or threads,
conditional breakpoints can be used. For example using the built-in
variables threadIdx.x
(and threadIdx.y
or threadIdx.z
as
appropriate) for thread indexes and setting the condition appropriately.