-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
python.pkgs.tensorflow: wheel version #41259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -192,6 +192,13 @@ in { | |||
gcc = gcc5; | |||
}; | |||
|
|||
cudatoolkit90 = common { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cudatoolkit90
while we have cudatoolkit9
is very confusing.
Would you mind rewriting these all to cudatoolkit_X_X
or cudatoolkit_X
in a separate commit, which will form the base for this change?
}; | ||
src = let dls = import ./tf1.7.1-hashes.nix; | ||
in | ||
fetchurl ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ugly. Maybe the following?
let
version = python.majorVersion if stdenv.isDarwin else "${python.majorVersion}{python.minorVersion}";
platform = "mac" if stdenv.isDarwin else "linux";
unit = "gpu" if cudaSupport else "cpu";
key = "${platform}_py_${version}_${unit}";
in dls.${key}
We don't support Python 3.4 and 3.5 so I think this should work.
# patchelf --shrink-rpath will remove the cuda libraries. | ||
postFixup = let | ||
rpath = stdenv.lib.makeLibraryPath | ||
(if cudaSupport then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lib.optionals for the extra items.
'' | ||
rrPath="$out/${python.sitePackages}/tensorflow/:${rpath}" | ||
internalLibPath="$out/${python.sitePackages}/tensorflow/python/_pywrap_tensorflow_internal.so" | ||
find $out -name '*.so' -exec patchelf --set-rpath "$rrPath" {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.so
is linux only, so use .${stdenv.hostPlatform.extensions.sharedLibrary}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patchelf is also linux only so the whole find commands needs to be made conditional.
meta = with stdenv.lib; { | ||
description = "Computation using data flow graphs for scalable machine learning"; | ||
homepage = http://tensorflow.org; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ jyp abbradar ]; | ||
platforms = platforms.darwin; | ||
platforms = with platforms; if cudaSupport then linux else linux ++ darwin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib.optionals
sha256 = "0s5dy956jvwazqflc90v15i912zvhwsbzlf0cl8k7isq52j6g3kp"; | ||
}; | ||
} | ||
# This file, prefetcher.sh, was generated using the following script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just check in the script in a separate file
55eae50
to
442d3e6
Compare
@FRidh Thanks for the review! I think I've applied all your comments in the current version. |
Indeed. In master no fixup is done on darwin; i've updated the commit as
you suggest.
…On Thu, May 31, 2018 at 9:21 AM, Jörg Thalheim ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkgs/development/python-modules/tensorflow/bin.nix
<#41259 (comment)>:
> + # Note that we need to run *after* the fixup phase because the
+ # libraries are loaded at runtime. If we run in preFixup then
+ # patchelf --shrink-rpath will remove the cuda libraries.
+ postFixup = let
+ rpath = stdenv.lib.makeLibraryPath
+ (if cudaSupport then
+ [ stdenv.cc.cc.lib zlib cudatoolkit_joined cudnn
+ nvidia_x11 ]
+ else
+ [ stdenv.cc.cc.lib zlib ]
+ );
+ in
+ ''
+ rrPath="$out/${python.sitePackages}/tensorflow/:${rpath}"
+ internalLibPath="$out/${python.sitePackages}/tensorflow/python/_pywrap_tensorflow_internal.so"
+ find $out -name '*.so' -exec patchelf --set-rpath "$rrPath" {} \;
patchelf is also linux only so the whole find commands needs to be made
conditional.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41259 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABsY6k9s-WemyqkUMqcE9DhZEldVr8Uks5t35n1gaJpZM4UTa2q>
.
|
This version is a dependency of tensorflow binaries
Re-instates binary build for all versions.
@FRidh I believe that the PR satisfies your suggestions. What do you think? |
I'm getting
|
@dotlambda If you're targetting py 3.6 it'll work, but not with eager graph execution. Would you care submitting a bug report? |
Motivation for this change
Tensorflow is broken in master.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)