Skip to content

gdb.rocm: step-schedlock-spurious-waves.cpp: Use inlined asm for breakpoint - #302

Merged
lumachad merged 1 commit into
amd-stagingfrom
users/akondrat/spurious-waves-fix
Aug 25, 2026
Merged

gdb.rocm: step-schedlock-spurious-waves.cpp: Use inlined asm for breakpoint#302
lumachad merged 1 commit into
amd-stagingfrom
users/akondrat/spurious-waves-fix

Conversation

@akondrat-amd

Copy link
Copy Markdown
Contributor

On gfx1250 the original code did not achieve full wavefront occupancy; VGPR pressure was created by the unoptimized function call and for loop.

Instead of relying on optnone + an empty end_of_kernel function as a breakpoint site, use forceinline with volatile inline assembly (s_nop 0). This guarantees the instruction is emitted in-line in the kernel and cannot be optimized away, giving the debugger a reliable address to break on.

Move optnone to kern to keep the s_sleep calls from being optimized, and replace the counted loop with explicit s_sleep calls to make the stepping sequence clearer.

More details in Jira [AIROCGDB-552]

@akondrat-amd
akondrat-amd requested a review from a team as a code owner August 21, 2026 16:01
@lumachad

Copy link
Copy Markdown
Collaborator

We should go with either this one or #296. I've confirmed this one also works for O3 -flto. @lancesix ?

@lumachad

Copy link
Copy Markdown
Collaborator

We should go with either this one or #296. I've confirmed this one also works for O3 -flto. @lancesix ?

I'm fine with this fix. I just need it fixed so #245 is unblocked.

@lumachad lumachad 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.

Some automated comments. Otherwise this seems OK. Have you validated on other gfx architectures?

Comment thread gdb/testsuite/gdb.rocm/step-schedlock-spurious-waves.cpp
Comment thread gdb/testsuite/gdb.rocm/step-schedlock-spurious-waves.cpp
Comment thread gdb/testsuite/gdb.rocm/step-schedlock-spurious-waves.cpp Outdated
Comment thread gdb/testsuite/gdb.rocm/step-schedlock-spurious-waves.cpp Outdated
Comment thread gdb/testsuite/gdb.rocm/step-schedlock-spurious-waves.cpp
@akondrat-amd
akondrat-amd force-pushed the users/akondrat/spurious-waves-fix branch 2 times, most recently from 546dfad to 5a4cae9 Compare August 24, 2026 15:54
@lumachad

Copy link
Copy Markdown
Collaborator

Some automated comments. Otherwise this seems OK. Have you validated on other gfx architectures?

Thanks for the update @akondrat-amd. How was validation on other gfx arches?

…kpoint

On gfx1250 the original code did not achieve full wavefront
occupancy; VGPR pressure was created by the unoptimized function call
and for loop.

Instead of relying on optnone + an empty end_of_kernel function as a
breakpoint site, use __forceinline__ with volatile inline assembly
(s_nop 0).  This guarantees the instruction is emitted in-line in the
kernel and cannot be optimized away, giving the debugger a reliable
address to break on.

Move optnone to kern to keep the s_sleep calls from being optimized,
and replace the counted loop with explicit s_sleep calls to make the
stepping sequence clearer.
@lumachad
lumachad force-pushed the users/akondrat/spurious-waves-fix branch from 5a4cae9 to 4276b43 Compare August 25, 2026 12:15
@lumachad lumachad added the ci:run-all-archs Run ROCgdb tests across more gfx architectures (whenever available) label Aug 25, 2026

@lumachad lumachad 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.

This is OK.

@lumachad
lumachad merged commit 9284b57 into amd-staging Aug 25, 2026
22 of 27 checks passed
@akondrat-amd
akondrat-amd deleted the users/akondrat/spurious-waves-fix branch August 26, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-all-archs Run ROCgdb tests across more gfx architectures (whenever available)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants