Skip to content

[MIOpen] Fix runtime kernel compilation issues#2510

Merged
DarylHawkinsAMD merged 8 commits intodevelopfrom
users/dahawkin/fix-kernel-compilation
Dec 16, 2025
Merged

[MIOpen] Fix runtime kernel compilation issues#2510
DarylHawkinsAMD merged 8 commits intodevelopfrom
users/dahawkin/fix-kernel-compilation

Conversation

@DarylHawkinsAMD
Copy link
Copy Markdown
Contributor

@DarylHawkinsAMD DarylHawkinsAMD commented Nov 6, 2025

Motivation

When generating the kernel compilation args for HIP RTC we were:

  • Adding --rocm-path=.. This is incorrect as the . resolves to the current directory, which is a temporary directory that contains the kernel code during runtime kernel compilation. This path does not contain a ROCm installation and adding this flag also disables the compiler's ability to automatically detect the ROCm installation location. In MIOpen CI's case this wasn't causing a failure because of the next point
  • Trying to add the ROCm headers location to the compilation flags by:
    • Looking at the value of the ROCM_PATH environment variable and using it
    • Falling back to using the hard-coded value /opt/rocm and appending /includes

In TheRock, ROCm will not be installed at /opt/rocm and its location generally should not be relied upon as it makes our library less portable. It was causing test failures after a recent compiler promotion in TheRock as we were relying on incorrect behaviour and only succeeding coincidentially in our own MIOpen CI environment due to ROCm being installed at /opt/rocm.

Technical Details

  • Remove hard-coded ROCm paths and but maintain the ability to use the ROCM_PATH environment variable

Test Plan

  • Full CI run

Test Result

  • Full CI run pending

Submission Checklist

…ariable from our HIP RTC interface. Clang already has the ability to both find ROCm on the machine and to take the value of ROCM_PATH from the environment if it's present.
@DarylHawkinsAMD DarylHawkinsAMD changed the title [MIOpen] Fix kernel runtime compilation issues & missing header guards [MIOpen] Fix kernel runtime compilation issues Nov 6, 2025
@DarylHawkinsAMD DarylHawkinsAMD changed the title [MIOpen] Fix kernel runtime compilation issues [MIOpen] Fix runtime kernel compilation issues Nov 6, 2025
@DarylHawkinsAMD DarylHawkinsAMD marked this pull request as ready for review November 12, 2025 16:48
@DarylHawkinsAMD DarylHawkinsAMD requested a review from a team as a code owner November 12, 2025 16:48
Copy link
Copy Markdown
Contributor

@JonathanLichtnerAMD JonathanLichtnerAMD left a comment

Choose a reason for hiding this comment

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

LGTM

@DarylHawkinsAMD DarylHawkinsAMD merged commit 5328e2f into develop Dec 16, 2025
40 checks passed
@DarylHawkinsAMD DarylHawkinsAMD deleted the users/dahawkin/fix-kernel-compilation branch December 16, 2025 16:44
assistant-librarian bot pushed a commit to ROCm/MIOpen that referenced this pull request Dec 16, 2025
[MIOpen] Fix runtime kernel compilation issues

## Motivation

When generating the kernel compilation args for HIP RTC we were:
* Adding `--rocm-path=.`. This is incorrect as the `.` resolves to the
current directory, which is a temporary directory that contains the
kernel code during runtime kernel compilation. This path does not
contain a ROCm installation and adding this flag also disables the
compiler's ability to automatically detect the ROCm installation
location. In MIOpen CI's case this wasn't causing a failure because of
the next point
* Trying to add the ROCm headers location to the compilation flags by:
* Looking at the value of the ROCM_PATH environment variable and using
it
* Falling back to using the hard-coded value `/opt/rocm` and appending
`/includes`

In TheRock, ROCm will not be installed at `/opt/rocm` and its location
generally should not be relied upon as it makes our library less
portable. It was causing test failures after a recent compiler promotion
in TheRock as we were relying on incorrect behaviour and only succeeding
coincidentially in our own MIOpen CI environment due to ROCm being
installed at `/opt/rocm`.

## Technical Details

* Remove hard-coded ROCm paths and but maintain the ability to use the
ROCM_PATH environment variable

## Test Plan

* Full CI run

## Test Result

* Full CI run pending

## Submission Checklist

- [X] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
ammallya pushed a commit that referenced this pull request Feb 3, 2026
[ROCm/composable_kernel commit: 0953932]
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.

2 participants