summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/libgpuarray
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-09-21 01:05:02 -0700
committerRyan Burns <rtburns@protonmail.com>2021-09-22 09:10:26 -0700
commit11bf0ac25ba3a87f574f4b896646ebb2581edadf (patch)
treeab2da2f42543b1067dd57ae46149ad46a847a0bd /pkgs/development/python-modules/libgpuarray
parenteb71bcd0414a244f75565fd422cb311684a618e9 (diff)
pythonPackages.libgpuarray: fix opengl runpath
nvidia_x11 libs should be picked up from /run/opengl-driver/lib at runtime
Diffstat (limited to 'pkgs/development/python-modules/libgpuarray')
-rw-r--r--pkgs/development/python-modules/libgpuarray/default.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix
index d061356490cb..2be115ae3658 100644
--- a/pkgs/development/python-modules/libgpuarray/default.nix
+++ b/pkgs/development/python-modules/libgpuarray/default.nix
@@ -1,5 +1,6 @@
{ stdenv
, lib
+, addOpenGLRunpath
, buildPythonPackage
, fetchFromGitHub
, cmake
@@ -8,13 +9,10 @@
, six
, nose
, Mako
-, cudaSupport ? false, cudatoolkit , nvidia_x11
+, cudaSupport ? false, cudatoolkit
, openclSupport ? true, ocl-icd, clblas
}:
-assert cudaSupport -> nvidia_x11 != null
- && cudatoolkit != null;
-
buildPythonPackage rec {
pname = "libgpuarray";
version = "0.7.6";
@@ -32,8 +30,7 @@ buildPythonPackage rec {
configurePhase = "cmakeConfigurePhase";
libraryPath = lib.makeLibraryPath (
- []
- ++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out nvidia_x11 ]
+ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out ]
++ lib.optionals openclSupport ([ clblas ] ++ lib.optional (!stdenv.isDarwin) ocl-icd)
);
@@ -55,6 +52,8 @@ buildPythonPackage rec {
}
fixRunPath $out/lib/libgpuarray.so
+ '' + lib.optionalString cudaSupport ''
+ addOpenGLRunpath $out/lib/libgpuarray.so
'';
propagatedBuildInputs = [
@@ -63,7 +62,12 @@ buildPythonPackage rec {
Mako
];
- nativeBuildInputs = [ cmake ];
+ nativeBuildInputs = [
+ cmake
+ ] ++ lib.optionals cudaSupport [
+ addOpenGLRunpath
+ ];
+
buildInputs = [
cython