2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-07-15 18:40:26 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, addOpenGLRunpath
|
2020-08-21 07:40:30 +01:00
|
|
|
, clang-unwrapped
|
2020-07-15 18:40:26 +01:00
|
|
|
, cmake
|
2020-08-21 07:40:30 +01:00
|
|
|
, xxd
|
2020-07-15 18:40:26 +01:00
|
|
|
, elfutils
|
2020-08-21 07:40:30 +01:00
|
|
|
, llvm
|
|
|
|
, rocm-device-libs
|
2020-07-15 18:40:26 +01:00
|
|
|
, rocm-thunk }:
|
2020-07-10 16:08:10 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-runtime";
|
2021-03-24 07:54:44 +00:00
|
|
|
version = "4.1.0";
|
2020-07-10 16:08:10 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCR-Runtime";
|
|
|
|
rev = "rocm-${version}";
|
2021-03-24 07:54:44 +00:00
|
|
|
hash = "sha256-Jxg3n203tV0L+UrmeQEuzX0TKpFu5An2cnuEA/F/SNY=";
|
2020-07-10 16:08:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
|
|
|
|
2020-08-21 07:40:30 +01:00
|
|
|
nativeBuildInputs = [ cmake xxd ];
|
2020-07-10 16:08:10 +01:00
|
|
|
|
2020-08-21 07:40:30 +01:00
|
|
|
buildInputs = [ clang-unwrapped elfutils llvm ];
|
2020-07-10 16:08:10 +01:00
|
|
|
|
2020-08-21 07:40:30 +01:00
|
|
|
cmakeFlags = [
|
2020-11-03 06:53:32 +00:00
|
|
|
"-DBITCODE_DIR=${rocm-device-libs}/amdgcn/bitcode"
|
2020-08-21 07:40:30 +01:00
|
|
|
"-DCMAKE_PREFIX_PATH=${rocm-thunk}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs image/blit_src/create_hsaco_ascii_file.sh
|
2020-07-10 16:08:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
2020-08-21 07:40:30 +01:00
|
|
|
rm -rf $out/hsa
|
2020-07-10 16:08:10 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-07-10 16:08:10 +01:00
|
|
|
description = "Platform runtime for ROCm";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
|
|
|
|
license = with licenses; [ ncsa ];
|
|
|
|
maintainers = with maintainers; [ danieldk ];
|
|
|
|
};
|
|
|
|
}
|