3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.nvidia-ml-py: init 11.515.48 (#189028)

Co-authored-by: Gaetan Lepage <gaetan.lepage@inria.fr>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Gaétan Lepage 2022-10-18 22:50:56 +02:00 committed by GitHub
parent bf5dc7567c
commit d93b59509c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,17 @@
diff --git a/pynvml.py b/pynvml.py
index 9a424de..669afe0 100644
--- a/pynvml.py
+++ b/pynvml.py
@@ -1676,7 +1676,11 @@ def _LoadNvmlLibrary():
nvmlLib = CDLL(os.path.join(os.getenv("ProgramFiles", "C:/Program Files"), "NVIDIA Corporation/NVSMI/nvml.dll"))
else:
# assume linux
- nvmlLib = CDLL("libnvidia-ml.so.1")
+ try:
+ nvmlLib = CDLL("libnvidia-ml.so.1")
+ except OSError:
+ # Assume NixOS
+ nvmlLib = CDLL("/run/opengl-driver/lib/libnvidia-ml.so.1")
except OSError as ose:
_nvmlCheckReturn(NVML_ERROR_LIBRARY_NOT_FOUND)
if (nvmlLib == None):

View file

@ -0,0 +1,33 @@
{ lib
, fetchPypi
, buildPythonPackage
}:
buildPythonPackage rec {
pname = "nvidia-ml-py";
version = "11.515.48";
format = "setuptools";
src = fetchPypi {
inherit pname version;
extension = "tar.gz";
hash = "sha256-iNLQu9c8Q3B+FXMObRTtxqE3B/siJIlIlCH6T0rX+sY=";
};
patches = [
./0001-locate-libnvidia-ml.so.1-on-NixOS.patch
];
# no tests
doCheck = false;
pythonImportsCheck = [ "pynvml" ];
meta = {
description = "Python Bindings for the NVIDIA Management Library";
homepage = "https://pypi.org/project/nvidia-ml-py";
license = lib.licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View file

@ -6406,6 +6406,8 @@ in {
nvchecker = callPackage ../development/python-modules/nvchecker { };
nvidia-ml-py = callPackage ../development/python-modules/nvidia-ml-py { };
nxt-python = callPackage ../development/python-modules/nxt-python { };
python-nvd3 = callPackage ../development/python-modules/python-nvd3 { };