rocmPackages.clr: don't use rocm-merged-llvm

This commit is contained in:
Luna Nova
2025-09-24 07:58:06 -07:00
parent d0194e29e9
commit f08fc581c3

View File

@@ -18,6 +18,7 @@
roctracer,
rocminfo,
rocm-smi,
symlinkJoin,
numactl,
libffi,
zstd,
@@ -26,7 +27,7 @@
libxml2,
libX11,
python3Packages,
rocm-merged-llvm,
llvm,
khronos-ocl-icd-loader,
gcc-unwrapped,
writeShellScriptBin,
@@ -35,7 +36,20 @@
let
inherit (rocm-core) ROCM_LIBPATCH_VERSION;
hipClang = rocm-merged-llvm;
# HIP_CLANG_PATH or ROCM_PATH/llvm
# Note: relying on ROCM_PATH/llvm is bad for cross
hipClang = symlinkJoin {
name = "hipClang";
paths = [
# FIXME: if we don't put this first aotriton build fails with ld.lld: -flavor gnu
# Probably wrapper jank
llvm.bintools.bintools
llvm.rocm-toolchain
];
postBuild = ''
rm -rf $out/{include,lib,share,etc,nix-support,usr}
'';
};
hipClangPath = "${hipClang}/bin";
wrapperArgs = [
"--prefix PATH : $out/bin"
@@ -84,6 +98,7 @@ stdenv.mkDerivation (finalAttrs: {
];
buildInputs = [
llvm.llvm
numactl
libGL
libxml2
@@ -101,6 +116,7 @@ stdenv.mkDerivation (finalAttrs: {
rocm-comgr
rocm-runtime
rocminfo
hipClangPath
];
cmakeBuildType = "RelWithDebInfo";
@@ -163,7 +179,8 @@ stdenv.mkDerivation (finalAttrs: {
--replace-fail "install(PROGRAMS \''${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)" ""
substituteInPlace hipamd/src/hip_embed_pch.sh \
--replace-fail "\''$LLVM_DIR/bin/clang" "${hipClangPath}/clang"
--replace-fail "\''$LLVM_DIR/bin/clang" "${hipClangPath}/clang" \
--replace-fail "\''$LLVM_DIR/bin/llvm-mc" "${lib.getExe' llvm.bintools.bintools "llvm-mc"}"
substituteInPlace opencl/khronos/icd/loader/icd_platform.h \
--replace-fail '#define ICD_VENDOR_PATH "/etc/OpenCL/vendors/";' \
@@ -207,7 +224,6 @@ stdenv.mkDerivation (finalAttrs: {
ln -s ${rocm-core}/.info/ $out/.info
ln -s ${hipClang} $out/llvm
ln -s ${hipClang}/bin/{ld.lld,lld,clang-offload-bundler,llvm-objcopy,clang,clang++} $out/bin/
'';
disallowedRequisites = [