Skip to content

gdb/testsuite: add HIP graph-launch kernel debugging test#197

Open
spatrang wants to merge 1 commit into
amd-stagingfrom
users/spatrang/hip-graph-launch-tests
Open

gdb/testsuite: add HIP graph-launch kernel debugging test#197
spatrang wants to merge 1 commit into
amd-stagingfrom
users/spatrang/hip-graph-launch-tests

Conversation

@spatrang

@spatrang spatrang commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new gdb.rocm dejagnu test, hip-graph-launch, covering debugging of
kernels dispatched through a HIP graph (hipGraphLaunch) rather than a plain
kernel<<<>>>() launch. The program captures two kernels (add_one then
times_three) from a stream into a single graph, instantiates it, and replays
it 3 times; each replay computes out = (out + 1) * 3 (0 -> 3 -> 12 -> 39).

The test exercises the graph-specific debugger behavior:

  • pending breakpoints in graph-launched kernels resolve and hit,
  • both graph nodes stop in order on every replay (dispatch numbering / re-dispatch),
  • correct per-replay data is observed at each node,
  • symbol breakpoint + backtrace + kernel-argument inspection,
  • single-stepping inside a graph-launched kernel mutates device memory,
  • info dispatches reports the active dispatch and associates it with the kernel.

Test plan

Validated 22/22 assertions under both GCC and LLVM host compilers on gfx942
(MI300X), against:

  • locally built ROCgdb (gdb 18.0.50), and
  • nightly ROCm 7.14 rocgdb (gdb 16.3).

JIRA

AIROCGDB-580

@spatrang spatrang requested a review from a team as a code owner July 8, 2026 09:24
@spatrang spatrang marked this pull request as draft July 8, 2026 09:40
@spatrang spatrang marked this pull request as ready for review July 8, 2026 10:17
@spatrang spatrang force-pushed the users/spatrang/hip-graph-launch-tests branch from e542624 to d32f447 Compare July 10, 2026 10:19
@spatrang

Copy link
Copy Markdown
Contributor Author

Rebased onto latest amd-staging to pick up the record-full.c build fix and re-trigger CI.

@lancesix lancesix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments for now, will get a deeper review at a later time.

Comment thread gdb/testsuite/gdb.rocm/hip-graph-launch.cpp Outdated
Comment thread gdb/testsuite/gdb.rocm/hip-graph-launch.cpp Outdated
Comment thread gdb/testsuite/gdb.rocm/hip-graph-launch.exp Outdated
@spatrang spatrang assigned spatrang and unassigned lancesix Jul 13, 2026
Add gdb.rocm/hip-graph-launch test covering debugging of kernels
dispatched via hipGraphLaunch (stream-captured graph, replayed).
@spatrang spatrang force-pushed the users/spatrang/hip-graph-launch-tests branch from d32f447 to 448cbc2 Compare July 13, 2026 10:15
@spatrang

spatrang commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review comments :

  • Use the shared CHECK macro from rocm-test-utils.h instead of a local copy.
  • num_elems is now constexpr.
  • Keep the replay count in sync: the .exp passes -DNUM_REPLAYS=$num_replays and the source guards the define with #ifndef (per the nonstop-mode.exp pattern).

Also rebased onto latest amd-staging.

@spatrang spatrang removed their assignment Jul 13, 2026
@spatrang spatrang marked this pull request as draft July 13, 2026 14:58
@spatrang spatrang marked this pull request as ready for review July 13, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants