Merge pull request #213208 from Madouura/pr/rocm-hydra

rocm-related: fix hydra workarounds
This commit is contained in:
Weijia Wang 2023-01-29 09:05:35 +01:00 committed by GitHub
commit af848756db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 3 deletions

View file

@ -28,8 +28,7 @@ let
"example"
];
# There is now a release, but it's cpu-only it seems to be for a very specific purpose
# Thus, we're sticking with the develop branch for now...
# ROCm 5.6 should release composable_kernel as stable with a tag in the future
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "composable_kernel";
@ -53,6 +52,7 @@ let
"-DCMAKE_CXX_COMPILER=hipcc"
] ++ lib.optionals (gpuTargets != [ ]) [
"-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
"-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
] ++ lib.optionals buildTests [
"-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names
];
@ -82,7 +82,6 @@ let
license = with licenses; [ mit ];
maintainers = teams.rocm.members;
platforms = platforms.linux;
broken = buildExamples; # bin/example_grouped_gemm_xdl_bfp16] Error 139
};
});
@ -93,6 +92,7 @@ in stdenv.mkDerivation {
inherit (ck) pname version outputs src passthru meta;
dontUnpack = true;
dontPatch = true;
dontConfigure = true;
dontBuild = true;
@ -109,4 +109,10 @@ in stdenv.mkDerivation {
'' + ''
runHook postInstall
'';
# Fix paths
preFixup = ''
substituteInPlace $out/lib/cmake/composable_kernel/*.cmake \
--replace "${ck}" "$out"
'';
}

View file

@ -135,6 +135,7 @@ in stdenv.mkDerivation {
inherit (rocfft) pname version outputs src passthru meta;
dontUnpack = true;
dontPatch = true;
dontConfigure = true;
dontBuild = true;
@ -155,4 +156,22 @@ in stdenv.mkDerivation {
'' + ''
runHook postInstall
'';
# Fix paths
preFixup = ''
substituteInPlace $out/include/*.h $out/rocfft/include/*.h \
--replace "${rocfft}" "$out"
patchelf --set-rpath \
$(patchelf --print-rpath $out/lib/librocfft.so | sed 's,${rocfft}/lib,'"$out/lib"',') \
$out/lib/librocfft.so
'' + lib.optionalString buildTests ''
patchelf --set-rpath \
$(patchelf --print-rpath $test/bin/rocfft-test | sed 's,${rocfft}/lib,'"$out/lib"',') \
$test/bin/rocfft-test
'' + lib.optionalString buildBenchmarks ''
patchelf --set-rpath \
$(patchelf --print-rpath $benchmark/bin/rocfft-rider | sed 's,${rocfft}/lib,'"$out/lib"',') \
$benchmark/bin/rocfft-rider
'';
}