Merge pull request #293037 from Kiskae/nvidia-python-ml-fix

python3Packages.nvidia-ml-py: remove hardcoded runtime path
This commit is contained in:
Someone 2024-03-03 21:58:42 +00:00 committed by GitHub
commit aecc90bc82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -11,7 +11,7 @@ index 9a424de..669afe0 100644
+ nvmlLib = CDLL("libnvidia-ml.so.1")
+ except OSError:
+ # Assume NixOS
+ nvmlLib = CDLL("/run/opengl-driver/lib/libnvidia-ml.so.1")
+ nvmlLib = CDLL("@driverLink@/lib/libnvidia-ml.so.1")
except OSError as ose:
_nvmlCheckReturn(NVML_ERROR_LIBRARY_NOT_FOUND)
if (nvmlLib == None):

View file

@ -1,6 +1,8 @@
{ lib
, fetchPypi
, buildPythonPackage
, substituteAll
, addOpenGLRunpath
}:
buildPythonPackage rec {
@ -15,7 +17,10 @@ buildPythonPackage rec {
};
patches = [
./0001-locate-libnvidia-ml.so.1-on-NixOS.patch
(substituteAll {
src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch;
inherit (addOpenGLRunpath) driverLink;
})
];
# no tests