libtorch-bin: do not depend on nvidia_x11
libcuda.so should be provided through /run/opengl-driver/lib to use the system's version. This also avoids rebuilds when linuxPackages is updated.
This commit is contained in:
parent
406c33bb3d
commit
c4482a0c2a
@ -8,7 +8,6 @@
|
|||||||
, fixDarwinDylibNames
|
, fixDarwinDylibNames
|
||||||
|
|
||||||
, cudaSupport
|
, cudaSupport
|
||||||
, nvidia_x11
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -24,12 +23,7 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
if stdenv.isDarwin then [ fixDarwinDylibNames ]
|
if stdenv.isDarwin then [ fixDarwinDylibNames ]
|
||||||
else [ addOpenGLRunpath patchelf ]
|
else [ patchelf ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ];
|
||||||
++ lib.optionals cudaSupport [ addOpenGLRunpath ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
stdenv.cc.cc
|
|
||||||
] ++ lib.optionals cudaSupport [ nvidia_x11 ];
|
|
||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
@ -56,8 +50,7 @@ in stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = let
|
postFixup = let
|
||||||
libPaths = [ stdenv.cc.cc.lib ]
|
libPaths = [ stdenv.cc.cc.lib ];
|
||||||
++ lib.optionals cudaSupport [ nvidia_x11 ];
|
|
||||||
rpath = lib.makeLibraryPath libPaths;
|
rpath = lib.makeLibraryPath libPaths;
|
||||||
in lib.optionalString stdenv.isLinux ''
|
in lib.optionalString stdenv.isLinux ''
|
||||||
find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
|
find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
|
||||||
|
@ -1671,7 +1671,6 @@ in
|
|||||||
else libtensorflow-bin;
|
else libtensorflow-bin;
|
||||||
|
|
||||||
libtorch-bin = callPackage ../development/libraries/science/math/libtorch/bin.nix {
|
libtorch-bin = callPackage ../development/libraries/science/math/libtorch/bin.nix {
|
||||||
inherit (linuxPackages) nvidia_x11;
|
|
||||||
cudaSupport = config.cudaSupport or false;
|
cudaSupport = config.cudaSupport or false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user