Skip to content

core: gate amdsmi WSL backend on THEROCK_ENABLE_WSL_ROCDXG - #7635

Merged
marifamd merged 1 commit into
mainfrom
users/marifamd/wsl-backend-gate
Sep 1, 2026
Merged

marifamd merged 1 commit into
mainfrom
users/marifamd/wsl-backend-gate

Conversation

@marifamd

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #7102, which added -DENABLE_WSL_BACKEND=ON to the amdsmi subproject unconditionally.

TheRock already has a switch for this component, THEROCK_ENABLE_WSL_ROCDXG (feature group WSL, off in default/CI builds). With the backend forced on, the two disagree:

  • Default builds ship an amdsmi WSL backend that dlopens librocdxg.so, while the wsl-rocdxg subproject that produces that library is not built. The dlopen just fails at runtime, so nothing breaks, but the code is dead weight in every default build.
  • ENABLE_WSL_BACKEND=ON is not dependency-free on the amdsmi side. It has a FATAL_ERROR gate requiring rocr-runtime/libhsakmt/include/hsakmt/rocdxg_smi.h, resolved through a hardcoded sibling path. That works today only because rocm-systems is checked out whole, and it is a build-time dependency default builds should not take on.

This makes the amdsmi flag follow TheRock's existing switch, matching the -DBUILD_TESTS=${THEROCK_BUILD_TESTING} pattern on the adjacent line. Turning on THEROCK_ENABLE_WSL_ROCDXG now builds both the bridge library and the amdsmi backend that consumes it.

JIRA ID

ROCM-28065

Test plan

Verified THEROCK_ENABLE_WSL_ROCDXG is a CACHE BOOL created by therock_add_feature, and that therock_finalize_features() (top-level CMakeLists.txt:277) runs well before add_subdirectory(core) (CMakeLists.txt:503), so the variable is in scope at the point of use.

Substitution checked for every state:

THEROCK_ENABLE_WSL_ROCDXG Emitted argument
OFF -DENABLE_WSL_BACKEND=OFF
ON -DENABLE_WSL_BACKEND=ON
undefined -DENABLE_WSL_BACKEND= (falsey; amdsmi's option(... OFF) default preserved, no error)
  • Default Linux build no longer compiles the WSL backend (restores pre-core: enable WSL backend for amdsmi on non-Windows #7102 artifact content)
  • THEROCK_ENABLE_WSL_ROCDXG=ON propagates ENABLE_WSL_BACKEND=ON to amdsmi
  • Windows unaffected (change stays inside the existing if(NOT WIN32) guard)
  • pre-commit run --files core/CMakeLists.txt docs/development/wsl_rocdxg.md passes

For reference, in run 32498518713 the compiler-runtime stage built amdsmi with the backend on and core-amdsmi_lib_generic grew from 29,896,091 to 30,051,269 bytes (+151 KB) versus main. That delta is what default builds stop carrying with this change.

The amdsmi WSL backend was enabled unconditionally, so default builds
shipped a backend that dlopens librocdxg.so while the wsl-rocdxg
subproject that produces that library stayed off. TheRock already has a
switch for this component; follow it instead of forcing the backend on.

Enabling the backend also makes amdsmi require
rocr-runtime/libhsakmt's rocdxg_smi.h at configure time, which is a
build-time dependency default builds should not take on.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@therock-pr-bot

therock-pr-bot Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@marifamd

Copy link
Copy Markdown
Contributor Author

This PR only needs to be merged if this PR doesn't make it in: ROCm/rocm-systems#10436

@marifamd

Copy link
Copy Markdown
Contributor Author

Doesn't look like my build time dependency removal changes will make it in 10.1, would be wise to merge this

@JeniferC99 JeniferC99 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.

lgtm

@marifamd
marifamd merged commit 82ad6d3 into main Sep 1, 2026
167 of 177 checks passed
@marifamd
marifamd deleted the users/marifamd/wsl-backend-gate branch September 1, 2026 05:19
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Sep 1, 2026
marifamd added a commit that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants