Skip to content

rocclr: Prioritize local rocr-runtime headers over system paths#5936

Merged
agunashe merged 2 commits into
developfrom
users/agunashe/rocr_find_package
May 13, 2026
Merged

rocclr: Prioritize local rocr-runtime headers over system paths#5936
agunashe merged 2 commits into
developfrom
users/agunashe/rocr_find_package

Conversation

@agunashe
Copy link
Copy Markdown
Contributor

@agunashe agunashe commented May 8, 2026

Fixes build errors where CMake finds outdated HSA headers in system paths instead of the local rocr-runtime

Changes applied to windows builds using ROCclrHSA.cmake:

  • Reorder find_path/find_package to search local rocr-runtime first
  • Add NO_DEFAULT_PATH to prevent system path searches
  • Covers Windows (AMD_COMPUTE_WIN)

Motivation

when building hip, the headers and libs should be obtained locally first then at the system level.
User can have multiple rocms installed at system level. During hip build, user expects the local rocr/hsa to be picked first

Technical Details

changing the search order of rocr headers and libs, so the expected Libs/headers are picked for the hip build

JIRA ID

NA

Test Plan

Rock build passes and local hip build passes

Test Result

Rock build passes and local hip build passes

Submission Checklist

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates ROCclr’s HSA dependency discovery to prefer in-tree / locally built rocr-runtime over headers and libraries found via default system search paths, avoiding accidental picks of outdated HSA installations during HIP/ROCclr builds.

Changes:

  • Reordered find_path() HSA header lookup (Windows + PAL backend) to search local rocr-runtime/staged build outputs first.
  • Expanded PATHS entries to include local source and staged build directories.

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

Comment thread projects/clr/rocclr/cmake/ROCclrHSA.cmake Outdated
agunashe and others added 2 commits May 12, 2026 13:13
Fixes build errors where CMake finds outdated HSA headers in system paths (e.g., C:/opt/rocm) instead of the local rocr-runtime, causing missing constant errors like HSA_STATUS_ERROR_INVALID_DISPATCH_PARAMETERS.

Changes applied to all platforms in ROCclrHSA.cmake:
- Reorder find_path/find_package to search local rocr-runtime first
- Add NO_DEFAULT_PATH to prevent system path searches
- Covers Windows (AMD_COMPUTE_WIN), Linux (UNIX), and Windows PAL backend

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@agunashe agunashe force-pushed the users/agunashe/rocr_find_package branch from 04eb979 to f65ab2b Compare May 12, 2026 20:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread projects/clr/rocclr/cmake/ROCclrHSA.cmake
@agunashe agunashe merged commit 198563a into develop May 13, 2026
44 of 47 checks passed
@agunashe agunashe deleted the users/agunashe/rocr_find_package branch May 13, 2026 23:43
systems-assistant Bot pushed a commit to ROCm/clr that referenced this pull request May 13, 2026
 paths (#5936)

Fixes build errors where CMake finds outdated HSA headers in system
paths instead of the local rocr-runtime

Changes applied to windows builds using ROCclrHSA.cmake:
- Reorder find_path/find_package to search local rocr-runtime first
- Add NO_DEFAULT_PATH to prevent system path searches
- Covers Windows (AMD_COMPUTE_WIN)

## Motivation
when building hip, the headers and libs should be obtained locally first
then at the system level.
User can have multiple rocms installed at system level. During hip
build, user expects the local rocr/hsa to be picked first

## Technical Details
changing the search order of rocr headers and libs, so the expected
Libs/headers are picked for the hip build

## JIRA ID
NA

## Test Plan
Rock build passes and local hip build passes

## Test Result
Rock build passes and local hip build passes

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
[rocm-systems] ROCm/rocm-systems#5936 (commit 198563a)
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.

3 participants