Help us understand the problem. What is going on with this article?

TensorflowでOSXのGPUが対応されたよ

More than 1 year has passed since last update.

2018/12/16追記

いつの間にかOSXのGPU公式サポートはなくなったみたいなので、それでもGPU使いたい方はこちらのドキュメントが参考になるかもしれません。
Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

2017/2/17追記

Tensorflow 1.0.0から簡単にインストールできるようになったので公式ドキュメントに従うことをおすすめします。
https://www.tensorflow.org/install/install_mac

#cuda8.0
$ brew upgrade
$ brew install coreutils
$ brew cask install cuda

#cuDNN v5.1 Library for OSXをダウンロードして 各/user/local/cuda/いかにコピー

##.bash_profile
#export CUDA_HOME=/usr/local/cuda
#export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib"
#export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$CUDA_HOME/lib"
#export PATH="$CUDA_HOME/bin:$PATH"
#一応実行できるけどwarning出るのでリンク貼る
$ cd /usr/local/cuda/lib
$ sudo ln -s libcuda.dylib libcuda.1.dylib

$ easy_install --upgrade pip
$ easy_install --upgrade six 
$ pip install tensorflow-gpu

以下、本記事

Tensorflow公式レポジトリでIssue#664commit: Enable building with CUDA support on Mac OS XがMergeされてました。

これで正式にMacでもGPUありが使えるはずなので、早速インストールしてみましょう。

※非公式のGPU版セットアップの時と大体同じです。
->【爆速なるか!?】OSXでTensorflowのGPU版を使うためのセットアップ
※※CUDA GPUsでないと使えません
-> https://developer.nvidia.com/cuda-gpus

参考:How to compile tensorflow with CUDA support on OSX (Updated 2nd May 2016)

$ brew update
$ brew cask info cuda 
cuda: 7.5.20
$ bazel version
Build label: 0.2.1-homebrew      

NVIDIAからcuDNNをダウンロード つhttps://developer.nvidia.com/cudnn
Tensorflowのversion0.8はcuDNN v5、 version 0.7以下はv4
私はcudnn-7.5-osx-x64-v5.0-rc.tgzをダウンロードしました。

ファイル解凍して、所定の位置に移動

$tar xzvf ~/Downloads/cudnn-7.5-osx-x64-v5.0-rc.tgz
$sudo mv -v cuda/lib/libcudnn* /usr/local/cuda/lib
$sudo mv -v cuda/include/cudnn.h /usr/local/cuda/include

.bash_profile
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
を追加

$ cd Tensorflowのレポ
$ git pull
$ git checkout master
$ TF_UNOFFICIAL_SETTING=1 ./configure            
Please specify the location of python. [Default is /usr/local/bin/python]:
Do you wish to build TensorFlow with GPU support? [y/N] y 
GPU support will be enabled for TensorFlow                                                                                      
Please specify which gcc nvcc should use as the host compiler. [Default is /usr/bin/gcc]:
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 7.5 
Please specify the location where CUDA 7.5 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the Cudnn version you want to use. [Leave empty to use system default]: 5 
Please specify the location where cuDNN 5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.                                  
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: "3.5,5.2"]: 3.0
Setting up Cuda include                                                                                                         
Setting up Cuda lib                                                                                                             
Setting up Cuda bin                                                                                                             
Setting up Cuda nvvm                                                                                                            
Setting up CUPTI include                                                                                                        
Setting up CUPTI lib64                                                                                                          
Configuration finished                                                                                                          

$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 
...結構かかる...
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
$ pip install /tmp/tensorflow_pkg/tensorflow-0.8.0-py2-none-any.whl

こういうの買うのもありかもしれない。BizonBOX 2 (External Graphics Card for Mac)

tawago
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした