2022-12-04 00:25:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
|
|
|
, wrapPython
|
|
|
|
}:
|
2020-07-17 06:07:09 +00:00
|
|
|
|
2022-11-24 02:17:04 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-07-17 06:07:09 +00:00
|
|
|
pname = "rocm-smi";
|
2023-03-29 09:56:49 +00:00
|
|
|
version = "5.4.4";
|
2020-07-17 06:07:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
2021-03-24 09:04:45 +00:00
|
|
|
repo = "rocm_smi_lib";
|
2022-11-24 02:17:04 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-04 00:26:46 +00:00
|
|
|
hash = "sha256-nkidiDNNU6MGhne9EbYClkODJZw/zZu3LWzlniJKyJE=";
|
2020-07-17 06:07:09 +00:00
|
|
|
};
|
|
|
|
|
2023-02-05 17:34:47 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed '1i#include <cstring>' -i src/rocm_smi{,_gpu_metrics}.cc # since gcc12 probably
|
|
|
|
'';
|
|
|
|
|
2021-09-02 20:03:18 +00:00
|
|
|
nativeBuildInputs = [ cmake wrapPython ];
|
2020-07-17 06:07:09 +00:00
|
|
|
|
2022-10-05 10:36:21 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
2021-03-24 09:04:45 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-26 07:02:03 +00:00
|
|
|
wrapPythonProgramsIn $out
|
2020-07-17 06:07:09 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-04 00:25:41 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-08 13:04:31 +00:00
|
|
|
|
2020-07-17 06:07:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "System management interface for AMD GPUs supported by ROCm";
|
2021-09-08 13:04:31 +00:00
|
|
|
homepage = "https://github.com/RadeonOpenCompute/rocm_smi_lib";
|
2020-07-17 06:07:09 +00:00
|
|
|
license = with licenses; [ mit ];
|
2022-11-24 01:29:33 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2021-03-24 09:04:45 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-01-15 15:59:25 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
2020-07-17 06:07:09 +00:00
|
|
|
};
|
2022-11-24 02:17:04 +00:00
|
|
|
})
|