pythonPackages.libgpuarray: fix opengl runpath

nvidia_x11 libs should be picked up from
/run/opengl-driver/lib at runtime
This commit is contained in:
Ryan Burns 2021-09-21 01:05:02 -07:00
parent eb71bcd041
commit 11bf0ac25b
2 changed files with 11 additions and 8 deletions

View file

@ -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

View file

@ -4138,7 +4138,6 @@ in {
libgpuarray = callPackage ../development/python-modules/libgpuarray {
clblas = pkgs.clblas.override { boost = self.boost; };
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.linuxPackages) nvidia_x11;
};
libiio = (toPythonModule (pkgs.libiio.override { inherit python; })).python;