Skip to content

Conversation

@lumachad
Copy link

@lumachad lumachad commented Nov 20, 2025

Motivation

Integrate ROCdbgapi and ROCR-debug-agent into TheRock (3 commits).

Please see the individual commit messages for more details. Alternatively, I could submit each commit as a separate PR, but the commits are a chain of changes where the next commit depends on the previous one.

Technical Details

3 commits that accomplish the following (in this specific order):

  • Add libbacktrace dependency to third-party/sysdeps/common
  • Add ROCdbgapi
  • Add ROCR-debug-agent

Test Plan

Validate that libbacktrace gets downloaded, built and that ROCdbgapi and ROCR-debug-agent get built correctly.

Test Result

Components build correctly under the many linux docker container.

Submission Checklist

Progress on #1885

@lumachad lumachad self-assigned this Nov 20, 2025
@lumachad lumachad added the enhancement New feature or request label Nov 20, 2025
@lumachad lumachad changed the title Users/lumachad/therock/debug tools integration 1 [debug-tools] Integrate ROCdbgapi and ROCR-debug-agent into TheRock Nov 20, 2025
Copy link
Contributor

@geomin12 geomin12 left a comment

Choose a reason for hiding this comment

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

some housekeeping comments! (i would definitely rely on Stella / Scott / Mika / Laura for more cmake-related reviews)

COMPILER_TOOLCHAIN
amd-llvm
CMAKE_ARGS
-DREQUIRE_THREADS=1
Copy link
Contributor

Choose a reason for hiding this comment

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

should we disable tests similar to rocr-debug-agent to avoid unnecessary bloat?

Copy link
Author

Choose a reason for hiding this comment

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

Is this about rocr-debug-agent-tests? If so, I've now made rocr-debug-agent-tests not include the test target unless ENABLE_TESTS is passed to the build. This is just a way to invoke tests via ctest, but it wouldn't be useful in the context of TheRock I suppose.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i see it! nvm on this comment then

)


##############################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI if this causes any build troubles, perfectly okay to land the tools in the artifacts first and then add tests on another PR

Copy link
Author

Choose a reason for hiding this comment

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

Great. It is actually our plan to make things build first and then look into testing within TheRock.

@geomin12 geomin12 requested review from HereThereBeDragons and lamikr and removed request for jayhawk-commits and marbre November 20, 2025 19:35
ROCdbgapi links in libbacktrace to aid debugging of crashes. So add
libbacktrace to sysdeps/common.

The sources are downloaded from top-of-tree github.

We do some light smoke testing to make sure the archive gets built.

NOTE: We're downloading the packaged sources from github, but we should
setup a S3 cache to download from.
* Motivation

Add the debug-tools feature that will serve as the home to all debug tools
projects we have: ROCdbgapi, ROCgdb and ROCR-debug-agent.

This commit adds the feature along with ROCdbgapi.

Please note this is restricted to Linux builds for now. Windows builds will
come at a later stage.

* Technical Details

This commit creates the minimal set of changes required to support the ROCm
debug tools in TheRock build platform.

It adds the following:

- New debug-tools features/subdirectory (updated main CMakeLists.txt)
- Adds ROCdbgapi as a submodule using github's amd-staging branch.
- Adds the main debug-tools/CMakeLists.txt file with instructions on how to
build the debug tools. At the moment this is just ROCdbgapi, named amd-dbgapi.
- Updates build_tools/fetch_sources.py
- Updates the documentation.
- Adds ROCdbgapi artifacts.

NOTE 1: ROCdbgapi will be added as a submodule of TheRock only temporarily until
a decision is made on the topic. It may be the case we will want to
migrate it to rocm-systems. But adding it as a submodule now allows us to
integrate the component into TheRock without having to wait for all the
rocm-systems migration steps to take place.

NOTE 2: To make integration and testing faster, we have a local
amd-dbgapi.cmake file that gets copied into the source directory before
builds. Later on these cmake changes will be integrated into ROCdbgapi
and the local file will be removed.

NOTE 3: Artifact scripting changes will come at a later date after the
testing requirements become clear.

* Test Plan

- Validate that ROCdbgapi builds and pulls its libbacktrace dependency.
- Validate that ROCdbgapi's shared object exists and matches the name.

* Test Result

All tests passed.
* Motivation

Add rocr-debug-agent to the debug tools feature, to be built alongside the
ROCdbgapi.

Please note this is restricted to Linux builds for now. Windows builds will
come at a later stage.

* Technical Details

- Add rocr-debug-agent as a submodule using github's amd-staging branch.
- Adjust debug-tools/CMakeLists.txt to handle the new rocr-debug-agent
component.
- Add rocr-debug-agent artifacts.

NOTE 1: Similarly to ROCdbgapi, rocr-debug-agent is integrated as a module only
temporarily so we can test the integration. It will be migrated to
rocm-systems later on. When that happens, we can update the build recipes.

NOTE 2: As with ROCdbgapi, we have a local cmake build file that gets copied
prior to building the component. This is to speed up integration and testing
and the local cmake file will be removed in the future and its modification
pushed to rocr-debug-agent.

NOTE 3: Artifact scripting changes will come at a later date after the
testing requirements become clear.

* Test Plan

- Validate that rocr-debug-agent builds and pulls its amd-dbgapi dependency.
- Validate that rocr-debug-agent shared object and test binary exists and
matches the required names.

* Test Result

All tests passed.
@lumachad lumachad force-pushed the users/lumachad/therock/debug-tools-integration-1 branch from 815c0a4 to 6190993 Compare November 21, 2025 10:16
@lumachad
Copy link
Author

I've updated the series with the proposed fixups so far:

  • Download libbacktrace tarball from the S3 cache.
  • Conditionally add the rocr-debug-agent-tests test target if ENABLE_TESTS is passed.
  • Misc documentation updates on debug-tools/rocr-debug-agent-tests.cmake
  • Updated docs/development/windows_support.md that I had missed before (thanks Jason).

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants