Merge pull request #293037 from Kiskae/nvidia-python-ml-fix
python3Packages.nvidia-ml-py: remove hardcoded runtime path
This commit is contained in:
commit
aecc90bc82
2 changed files with 7 additions and 2 deletions
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue