5557ff764c
GitOrigin-RevId: 988cc958c57ce4350ec248d2d53087777f9e1949
38 lines
832 B
Nix
38 lines
832 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, substituteAll
|
|
, pythonOlder
|
|
, cudatoolkit
|
|
, addOpenGLRunpath
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pynvml";
|
|
version = "11.5.0";
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "sha256-0CeyG5WxCIufwngRf59ht8Z/jjOnh+n4P3NfD3GsMtA=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|