2021-09-18 10:52:07 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, wrapPython }:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "rocm-smi";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "5.3.1";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
2021-03-20 04:20:00 +00:00
|
|
|
repo = "rocm_smi_lib";
|
2020-07-18 16:06:22 +00:00
|
|
|
rev = "rocm-${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
hash = "sha256-UbGbkH2vhQ9gv3sSoG+mXap+MdcrP61TN5DcP5F/5nQ=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [ cmake wrapPython ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
wrapPythonProgramsIn $out
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
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/rocm_smi_lib/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocm-smi "$version"
|
|
|
|
'';
|
|
|
|
|
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-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault Flakebi ];
|
2021-03-20 04:20:00 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|