[staging-next] Reapply "onnxruntime,python3.pkgs.onnxruntime: fix runtime w/ glibc-2.42"

This reverts commit a2f23245d9.
This commit is contained in:
Gaetan Lepage
2026-01-21 21:37:40 +00:00
parent c401e76f8b
commit e50b405461
2 changed files with 26 additions and 20 deletions
+22 -20
View File
@@ -317,26 +317,28 @@ effectiveStdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "onnxruntime_USE_COMPOSABLE_KERNEL_CK_TILE" false)
];
env =
lib.optionalAttrs rocmSupport {
MIOPEN_PATH = rocmPackages.miopen;
# HIP steps fail to find ROCm libs when not in HIPFLAGS, causing
# fatal error: 'rocrand/rocrand.h' file not found
HIPFLAGS = lib.concatMapStringsSep " " (pkg: "-I${lib.getInclude pkg}/include") [
rocmPackages.hipblas
rocmPackages.hipcub
rocmPackages.hiprand
rocmPackages.hipsparse
rocmPackages.rocblas
rocmPackages.rocprim
rocmPackages.rocrand
rocmPackages.rocthrust
];
}
// lib.optionalAttrs effectiveStdenv.hostPlatform.isMusl {
NIX_CFLAGS_COMPILE = "-DFLATBUFFERS_LOCALE_INDEPENDENT=0";
GTEST_FILTER = "*:-ContribOpTest.StringNormalizer*";
};
env = {
NIX_LDFLAGS = "-z,noexecstack";
}
// lib.optionalAttrs rocmSupport {
MIOPEN_PATH = rocmPackages.miopen;
# HIP steps fail to find ROCm libs when not in HIPFLAGS, causing
# fatal error: 'rocrand/rocrand.h' file not found
HIPFLAGS = lib.concatMapStringsSep " " (pkg: "-I${lib.getInclude pkg}/include") [
rocmPackages.hipblas
rocmPackages.hipcub
rocmPackages.hiprand
rocmPackages.hipsparse
rocmPackages.rocblas
rocmPackages.rocprim
rocmPackages.rocrand
rocmPackages.rocthrust
];
}
// lib.optionalAttrs effectiveStdenv.hostPlatform.isMusl {
NIX_CFLAGS_COMPILE = "-DFLATBUFFERS_LOCALE_INDEPENDENT=0";
GTEST_FILTER = "*:-ContribOpTest.StringNormalizer*";
};
doCheck =
!(
@@ -38,6 +38,10 @@ buildPythonPackage {
chmod +w dist
'';
env = {
NIX_LDFLAGS = "-z,noexecstack";
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
# This project requires fairly large dependencies such as sympy which we really don't always need.