2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchFromGitHub
|
2022-05-18 14:49:53 +00:00
|
|
|
, fetchpatch
|
2022-12-17 10:02:37 +00:00
|
|
|
, rocmUpdateScript
|
2020-07-18 16:06:22 +00:00
|
|
|
, rocm-comgr
|
|
|
|
}:
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "rocclr";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "5.4.3";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCm-Developer-Tools";
|
|
|
|
repo = "ROCclr";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-DbN7kL8oyaPeYQB19Q96L3wX66v62TMSWl0Yor7Q4kE=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
# Enable support for gfx8 again
|
|
|
|
# See the upstream issue: https://github.com/RadeonOpenCompute/ROCm/issues/1659
|
|
|
|
# And the arch patch: https://github.com/rocm-arch/rocm-arch/pull/742
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://raw.githubusercontent.com/John-Gee/rocm-arch/d6812d308fee3caf2b6bb01b4d19fe03a6a0e3bd/rocm-opencl-runtime/enable-gfx800.patch";
|
|
|
|
hash = "sha256-59jFDIIsTTZcNns9RyMVWPRUggn/bSlAGrky4quu8B4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
postPatch = ''
|
2020-07-18 16:06:22 +00:00
|
|
|
substituteInPlace device/comgrctx.cpp \
|
|
|
|
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
mkdir -p $out
|
2023-01-20 10:41:00 +00:00
|
|
|
cp -a * $out/
|
2020-11-06 00:33:48 +00:00
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
runHook postInstall
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-24 04:21:11 +00:00
|
|
|
description = "Source package of the Radeon Open Compute common language runtime";
|
2020-07-18 16:06:22 +00:00
|
|
|
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
|
|
|
|
license = licenses.mit;
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2020-07-18 16:06:22 +00:00
|
|
|
# rocclr seems to have some AArch64 ifdefs, but does not seem
|
|
|
|
# to be supported yet by the build infrastructure. Recheck in
|
|
|
|
# the future.
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-01-20 10:41:00 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
})
|