nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.4 KiB
Nix
Raw Normal View History

2021-09-02 21:57:12 +02:00
{ stdenv
, lib
, fetchFromGitHub
2021-09-08 16:14:49 +02:00
, writeScript
, addOpenGLRunpath
2020-08-21 08:40:30 +02:00
, clang-unwrapped
, cmake
2020-08-21 08:40:30 +02:00
, xxd
, 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
, 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"
'';
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 ];
maintainers = with maintainers; [ lovesegfault ];
2020-07-10 17:08:10 +02:00
};
}