Skip to content

feat(rocprofiler-sdk): enable ATT (Advanced Thread Trace) on WSL - #12634

Merged
ihhethan merged 3 commits into
developfrom
users/ihhuang/wsl-rocprofv3-att-v2
Oct 5, 2026
Merged

ihhethan merged 3 commits into
developfrom
users/ihhuang/wsl-rocprofv3-att-v2

Conversation

@ihhethan

@ihhethan ihhethan commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Enable rocprofv3 thread trace (--att) support on WSL2, completing the ATT portion of the WSL2 enablement introduced in #7016.

Previously, the ATT samples and tests only searched ${ROCM_PATH} for rocprof-trace-decoder. As a result, separately built decoders could not be detected, causing the corresponding ATT tests to be skipped.

Technical Details

  • Shared decoder lookup: Added a new rocprofiler_sdk_find_trace_decoder() macro to rocprofiler-sdk-utilities.cmake, replacing five duplicated find_library blocks across the ATT samples and tests. The lookup now searches ROCPROFILER_SDK_TRACE_DECODER_ROOT before ${ROCM_PATH}. If ROCPROFILER_SDK_TRACE_DECODER_ROOT is not set, the existing behavior remains unchanged.

  • att-no-intercept test gating: This test requires multi-buffer thread trace support, which is currently available only on MI3xx and gfx12. On unsupported platforms, the test could time out. It now uses the existing rocprofiler_sdk_sqtt_triple_buffer_disabled() check to skip the test where multi-buffer support is unavailable.

  • WSL2 documentation: Added a Thread trace (ATT) section to the WSL2 how-to covering:

    • ATT decoder setup
    • HSA runtime path configuration when /dev/kfd is unavailable
    • The current --selected-regions limitation on WSL2

    ATT has also been removed from the Not covered on WSL2 section.

No C++ changes are included in this PR.

Validation

Validated rocprofv3 --att on the following WSL2 platform:

  • Environment: WSL2 on Windows
  • GPU: AMD Radeon 890M
  • GPU target: gfx1150 (RDNA 3.5)
  • Platform: AMD Strix Point notebook
  • OS: Ubuntu 24.04 under WSL2

ATT trace collection and decoding were verified successfully on this configuration.

No C++ changes are included in this PR.

Issue Tracking

JIRA ID: ROCM-23912

Test Plan

WSL2, gfx1150 (no /dev/kfd), ROCr/librocdxg/SDK built from this branch, rocprof-trace-decoder 0.2.2 found via ROCPROFILER_SDK_TRACE_DECODER_ROOT.

  • ctest -R 'att|thread-trace|thread_trace'
  • rocprofv3 --att --kernel-trace -- simple-transpose

Test Result

  • ctest: 165/171 passed; thread-trace-sample and rocattach 12/12 pass; att-no-intercept is now Disabled on gfx1150.
  • rocprofv3 --att: both dispatches captured and decoded.
  • 6 failures, unrelated to this change: 5 × unit.thread_trace.* caused by the ctest-baked LD_LIBRARY_PATH (they pass when run directly), and the att-marker-trace validate (--selected-regions gives an empty trace on WSL2, documented).

Submission Checklist

The thread_trace and kernel_replay samples and the advanced-thread-trace,
att-consecutive-kernels and roctx-pause-resume/att tests each carried a
copy of the same find_library + find_package_handle_standard_args block,
and every copy searched only ${ROCM_PATH}. A decoder that is not installed
under ROCm, such as a standalone decoder build used on WSL2, was therefore
never found and the thread trace tests were skipped.

Move the lookup into rocprofiler_sdk_find_trace_decoder() in
rocprofiler-sdk-utilities.cmake and use it from all five places. The macro
searches ROCPROFILER_SDK_TRACE_DECODER_ROOT ahead of ${ROCM_PATH}; with the
variable unset the search is the same as before.
…s unsupported

--att-no-intercept programs multi-buffer thread trace, which aqlprofile
implements only for MI3xx and gfx12 and rejects with "Not supported"
elsewhere, so the test timed out on other architectures such as gfx11.
Gate it and its validate test on rocprofiler_sdk_sqtt_triple_buffer_disabled,
the check the triple-buffer thread trace tests already use.
--att works on WSL2: without /dev/kfd ROCprofiler-SDK takes the thread
trace buffers, signals and copies from the HSA runtime. Describe how the
decoder is located (--att-library-path, ROCPROF_ATT_LIBRARY_PATH, and
ROCPROFILER_SDK_TRACE_DECODER_ROOT for the tests and samples), note that
--selected-regions produced empty traces on WSL2, and narrow
"Not covered on WSL2" to PC sampling and SPM.
@ihhethan
ihhethan requested review from a team as code owners October 1, 2026 15:41
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: rocprofiler-sdk labels Oct 1, 2026
@therock-pr-bot

therock-pr-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@ihhethan
ihhethan merged commit c06a5ba into develop Oct 5, 2026
289 of 300 checks passed
@ihhethan
ihhethan deleted the users/ihhuang/wsl-rocprofv3-att-v2 branch October 5, 2026 15:14
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation organization: ROCm project: rocprofiler-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants