2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, writeScript
|
2020-07-18 16:06:22 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2021-12-24 04:21:11 +00:00
|
|
|
, libdrm
|
2020-07-18 16:06:22 +00:00
|
|
|
, numactl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-thunk";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "5.1.0";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCT-Thunk-Interface";
|
|
|
|
rev = "rocm-${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-Qvbvfe1fhoLTkDnzG0WzfAxbyDoEJwkzVvlBGTBkq0w=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export cmakeFlags="$cmakeFlags "
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
buildInputs = [ libdrm numactl ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp -r $src/include $out
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00: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/ROCT-Thunk-Interface/tags" | jq '.[].name | split("-") | .[1] | select( . != null )' --raw-output | sort -n | tail -1)"
|
|
|
|
update-source-version rocm-thunk "$version"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Radeon open compute thunk interface";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
|
|
|
|
license = with licenses; [ bsd2 mit ];
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|