3ced8179cd
hip: optional GITHUB_TOKEN for update script rocm-llvm: optional GITHUB_TOKEN for update script clang-ocl: optional GITHUB_TOKEN for update script hipcub: optional GITHUB_TOKEN for update script hipsparse: optional GITHUB_TOKEN for update script miopen: optional GITHUB_TOKEN for update script miopengemm: optional GITHUB_TOKEN for update script rccl: optional GITHUB_TOKEN for update script rocblas: optional GITHUB_TOKEN for update script rocclr: optional GITHUB_TOKEN for update script rocfft: optional GITHUB_TOKEN for update script rocm-comgr: optional GITHUB_TOKEN for update script rocm-device-libs: optional GITHUB_TOKEN for update script rocm-opencl-runtime: optional GITHUB_TOKEN for update script rocm-runtime: optional GITHUB_TOKEN for update script rocm-thunk: optional GITHUB_TOKEN for update script rocmlir: optional GITHUB_TOKEN for update script rocprim: optional GITHUB_TOKEN for update script rocrand: optional GITHUB_TOKEN for update script rocsparse: optional GITHUB_TOKEN for update script rocthrust: optional GITHUB_TOKEN for update script rocwmma: optional GITHUB_TOKEN for update script tensile: optional GITHUB_TOKEN for update script rocm-cmake: optional GITHUB_TOKEN for update script rocminfo: optional GITHUB_TOKEN for update script rocm-smi: optional GITHUB_TOKEN for update script
53 lines
1.6 KiB
Nix
53 lines
1.6 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, writeScript
|
|
, cmake
|
|
, pkg-config
|
|
, libdrm
|
|
, numactl
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "rocm-thunk";
|
|
version = "5.3.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "RadeonOpenCompute";
|
|
repo = "ROCT-Thunk-Interface";
|
|
rev = "rocm-${finalAttrs.version}";
|
|
hash = "sha256-cM78Bx6uYsxhvdqSVNgmqOUYQnUJVCA7mNpRNNSFv6k=";
|
|
};
|
|
|
|
preConfigure = ''
|
|
export cmakeFlags="$cmakeFlags "
|
|
'';
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ libdrm numactl ];
|
|
|
|
# https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/75
|
|
postPatch = ''
|
|
substituteInPlace libhsakmt.pc.in \
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
'';
|
|
|
|
postInstall = ''
|
|
cp -r $src/include $out
|
|
'';
|
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
version="$(curl ''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -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" --ignore-same-hash
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Radeon open compute thunk interface";
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
|
|
license = with licenses; [ bsd2 mit ];
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
|
};
|
|
})
|