Skip to content

Commit

Permalink
python3Packages.tensorflow: move asserts to broken to avoid breaking …
Browse files Browse the repository at this point in the history
…eval

(cherry picked from commit 3160745)
  • Loading branch information
Connor Baker authored and github-actions[bot] committed Dec 4, 2023
1 parent a12e4b0 commit 48bf620
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions pkgs/development/python-modules/tensorflow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,16 @@ let
# use compatible cuDNN (https://www.tensorflow.org/install/source#gpu)
# cudaPackages.cudnn led to this:
# https://github.com/tensorflow/tensorflow/issues/60398
cudnn = cudaPackages.cudnn_8_6;
cudnnAttribute = "cudnn_8_6";
cudnn = cudaPackages.${cudnnAttribute};
gentoo-patches = fetchzip {
url = "https://dev.gentoo.org/~perfinion/patches/tensorflow-patches-2.12.0.tar.bz2";
hash = "sha256-SCRX/5/zML7LmKEPJkcM5Tebez9vv/gmE4xhT/jyqWs=";
};
protobuf-extra = linkFarm "protobuf-extra" [
{ name = "include"; path = protobuf-core.src; }
];
in

assert cudaSupport -> cudatoolkit != null
&& cudnn != null;

# unsupported combination
assert ! (stdenv.isDarwin && cudaSupport);

let
withTensorboard = (pythonOlder "3.6") || tensorboardSupport;

# FIXME: migrate to redist cudaPackages
Expand Down Expand Up @@ -490,7 +483,11 @@ let
license = licenses.asl20;
maintainers = with maintainers; [ abbradar ];
platforms = with platforms; linux ++ darwin;
broken = stdenv.isDarwin || !(xlaSupport -> cudaSupport);
broken =
stdenv.isDarwin
|| !(xlaSupport -> cudaSupport)
|| !(cudaSupport -> builtins.hasAttr cudnnAttribute cudaPackages)
|| !(cudaSupport -> cudaPackages ? cudatoolkit);
} // lib.optionalAttrs stdenv.isDarwin {
timeout = 86400; # 24 hours
maxSilent = 14400; # 4h, double the default of 7200s
Expand Down

0 comments on commit 48bf620

Please sign in to comment.