{"id":19960954,"url":"https://github.com/zylo117/tensorflow-gpu-macosx","last_synced_at":"2025-04-15T10:34:17.404Z","repository":{"id":32447362,"uuid":"134240831","full_name":"zylo117/tensorflow-gpu-macosx","owner":"zylo117","description":"Unoffcial NVIDIA CUDA GPU support version of Google Tensorflow for MAC OSX","archived":false,"fork":false,"pushed_at":"2024-09-25T14:33:24.000Z","size":130303,"stargazers_count":101,"open_issues_count":7,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-15T10:11:58.630Z","etag":null,"topics":["dist","gpu","mac","osx","python","tensor","tensorflow-gpu-macosx"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zylo117.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-21T08:29:12.000Z","updated_at":"2023-05-17T12:12:39.000Z","dependencies_parsed_at":"2024-12-14T03:16:03.587Z","dependency_job_id":null,"html_url":"https://github.com/zylo117/tensorflow-gpu-macosx","commit_stats":{"total_commits":30,"total_committers":5,"mean_commits":6.0,"dds":"0.23333333333333328","last_synced_commit":"181bc2b37aa8a3eeb11a942d8f330b04abc804b3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zylo117%2Ftensorflow-gpu-macosx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zylo117%2Ftensorflow-gpu-macosx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zylo117%2Ftensorflow-gpu-macosx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zylo117%2Ftensorflow-gpu-macosx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zylo117","download_url":"https://codeload.github.com/zylo117/tensorflow-gpu-macosx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249051891,"owners_count":21204914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dist","gpu","mac","osx","python","tensor","tensorflow-gpu-macosx"],"created_at":"2024-11-13T02:05:58.443Z","updated_at":"2025-04-15T10:34:12.394Z","avatar_url":"https://github.com/zylo117.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tensorflow-gpu-macosx\n\nUnoffcial NVIDIA CUDA GPU support version of Google Tensorflow 1.8 for MAC OSX 10.13\n\n**Description:**\n\n    Since Google Tensorflow claimed that tensorflow-gpu no longer supports \n    MAC OSX since 1.2.0 due to the OpenMP issue of clang of Apple,\n    I built this unoffcial tensorflow-gpu for MAC OSX so that\n    Hackintosh users or Mac users with eGPU can run tensorflow-gpu with CUDA.\n\n**Requirement:**\n\n    1. Must use python3 instead of python2\n\n    2. Must be installed on MAC OSX 10.6+\n\n    3. Must install Nvidia GPU drivers\n\n    4. Must install Nvidia CUDA toolkit 9.1 (if not, you need to re-compile by yourself)\n\n    5. Must install Nvidia CUDA cudnn 7.0 (if not, you need to re-compile by yourself)\n\n    6. Must set up cuda environment (make sure 'nvcc -V' shows the cuda version '9.1')\n\n    7.CUDA compute capability is in [3.0,5.0] (if not, you need to re-compile to get a better performance)\n\n# HOW TO BUILD TENSORFLOW-GPU FOR MAC OSX?\n\n## NOTICE \n\n1.INSTALL NVIDIA DRIVER\n\n2.INSTALL NVIDIA CUDA TOOLKIT (9.1 OR LATER)\n\n3.INSTALL NVIDIA CUDA CUDNN (7.0 OR LATER)\n\n4.SET UP CUDA ENVIRONMENT (MAKE SURE\n\n    nvcc -V\n\nWORKS AND PRINTS CUDA VERSION)\n\n5.INSTALL XCODE/COMMAND LINE TOOL 9.3+\n\n6.INSTALL HOMEBREW\n\n7.INSTALL COREUTILS USING \n\n    brew install coreutils\n\n**8.INSTALL LLVM USING**\n\n    brew install llvm\n    \n**9.INSTALL OPENMP USING** \n\n    brew install cliutils/apple/libomp\n\n**10.INSTALL BAZEL 0.16.1 FROM GITHUB**\n*(https://github.com/bazelbuild/bazel/releases, newer/older version may cause failure)*\n\n12.GIT CLONE TENSORFLOW\n\n    git clone https://github.com/zylo117/tensorflow-gpu-macosx\n\n13.CD TENSORFLOW SOURCE DIR\n\n14.CONFIG(skip this step if your CUDA version is same as mine)\n\n    ./configure\n      #Please specify the location of python.: Accept the default option\n        #Please input the desired Python library path to use.:  Accept the default option\n        #Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n\n        #Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n\n        #Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n\n        #Do you wish to build TensorFlow with XLA JIT support? [y/N]: n\n        #Do you wish to build TensorFlow with GDR support? [y/N]: n\n        #Do you wish to build TensorFlow with VERBS support? [y/N]: n\n        #Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n\n        #Do you wish to build TensorFlow with CUDA support? [y/N]: y\n        #Please specify the CUDA SDK version you want to use, e.g. 7.0.: 9.1\n        #Please specify the location where CUDA 9.1 toolkit is installed.: Accept the default option\n        #Please specify the cuDNN version you want to use.: 7\n        #Please specify the location where cuDNN 7 library is installed.: Accept the default option\n        ##Please specify a list of comma-separated Cuda compute capabilities you want to build with.\n        ##You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. (GTX10X0: 6.1, GTX9X0: 5.2)\n        #Please note that each additional compute capability significantly increases your build time and binary size.: 6.1,5.2,5.0,3.0\n        #Do you want to use clang as CUDA compiler? [y/N]: n\n        #Please specify which gcc should be used by nvcc as the host compiler.: Accept the default option\n        #Do you wish to build TensorFlow with MPI support? [y/N]: n\n        #Please specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified:  Accept the default option\n        #Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n\n\n    export CUDA_HOME=/usr/local/cuda\n    export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib\n    export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH\n    export PATH=$DYLD_LIBRARY_PATH:$PATH\n\n    # bazel clean --expunge # Use this if you failed to compile before.\n\n**15.BUILD**\n\n    bazel build --config=cuda --config=opt --cxxopt=\"-D_GLIBCXX_USE_CXX11_ABI=0\" --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package\n\n**16.NCCL PATCH**\n  \n  You can compile NCCL_OPS by yourself (not necessary):\n\n    gcc -c -fPIC ./nccl_patched/nccl_ops.cc -o ./nccl_patched/_nccl_ops.o\n    \n    gcc ./nccl_patched/_nccl_ops.o -shared -o ./nccl_patched/_nccl_ops.so\n  \n  Then replace the original nccl lib:\n\n    mv ./bazel-bin/tensorflow/contrib/nccl/python/ops/_nccl_ops.so ./bazel-bin/tensorflow/contrib/nccl/python/ops/_nccl_ops.so.bk\n\n    cp ./nccl_patched/_nccl_ops.so ./bazel-bin/tensorflow/contrib/nccl/python/ops/\n\n\n\n16.BUILD PYTHON BINDING USING\n\n    ./bazel-bin/tensorflow/tools/pip_package/build_pip_package/ ./tmp/tensorflow_pkg\n\n17.INSTALL PYTHON WHEEL USING 'pip3 install /tmp/tensorflow_pkg/*.whl'\n\n18.REINSTALL XCODE/COMMAND LINE TOOL 9\n\n\n**NOTICE**\n\n    This version will not supports multi-cpu/machine training.\n    \n    It's not like you are gonna need it anyway.\n\n**INSTALL:**\n\n    **Either compile from src through pypi (not recommended)**\n        pip3 install tensorflow-gpu-macosx\n    **or install from relese (the easiest way)**\n        pip3 install *.whl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzylo117%2Ftensorflow-gpu-macosx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzylo117%2Ftensorflow-gpu-macosx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzylo117%2Ftensorflow-gpu-macosx/lists"}