2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, rocmUpdateScript
|
2020-07-18 16:06:22 +00:00
|
|
|
, pkg-config
|
2023-01-20 10:41:00 +00:00
|
|
|
, cmake
|
|
|
|
, rocm-cmake
|
2021-12-24 04:21:11 +00:00
|
|
|
, libdrm
|
2020-07-18 16:06:22 +00:00
|
|
|
, numactl
|
2023-01-20 10:41:00 +00:00
|
|
|
, valgrind
|
2023-04-12 12:48:02 +00:00
|
|
|
, gcc
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "rocm-thunk";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "5.4.4";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCT-Thunk-Interface";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-EU5toaKzVeZpdm/YhaQ0bXq0eoYwYQ5qGLUJzxgZVjE=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
cmake
|
|
|
|
rocm-cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libdrm
|
|
|
|
numactl
|
|
|
|
valgrind
|
2023-04-12 12:48:02 +00:00
|
|
|
gcc.cc.libgcc or null # TODO: unhack this?
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
# Manually define CMAKE_INSTALL_<DIR>
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
|
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 ];
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2023-01-20 10:41:00 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
})
|