2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
|
|
|
, wrapPython
|
|
|
|
}:
|
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-smi";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "5.7.0";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
2021-03-20 04:20:00 +00:00
|
|
|
repo = "rocm_smi_lib";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-swCRO4PBMBJ6fO2bLq/xxFZIYw2IgiFB490wsU8Wm2o=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
wrapPython
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-10-19 13:55:26 +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"
|
|
|
|
];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
wrapPythonProgramsIn $out
|
2023-10-19 13:55:26 +00:00
|
|
|
mv $out/libexec/rocm_smi/.rsmiBindings.py-wrapped $out/libexec/rocm_smi/rsmiBindings.py
|
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
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "System management interface for AMD GPUs supported by ROCm";
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://github.com/RadeonOpenCompute/rocm_smi_lib";
|
2020-07-18 16:06:22 +00:00
|
|
|
license = with licenses; [ mit ];
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2021-03-20 04:20:00 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-01-20 10:41:00 +00:00
|
|
|
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
|
|
|
})
|