Skip to content

fix(rocr): Export NUMA dependency regardless of BUILD_SHARED_LIBS - #9716

Merged
cgoea merged 2 commits into
developfrom
users/andmar-amd/hsakmt-numa-dependency-fix
Aug 10, 2026
Merged

cgoea merged 2 commits into
developfrom
users/andmar-amd/hsakmt-numa-dependency-fix

Conversation

@andmar-amd

Copy link
Copy Markdown
Contributor

When NUMA is found as an imported target (e.g., numa::numa), hsakmt's exported targets reference it. The generated hsakmt-config.cmake must call find_dependency(NUMA) to make that target available to consumers, otherwise find_package(hsakmt) fails with:

The link interface of target 'hsakmt::hsakmt' contains:
numa::numa
but the target was not found.

Previously, HSAKMT_FIND_NUMA_DEPENDENCY was only set ON when BUILD_SHARED_LIBS=ON. In standalone builds where BUILD_SHARED_LIBS may not be set, this caused the installed hsakmt-config.cmake to omit find_dependency(NUMA), breaking downstream consumers.

This fix removes the BUILD_SHARED_LIBS condition, ensuring the NUMA dependency is always exported when NUMA was found as a target, regardless of build configuration.

Also adds the find_dependency(NUMA) call to hsakmt-config.cmake.in with PATHS hint for bundled libnuma location.

Related to PR #9480 which fixed kfdtest's NUMA CONFIG mode handling.

JIRA ID: ROCM-28573

Motivation

See PR #8221 and PR #9480

Technical Details

Issue Tracking

Test Plan

Test Result

Submission Checklist

Copilot AI lite review requested due to automatic review settings August 5, 2026 15:18
@therock-pr-bot

therock-pr-bot Bot commented Aug 5, 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?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes hsakmt’s CMake package export so downstream find_package(hsakmt) works when libnuma was discovered as an imported target (e.g., numa::numa). It ensures the generated hsakmt-config.cmake proactively finds NUMA when needed, independent of BUILD_SHARED_LIBS.

Changes:

  • Add conditional find_dependency(NUMA) to hsakmt-config.cmake.in, with a PATHS hint for ROCm’s bundled libnuma location.
  • Remove the BUILD_SHARED_LIBS coupling by computing a dedicated HSAKMT_FIND_NUMA_DEPENDENCY configure-time flag based on whether NUMA was found as a target.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/rocr-runtime/libhsakmt/hsakmt-config.cmake.in Adds conditional NUMA dependency discovery prior to loading exported hsakmt targets.
projects/rocr-runtime/libhsakmt/CMakeLists.txt Introduces HSAKMT_FIND_NUMA_DEPENDENCY and enables it when NUMA is represented by imported targets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andmar-amd
andmar-amd force-pushed the users/andmar-amd/hsakmt-numa-dependency-fix branch 2 times, most recently from 0bec152 to c9d702e Compare August 5, 2026 18:51
@shwetagkhatri
shwetagkhatri self-requested a review August 5, 2026 21:43

@shwetagkhatri shwetagkhatri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont see any issues with this patch. LGTM.

When NUMA is found as an imported target (e.g., numa::numa), hsakmt's
exported targets reference it. The generated hsakmt-config.cmake must
call find_dependency(NUMA) to make that target available to consumers,
otherwise find_package(hsakmt) fails with:

  The link interface of target 'hsakmt::hsakmt' contains:
    numa::numa
  but the target was not found.

Previously, HSAKMT_FIND_NUMA_DEPENDENCY was only set ON when
BUILD_SHARED_LIBS=ON. In standalone builds where BUILD_SHARED_LIBS
may not be set, this caused the installed hsakmt-config.cmake to
omit find_dependency(NUMA), breaking downstream consumers.

This fix removes the BUILD_SHARED_LIBS condition, ensuring the NUMA
dependency is always exported when NUMA was found as a target,
regardless of build configuration.

Also adds the find_dependency(NUMA) call to hsakmt-config.cmake.in
with PATHS hint for bundled libnuma location.

Related to PR #9480 which fixed kfdtest's NUMA CONFIG mode handling.

JIRA ID: ROCM-28573
@andmar-amd
andmar-amd force-pushed the users/andmar-amd/hsakmt-numa-dependency-fix branch from c9d702e to e7e0ea8 Compare August 6, 2026 21:21
@cgoea
cgoea merged commit b3252f0 into develop Aug 10, 2026
47 of 55 checks passed
@cgoea
cgoea deleted the users/andmar-amd/hsakmt-numa-dependency-fix branch August 10, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants