686ce24904
GitOrigin-RevId: ac1f5b72a9e95873d1de0233fddcb56f99884b37
38 lines
845 B
Nix
38 lines
845 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, substituteAll
|
|
, pythonOlder
|
|
, cudatoolkit
|
|
, addOpenGLRunpath
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pynvml";
|
|
version = "11.4.1";
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "b2e4a33b80569d093b513f5804db0c7f40cfc86f15a013ae7a8e99c5e175d5dd";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch;
|
|
inherit (addOpenGLRunpath) driverLink;
|
|
})
|
|
];
|
|
|
|
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 ];
|
|
};
|
|
}
|