2021-09-02 21:57:12 +02:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-07-15 19:40:26 +02:00
|
|
|
, fetchFromGitHub
|
2021-09-08 16:14:49 +02:00
|
|
|
, writeScript
|
2020-07-15 19:40:26 +02:00
|
|
|
, addOpenGLRunpath
|
2020-08-21 08:40:30 +02:00
|
|
|
, clang-unwrapped
|
2020-07-15 19:40:26 +02:00
|
|
|
, cmake
|
2020-08-21 08:40:30 +02:00
|
|
|
, xxd
|
2020-07-15 19:40:26 +02:00
|
|
|
, elfutils
|
2020-08-21 08:40:30 +02:00
|
|
|
, llvm
|
2021-09-02 21:57:12 +02:00
|
|
|
, numactl
|
2020-08-21 08:40:30 +02:00
|
|
|
, rocm-device-libs
|
2020-07-15 19:40:26 +02:00
|
|
|
, rocm-thunk }:
|
2020-07-10 17:08:10 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-runtime";
|
2022-02-20 12:53:37 +01:00
|
|
|
version = "5.0.1";
|
2020-07-10 17:08:10 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCR-Runtime";
|
|
|
|
rev = "rocm-${version}";
|
2022-02-20 12:53:37 +01:00
|
|
|
hash = "sha256-KOzVZNHtpwEOn7lZ36c4BGrImrq8dkUWRiHqGm+UTDk=";
|
2020-07-10 17:08:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
|
|
|
|
2020-08-21 08:40:30 +02:00
|
|
|
nativeBuildInputs = [ cmake xxd ];
|
2020-07-10 17:08:10 +02:00
|
|
|
|
2021-09-02 21:57:12 +02:00
|
|
|
buildInputs = [ clang-unwrapped elfutils llvm numactl ];
|
2020-07-10 17:08:10 +02:00
|
|
|
|
2020-08-21 08:40:30 +02:00
|
|
|
cmakeFlags = [
|
2020-11-03 07:53:32 +01:00
|
|
|
"-DBITCODE_DIR=${rocm-device-libs}/amdgcn/bitcode"
|
2020-08-21 08:40:30 +02:00
|
|
|
"-DCMAKE_PREFIX_PATH=${rocm-thunk}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs image/blit_src/create_hsaco_ascii_file.sh
|
2020-07-10 17:08:10 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
2020-08-21 08:40:30 +02:00
|
|
|
rm -rf $out/hsa
|
2020-07-10 17:08:10 +02:00
|
|
|
'';
|
|
|
|
|
2021-09-08 16:14:49 +02:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
|
|
version="$(curl -sL "https://api.github.com/repos/RadeonOpenCompute/ROCR-Runtime/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocm-runtime "$version"
|
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-07-10 17:08:10 +02:00
|
|
|
description = "Platform runtime for ROCm";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
|
|
|
|
license = with licenses; [ ncsa ];
|
2021-09-12 16:42:12 +02:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-10 17:08:10 +02:00
|
|
|
};
|
|
|
|
}
|