depot/third_party/nixpkgs/pkgs/development/python-modules/pynvml/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

38 lines
830 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;
hash = "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 ];
};
}