2022-12-12 23:36:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-10 18:34:25 +00:00
|
|
|
, fetchFromGitHub
|
2022-05-04 13:50:16 +00:00
|
|
|
, fetchpatch
|
2022-12-04 00:25:41 +00:00
|
|
|
, rocmUpdateScript
|
2020-07-10 18:34:25 +00:00
|
|
|
, rocm-comgr
|
|
|
|
}:
|
|
|
|
|
2022-11-24 02:17:04 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-07-10 18:34:25 +00:00
|
|
|
pname = "rocclr";
|
2023-01-15 16:04:53 +00:00
|
|
|
version = "5.4.2";
|
2020-07-10 18:34:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ROCm-Developer-Tools";
|
|
|
|
repo = "ROCclr";
|
2022-11-24 02:17:04 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-04 00:26:46 +00:00
|
|
|
hash = "sha256-tYFoGafOsJYnRQaOLAaFix6tPD0QPTidOtOicPxP2Vk=";
|
2020-07-10 18:34:25 +00:00
|
|
|
};
|
|
|
|
|
2022-05-04 13:50:16 +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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
postPatch = ''
|
2020-07-10 18:34:25 +00:00
|
|
|
substituteInPlace device/comgrctx.cpp \
|
|
|
|
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
|
|
|
|
'';
|
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2021-11-08 10:09:01 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-07-10 18:34:25 +00:00
|
|
|
|
2021-11-08 10:09:01 +00:00
|
|
|
mkdir -p $out
|
2022-12-12 23:36:53 +00:00
|
|
|
cp -a * $out/
|
2020-11-03 07:50:47 +00:00
|
|
|
|
2021-11-08 10:09:01 +00:00
|
|
|
runHook postInstall
|
2020-07-10 18:34:25 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-04 00:25:41 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-08 17:12:32 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2021-11-08 10:09:01 +00:00
|
|
|
description = "Source package of the Radeon Open Compute common language runtime";
|
2020-07-10 18:34:25 +00:00
|
|
|
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
|
|
|
|
license = licenses.mit;
|
2022-11-24 01:29:33 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2020-07-10 18:34:25 +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-15 15:59:25 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
2020-07-10 18:34:25 +00:00
|
|
|
};
|
2022-11-24 02:17:04 +00:00
|
|
|
})
|