Repository navigation
[CLR][Windows] Make Comgr DLL name configurable via CMake - #4211
Merged
Merged
Conversation
…ning Replace the runtime is_versioned parameter in Comgr::LoadLib with a CMake cache variable COMGR_DLL_NAME. This simplifies the DLL loading logic and allows the DLL name to be configured at build time rather than computed at runtime based on HIP version numbers. Co-Authored-By: Claude <noreply@anthropic.com>
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
Mar 30, 2026
Add a patch for rocm-systems that replaces the runtime is_versioned logic in Comgr::LoadLib with a CMake-configured COMGR_DLL_NAME compile definition. This allows TheRock to control the Comgr DLL name at build time (defaulting to amd_comgr.dll) without waiting for the upstream CLR change (rocm-systems PR #4211) to merge. Upstream PR: ROCm/rocm-systems#4211 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@ROCm/lrt-build-infra this one is ready for review |
3 tasks
agunashe
reviewed
Apr 14, 2026
agunashe
approved these changes
Apr 20, 2026
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
Apr 20, 2026
## Summary Replace the deferred `set_target_properties` hack in the Comgr pre-hook with the `COMGR_DLL_NAME` cache variable introduced by ROCm/llvm-project#1278 (merged). Also pass `COMGR_DLL_NAME` to CLR builds so that ROCm/rocm-systems#4211 (pending) is picked up automatically when the submodule bumps. This is a transitional change — no patches, no submodule bumps. Both mechanisms keep the versioned DLL name (`amd_comgr0702.dll`) so existing CLR runtime loading logic continues to work. **Supersedes #4056** (same goal, different approach — pre-hook instead of patches). ### Transition matrix (Windows) | Comgr | CLR | Comgr DLL name | CLR loads | Match? | |-------|-----|----------------|-----------|--------| | Old (current) | Old (current) | Versioned via deferred fallback | Versioned via runtime logic | ✓ | | New (post llvm-project#1278) | Old | Versioned via `COMGR_DLL_NAME` cache var | Versioned via runtime logic | ✓ | | New | New (post rocm-systems#4211) | Versioned via `COMGR_DLL_NAME` cache var | Versioned via `COMGR_DLL_NAME` compile def | ✓ | ### Follow-up cleanup (separate PR, after both submodules bump) - Remove `COMGR_DLL_NAME` from pre-hook and CLR `CMAKE_ARGS` (both default to `amd_comgr.dll`) - Remove deferred `set_target_properties` fallback - Optionally remove `THEROCK_HIP_MAJOR/MINOR_VERSION` from amd-comgr `CMAKE_ARGS` ## Test plan - [ ] Linux CI passes (all new logic is `if(WIN32)` guarded — no-op on Linux) - [ ] Windows CI produces correctly named Comgr DLL - [ ] CLR loads Comgr successfully at runtime on Windows Co-authored-by: Claude <noreply@anthropic.com>
amd-chiranjeevi
pushed a commit
to ROCm/TheRock
that referenced
this pull request
Apr 21, 2026
## Summary Replace the deferred `set_target_properties` hack in the Comgr pre-hook with the `COMGR_DLL_NAME` cache variable introduced by ROCm/llvm-project#1278 (merged). Also pass `COMGR_DLL_NAME` to CLR builds so that ROCm/rocm-systems#4211 (pending) is picked up automatically when the submodule bumps. This is a transitional change — no patches, no submodule bumps. Both mechanisms keep the versioned DLL name (`amd_comgr0702.dll`) so existing CLR runtime loading logic continues to work. **Supersedes #4056** (same goal, different approach — pre-hook instead of patches). ### Transition matrix (Windows) | Comgr | CLR | Comgr DLL name | CLR loads | Match? | |-------|-----|----------------|-----------|--------| | Old (current) | Old (current) | Versioned via deferred fallback | Versioned via runtime logic | ✓ | | New (post llvm-project#1278) | Old | Versioned via `COMGR_DLL_NAME` cache var | Versioned via runtime logic | ✓ | | New | New (post rocm-systems#4211) | Versioned via `COMGR_DLL_NAME` cache var | Versioned via `COMGR_DLL_NAME` compile def | ✓ | ### Follow-up cleanup (separate PR, after both submodules bump) - Remove `COMGR_DLL_NAME` from pre-hook and CLR `CMAKE_ARGS` (both default to `amd_comgr.dll`) - Remove deferred `set_target_properties` fallback - Optionally remove `THEROCK_HIP_MAJOR/MINOR_VERSION` from amd-comgr `CMAKE_ARGS` ## Test plan - [ ] Linux CI passes (all new logic is `if(WIN32)` guarded — no-op on Linux) - [ ] Windows CI produces correctly named Comgr DLL - [ ] CLR loads Comgr successfully at runtime on Windows Co-authored-by: Claude <noreply@anthropic.com>
chrispaquot
approved these changes
Apr 21, 2026
This was referenced Apr 21, 2026
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
Apr 23, 2026
…nges Follow-up cleanup to #4535. With both ROCm/llvm-project#1278 (Comgr) and ROCm/rocm-systems#4211 (CLR) included in TheRock's submodule pins, the versioned-name bridging code is no longer needed. Both Comgr and CLR now default to amd_comgr.dll on Windows. Changes: - compiler/pre_hook_amd-comgr.cmake: drop the COMGR_DLL_NAME cache var and deferred set_target_properties fallback. - core/CMakeLists.txt: drop the _comgr_dll_name computation and the -DCOMGR_DLL_NAME=... args passed to hip-clr and ocl-clr. - compiler/CMakeLists.txt: drop -DTHEROCK_HIP_MAJOR_VERSION and -DTHEROCK_HIP_MINOR_VERSION from amd-comgr CMAKE_ARGS; new Comgr no longer reads them. Co-Authored-By: Claude <noreply@anthropic.com>
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
Apr 23, 2026
Add a patch for rocm-systems that replaces the runtime is_versioned logic in Comgr::LoadLib with a CMake-configured COMGR_DLL_NAME compile definition. This allows TheRock to use the new amd_comgr.dll name without waiting for the upstream CLR change to be picked up via submodule bump. Upstream PR: ROCm/rocm-systems#4211 Remove this patch once the rocm-systems submodule pin includes the upstream PR. Co-Authored-By: Claude <noreply@anthropic.com>
The CLR code changes in this PR don't actually require touching the TheRock CI workflow files. The earlier ref bumps were only added to test the CLR changes against a TheRock that included the matching COMGR_DLL_NAME wiring. Resetting the 7 therock-*.yml files to develop's current state. Once develop's TheRock ref naturally advances to include that wiring (TheRock PR #4535), this PR's CLR changes will pair correctly with no workflow edits needed here. Co-Authored-By: Claude <noreply@anthropic.com>
These files drifted from develop in earlier merges and have nothing to do with the CLR change in this PR. Co-Authored-By: Claude <noreply@anthropic.com>
…k-comgr-name-no-workflow
…k-comgr-name-no-workflow
Contributor
Author
|
@ROCm/rocm-systems-reviewers I think the failing checks are unreleated. Can we land this one? Thanks! |
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
May 6, 2026
…nges Follow-up cleanup to #4535. With both ROCm/llvm-project#1278 (Comgr) and ROCm/rocm-systems#4211 (CLR) included in TheRock's submodule pins, the versioned-name bridging code is no longer needed. Both Comgr and CLR now default to amd_comgr.dll on Windows. Changes: - compiler/pre_hook_amd-comgr.cmake: drop the COMGR_DLL_NAME cache var and deferred set_target_properties fallback. - core/CMakeLists.txt: drop the _comgr_dll_name computation and the -DCOMGR_DLL_NAME=... args passed to hip-clr and ocl-clr. - compiler/CMakeLists.txt: drop -DTHEROCK_HIP_MAJOR_VERSION and -DTHEROCK_HIP_MINOR_VERSION from amd-comgr CMAKE_ARGS; new Comgr no longer reads them. Co-Authored-By: Claude <noreply@anthropic.com>
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
May 20, 2026
…nges Follow-up cleanup to #4535. With both ROCm/llvm-project#1278 (Comgr) and ROCm/rocm-systems#4211 (CLR) included in TheRock's submodule pins, the versioned-name bridging code is no longer needed. Both Comgr and CLR now default to amd_comgr.dll on Windows. Changes: - compiler/pre_hook_amd-comgr.cmake: drop the COMGR_DLL_NAME cache var and deferred set_target_properties fallback. - core/CMakeLists.txt: drop the _comgr_dll_name computation and the -DCOMGR_DLL_NAME=... args passed to hip-clr and ocl-clr. - compiler/CMakeLists.txt: drop -DTHEROCK_HIP_MAJOR_VERSION and -DTHEROCK_HIP_MINOR_VERSION from amd-comgr CMAKE_ARGS; new Comgr no longer reads them. Co-Authored-By: Claude <noreply@anthropic.com>
lamb-j
added a commit
to ROCm/TheRock
that referenced
this pull request
May 20, 2026
…nges Follow-up cleanup to #4535. With both ROCm/llvm-project#1278 (Comgr) and ROCm/rocm-systems#4211 (CLR) included in TheRock's submodule pins, the versioned-name bridging code is no longer needed. Both Comgr and CLR now default to amd_comgr.dll on Windows. Changes: - compiler/pre_hook_amd-comgr.cmake: drop the COMGR_DLL_NAME cache var and deferred set_target_properties fallback. - core/CMakeLists.txt: drop the _comgr_dll_name computation and the -DCOMGR_DLL_NAME=... args passed to hip-clr and ocl-clr. - compiler/CMakeLists.txt: drop -DTHEROCK_HIP_MAJOR_VERSION and -DTHEROCK_HIP_MINOR_VERSION from amd-comgr CMAKE_ARGS; new Comgr no longer reads them. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
CLR's
Comgr::LoadLib()constructs the Comgr DLL filename at runtime by concatenatingHIP_MAJOR_VERSIONandHIP_MINOR_VERSIONcompile defs (e.g.,amd_comgr0702.dll). This couples CLR to a specific HIP-derived naming scheme and forces the Comgr build to produce a matching versioned name.Move the DLL name from a runtime computation to a build-time CMake configuration so that build systems (TheRock, Adrenaline Driver, etc.) can pick whatever DLL name is appropriate for their packaging.
Technical Details
Replace the runtime
is_versionedparameter inComgr::LoadLib()with a CMake cache variableCOMGR_DLL_NAMEthat's compiled into CLR as theCOMGR_DLL_NAMEpreprocessor macro.amd_comgr.dll-DCOMGR_DLL_NAME=custom_name.dllAligns with ROCm/llvm-project#1278 (merged), which adds the same
COMGR_DLL_NAMEcache variable to the Comgr build itself. With both changes in place, the ComgrOUTPUT_NAMEand the CLR load name are configured by a single source of truth.Use cases:
amd_comgr.dll, getting any version info from the DLL's version resource or via Comgr version APIs.amd_comgr_3.dll,amd_comgr_opencl.dll, etc.JIRA ID
N/A
Test Plan
CI builds and tests against TheRock with this change paired with a TheRock-side update that passes
-DCOMGR_DLL_NAME=...to both CLR builds.Test Result
To be filled in once CI completes.
Submission Checklist