From 9c42df8d3ef5fdeca49a60c9e71289061902cd34 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 26 Nov 2019 22:15:40 -0500 Subject: [PATCH 1/2] python3Packages.tensorflow-build: enable on darwin --- pkgs/development/python-modules/tensorflow/default.nix | 7 ++++++- pkgs/top-level/python-packages.nix | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index 79be6a60c42b..cc64e49e1b7a 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -25,6 +25,8 @@ , sse42Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") ["westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylake-avx512"] , avx2Support ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] , fmaSupport ? builtins.elem (stdenv.hostPlatform.platform.gcc.arch or "default") [ "haswell" "broadwell" "skylake" "skylake-avx512"] +# Darwin deps +, Foundation, Security }: assert cudaSupport -> nvidia_x11 != null @@ -157,6 +159,9 @@ let cudatoolkit cudnn nvidia_x11 + ] ++ lib.optionals stdenv.isDarwin [ + Foundation + Security ]; # arbitrarily set to the current latest bazel version, overly careful @@ -326,7 +331,7 @@ let homepage = http://tensorflow.org; license = licenses.asl20; maintainers = with maintainers; [ jyp abbradar ]; - platforms = platforms.linux; + platforms = with platforms; linux ++ darwin; # The py2 build fails due to some issue importing protobuf. Possibly related to the fix in # https://github.com/akesandgren/easybuild-easyblocks/commit/1f2e517ddfd1b00a342c6abb55aef3fd93671a2b broken = !(xlaSupport -> cudaSupport) || !isPy3k; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 86535df44f58..84f30bc11072 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6180,6 +6180,7 @@ in { cudnn = pkgs.cudnn_cudatoolkit_10; nccl = pkgs.nccl_cudatoolkit_10; openssl = pkgs.openssl_1_0_2; + inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security; }; tensorflow = if stdenv.isDarwin then self.tensorflow-bin else self.tensorflow-build; From 074dbdd81dd997bc2b84da5953163d6007747bf9 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 26 Nov 2019 22:51:59 -0500 Subject: [PATCH 2/2] python3Packages.tensorflow: use tensorflow-build on darwin The tensorflow-bin is currently broken. --- pkgs/top-level/python-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 84f30bc11072..beba969f161d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6183,7 +6183,7 @@ in { inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security; }; - tensorflow = if stdenv.isDarwin then self.tensorflow-bin else self.tensorflow-build; + tensorflow = self.tensorflow-build; tensorflowWithoutCuda = self.tensorflow.override { cudaSupport = false;