pythonPackages.tensorflow: repair cuda-dependent variant
merge the outputs of cudatoolkit locally in the tensorflow derivation, using symlinkJoin Fixes #29798
This commit is contained in:
parent
79ae9be220
commit
244f34785e
@ -1,4 +1,5 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
|
, symlinkJoin
|
||||||
, lib
|
, lib
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
@ -35,6 +36,13 @@ buildPythonPackage rec {
|
|||||||
format = "wheel";
|
format = "wheel";
|
||||||
disabled = ! (isPy35 || isPy36 || isPy27);
|
disabled = ! (isPy35 || isPy36 || isPy27);
|
||||||
|
|
||||||
|
# cudatoolkit is split (see https://github.com/NixOS/nixpkgs/commit/bb1c9b027d343f2ce263496582d6b56af8af92e6)
|
||||||
|
# However this means that libcusolver is not loadable by tensor flow. So we undo the split here.
|
||||||
|
cudatoolkit_joined = symlinkJoin {
|
||||||
|
name = "unsplit_cudatoolkit";
|
||||||
|
paths = [ cudatoolkit.out
|
||||||
|
cudatoolkit.lib ];};
|
||||||
|
|
||||||
src = let
|
src = let
|
||||||
tfurl = sys: proc: pykind:
|
tfurl = sys: proc: pykind:
|
||||||
let
|
let
|
||||||
@ -112,7 +120,7 @@ buildPythonPackage rec {
|
|||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
[ numpy six protobuf mock backports_weakref ]
|
[ numpy six protobuf mock backports_weakref ]
|
||||||
++ lib.optional (!isPy36) tensorflow-tensorboard
|
++ lib.optional (!isPy36) tensorflow-tensorboard
|
||||||
++ lib.optionals cudaSupport [ cudatoolkit cudnn stdenv.cc ];
|
++ lib.optionals cudaSupport [ cudatoolkit_joined cudnn stdenv.cc ];
|
||||||
|
|
||||||
# tensorflow-gpu depends on tensorflow_tensorboard, which cannot be
|
# tensorflow-gpu depends on tensorflow_tensorboard, which cannot be
|
||||||
# built at the moment (some of its dependencies do not build
|
# built at the moment (some of its dependencies do not build
|
||||||
@ -126,7 +134,7 @@ buildPythonPackage rec {
|
|||||||
postFixup = let
|
postFixup = let
|
||||||
rpath = stdenv.lib.makeLibraryPath
|
rpath = stdenv.lib.makeLibraryPath
|
||||||
(if cudaSupport then
|
(if cudaSupport then
|
||||||
[ stdenv.cc.cc.lib zlib cudatoolkit cudnn
|
[ stdenv.cc.cc.lib zlib cudatoolkit_joined cudnn
|
||||||
linuxPackages.nvidia_x11 ]
|
linuxPackages.nvidia_x11 ]
|
||||||
else
|
else
|
||||||
[ stdenv.cc.cc.lib zlib ]
|
[ stdenv.cc.cc.lib zlib ]
|
||||||
|
Loading…
Reference in New Issue
Block a user