I followed the documentation, walk-through examples bitreverse;
After hitting the breakpoint, I switch to warp3;
Then type the continue command, and when it stops again, it automatically switches to warp0;
Is thisinconsistent with the description of the document？
Why do I only see the same thread hit the breakpoint every time; other warp/threads that hit the breakpoint are not displayed?
Even if I switch to warp 3; it doesn’t mean that the warp will hit the breakpoint, right？ Switching focus is useless, only displayed the warp which hits the breakpoint first and ignore the warp/thread that hits the breakpoint later;
When warp0 hits the breakpoint, some warps are before the breakpoint and some are after the breakpoint，
Is my understanding correct?
Thank you for the logs, now I can provide must better explanation. First of all, please note that execution is happening on the warp level (so all threads of the warp execute the same instruction/hit the breakpoint).
When running the bitreverse sample warps don’t diverge (so all warps are executing the same instructions), **which is not always the case **.
When warp 0 hits the first breakpoint, all warps hit it at the same time (note the PC addresses of the active warps). In such case debugger only reports single BP hit (for an arbitrary warp).
My question is will each warp stop when it hits a breakpoint? Like the thread of the cpu; or switch to a certain warp, only this warp can hit the breakpoint;
When BP is hit by a warp (or multiple warps if multiple warps arrive to it at the same time) all warps on GPU are stopped (docs link: CUDA-GDB)
When a breakpoint is set, it forces all resident GPU threads to stop at this location when it reaches the corresponding PC.
Focus doesn’t affect GPU side execution/breakpoints. It’s only used to specify current warp for debugger operations.
When a warp hits a breakpoint and stops, do all warps hit the breakpoint?
All warps, which are executing the same instructions as the warp, which hit the breakpoint. E.g. if due to some reason there is a divergence and warps 0-3 diverge from warps 4-7 the following might happen (one possible scenario):
Warps 0-3 hit the breakpoint 1 - debugger reports breakpoint for (e.g.) warp 0
Warps 4-7 hit the breakpoint 1 - debugger reports breakpoint for (e.g.) warp 4
Warps 0-3 hit the breakpoint 2 - debugger reports breakpoint for (e.g.) warp 0
Warps 4-7 hit the breakpoint 2 - debugger reports breakpoint for (e.g.) warp 4
Warps 0-3 hit the breakpoint 3 - debugger reports breakpoint for (e.g.) warp 0
Warps 4-7 hit the breakpoint 3 - debugger reports breakpoint for (e.g.) warp 4
That is to say, in any scenario, if there is no divergence , if the GDB reports that a certain warp hits a breakpoint,does it mean that all warps/threads have hit this BP;
Unlike CPU threads, each thread (GPU warps) hits the same breakpointonce;
I type the “where” command and see the result is that all warps run to the same line of code;