2020-07-18 16:06:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, addOpenGLRunpath
|
2020-09-25 04:45:31 +00:00
|
|
|
, clang-unwrapped
|
2020-07-18 16:06:22 +00:00
|
|
|
, cmake
|
2020-09-25 04:45:31 +00:00
|
|
|
, xxd
|
2020-07-18 16:06:22 +00:00
|
|
|
, elfutils
|
2020-09-25 04:45:31 +00:00
|
|
|
, llvm
|
|
|
|
, rocm-device-libs
|
2020-07-18 16:06:22 +00:00
|
|
|
, rocm-thunk }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-runtime";
|
2020-12-25 13:55:36 +00:00
|
|
|
version = "4.0.0";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCR-Runtime";
|
|
|
|
rev = "rocm-${version}";
|
2020-12-03 08:41:04 +00:00
|
|
|
hash = "sha256-8hNb0Yo9ApedOG7xrUr5rwiA/YsqDTcyr6dBRg8lXro=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
nativeBuildInputs = [ cmake xxd ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildInputs = [ clang-unwrapped elfutils llvm ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
cmakeFlags = [
|
2020-11-06 00:33:48 +00:00
|
|
|
"-DBITCODE_DIR=${rocm-device-libs}/amdgcn/bitcode"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DCMAKE_PREFIX_PATH=${rocm-thunk}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs image/blit_src/create_hsaco_ascii_file.sh
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
rm -rf $out/hsa
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Platform runtime for ROCm";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
|
|
|
|
license = with licenses; [ ncsa ];
|
|
|
|
maintainers = with maintainers; [ danieldk ];
|
|
|
|
};
|
|
|
|
}
|