TomHeaven / tensorflow-osx-build

Off-the-shelf python package of tensorflow with CUDA support for Mac OS.
142 stars 20 forks source link

Do you pursue with tensorflow 2.7 on macOS 10.13.6 #25

Closed llv22 closed 2 years ago

llv22 commented 2 years ago

as title, curious about this.

llv22 commented 2 years ago

@TomHeaven some updates about cracking tensorflow 2.9 on macOS 10.13.6, CUDA 10.1, cudnn 7.6.3 via Xcode 10.1. Recently I spent about 2 weeks to identify the root cause of why tensorflow 2.9 can't work on the aforementioned environment.

Besides the normal compilation issues, the major show-blocker lies at the bazel building system, because on macOS 10.13.6 the ARG_MAX is about 262144, which is far less than the setting on 10.14. But we can crack bazel system for its default linking behavior in https://github.com/llv22/bazel-macOS-10.13.6/blob/r5.2.1/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java. Basically it merges object files to intermediate objects, then further link them together, which can workaround to avoid the issue over the pre-setting of input arguments.

  1. The built tensorflow 2.9 libraries compatible with your environment are uploaded here: https://github.com/llv22/tensorflow-macOS-cuda/releases/tag/mac10.13.6-cuda10.1-2.9.0
  2. For building the source code on your own,
TomHeaven commented 2 years ago

Great work!

llv22 commented 2 years ago

@TomHeaven actually there is still one minor feature to enable auto-switch between GPU and CPU mode, esp. for GPU tensorflow installer. But not a big issue.