Closing this — after further investigation the root cause turned out
not to be a multiarch discovery gap in CMake.
The failure only happened because the HIP compiler-id probe was broken: the
test compiled with the unversioned /usr/bin/clang++ (clang-21) while
rocm-device-libs-22 ships its bitcode in clang-22's resource dir. clang-21
couldn't find the device libs, so the compiler-id came back
"unknown", and with no compiler-id output CMake had nothing to parse
CMAKE_HIP_LIBRARY_ARCHITECTURE from — which is why it fell back to searching
only /usr/lib and /usr/lib64 and reported "does not contain the HIP runtime
CMake package".
Once the toolchain is matched (clang-22 with device-libs-22),
project(LANGUAGES HIP) configures cleanly with no hint and no patched
CMake. CMake's own mechanism does the right thing — from
CMakeConfigureLog.yaml:
Parsed HIP library architecture from compiler id output:
x86_64-linux-gnu
That populates the existing if(CMAKE_HIP_LIBRARY_ARCHITECTURE) branch in
CMakeDetermineHIPCompiler.cmake, which finds the multiarch
hip-lang-config.cmake directly. Note CMAKE_LIBRARY_ARCHITECTURE was empty (not
a HIP-language thing), so the LP #2143705 fallback wasn't involved at
all — the upstream path handled it.
So no CMake change is needed here (neither the CMAKE_LIBRARY_ARCHITECTURE
fallback nor a dpkg-architecture one). The only residual nit is cosmetic: when
the HIP compiler-id probe fails, the "does not contain the HIP runtime CMake
package" error is misleading — it'd be friendlier
to say the HIP compiler is broken / ROCm device libraries weren't found. Not
worth tracking here; closing.
The rocm-hipamd side is fixed by aligning the test/toolchain to
clang-22.
** Changed in: cmake (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2156062
Title:
CMakeDetermineHIPCompiler multiarch fallback fails for HIP-only
projects
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/2156062/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs