[PR #2516] [CLOSED] setup: Build on ROCm 10 (TheRock Packaging) #4090

Closed
opened 2026-11-07 15:33:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2516
Author: @brookpatten
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (4)

  • 2d3aec4 update build for the changes introduced by modern rocm versions
  • 18fddf3 remove extra comments
  • 78dbe83 fix order of clang/amdclang
  • 2582f14 fix order of clang/amdclang

📊 Changes

2 files changed (+16 additions, -7 deletions)

View changed files

📝 setup.py (+12 -5)
📝 tools/image/qimage.py (+4 -2)

📄 Description

Summary

Updates compilation to handle the changes in rocm 10

What changed

setup.py: detect ROCm toolchain layout instead of hardcoding ROCm 9 paths

ROCm 10 (TheRock packaging) moved the LLVM toolchain under core/: the compiler is now bin/amdclang++ (no more llvm/bin/clang++), headers live in core/include, and device bitcode is in core/lib/llvm/amdgcn/bitcode. Two hardcoded assumptions broke on that layout:

-DCMAKE_HIP_COMPILER pointed at the nonexistent llvm/bin/clang++. CMake treats a changed, missing compiler as a cache reset and silently reconfigures CPU-only — which drops the strata target from build.ninja, so the build dies with ninja: error: unknown target 'strata'.
--rocm-path / HIP_PATH pointed at the ROCm top level. With ROCm 10's clang, that skips injecting the HIP device runtime wrapper, so device-context math (fmaxf, fabsf, logf, __expf, …) resolves to host-only glibc declarations and every kernel .cu fails with "no matching function" (~44 errors across sampler, router_top10, quantize_act, …).
The fix detects which layout is present and picks the first path that exists, in both build_engine_hip and build_image_engine:

hip_compiler: bin/amdclang++ → llvm/bin/clang++ → core/lib/llvm/bin/clang++
rocm_inc (for HIP_PATH and --rocm-path): core when core/include exists, else the top level
bitcode path list gains core/lib/llvm/amdgcn/bitcode
Older ROCm layouts keep working — the previous paths remain in each fallback chain.

Verified on ROCm 10.1.0 / gfx1201 (Radeon AI PRO R9700): full clean build, engine launches, on cachyos with rocm-bin 10 installed from paru.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2516 **Author:** [@brookpatten](https://github.com/brookpatten) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`2d3aec4`](https://github.com/Niko1221/Strata/commit/2d3aec44299090d0592c5212617a700cdb7c31c0) update build for the changes introduced by modern rocm versions - [`18fddf3`](https://github.com/Niko1221/Strata/commit/18fddf3a61e25a15c8489dc29b5ba474bac3eea0) remove extra comments - [`78dbe83`](https://github.com/Niko1221/Strata/commit/78dbe83fe8afac93e57d6791d11836a71901f6bc) fix order of clang/amdclang - [`2582f14`](https://github.com/Niko1221/Strata/commit/2582f14509d15f3220dd4c2d1a4080efa6c61d24) fix order of clang/amdclang ### 📊 Changes **2 files changed** (+16 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+12 -5) 📝 `tools/image/qimage.py` (+4 -2) </details> ### 📄 Description ## Summary Updates compilation to handle the changes in rocm 10 ## What changed setup.py: detect ROCm toolchain layout instead of hardcoding ROCm 9 paths ROCm 10 (TheRock packaging) moved the LLVM toolchain under core/: the compiler is now bin/amdclang++ (no more llvm/bin/clang++), headers live in core/include, and device bitcode is in core/lib/llvm/amdgcn/bitcode. Two hardcoded assumptions broke on that layout: -DCMAKE_HIP_COMPILER pointed at the nonexistent llvm/bin/clang++. CMake treats a changed, missing compiler as a cache reset and silently reconfigures CPU-only — which drops the strata target from build.ninja, so the build dies with ninja: error: unknown target 'strata'. --rocm-path / HIP_PATH pointed at the ROCm top level. With ROCm 10's clang, that skips injecting the HIP device runtime wrapper, so device-context math (fmaxf, fabsf, logf, __expf, …) resolves to host-only glibc declarations and every kernel .cu fails with "no matching function" (~44 errors across sampler, router_top10, quantize_act, …). The fix detects which layout is present and picks the first path that exists, in both build_engine_hip and build_image_engine: hip_compiler: bin/amdclang++ → llvm/bin/clang++ → core/lib/llvm/bin/clang++ rocm_inc (for HIP_PATH and --rocm-path): core when core/include exists, else the top level bitcode path list gains core/lib/llvm/amdgcn/bitcode Older ROCm layouts keep working — the previous paths remain in each fallback chain. Verified on ROCm 10.1.0 / gfx1201 (Radeon AI PRO R9700): full clean build, engine launches, on cachyos with rocm-bin 10 installed from paru. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4090
No description provided.