2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-02-16 17:41:37 +00:00
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, cudatoolkit
|
2023-02-16 17:41:37 +00:00
|
|
|
, addOpenGLRunpath
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pynvml";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "11.5.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-0CeyG5WxCIufwngRf59ht8Z/jjOnh+n4P3NfD3GsMtA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch;
|
|
|
|
inherit (addOpenGLRunpath) driverLink;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ cudatoolkit ];
|
|
|
|
|
|
|
|
doCheck = false; # no tests in PyPi dist
|
|
|
|
pythonImportsCheck = [ "pynvml" "pynvml.smi" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for the NVIDIA Management Library";
|
|
|
|
homepage = "https://www.nvidia.com";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|