
Installing TensorFlow 1.4.0 on MacOS with CUDA Support - earcar
http://paolino.me/tutorial/tensorflow/machine-learning/deep-learning/gpu/2017/11/18/installing-tensorflow-1.4.0-macos-cuda/
======
applecrazy
For me, the number one gripe with TF on Mac is the lack of OpenCL support.
With the new iMac Pro coming out with an AMD Vega GPU, and the 2016 MBP having
Intel graphics, I feel like it should at least be on their list of things to
do. But then again, it's probably not a good idea to train on a Mac.

~~~
acoye
I see a couple of issues with the Mac / TF OpenCL situation.

Apple is pushing metal and performance shaders, I would not bet on strong
support from them keeping up to date drivers with performant ocl. I asked at
wwdc17 about vulkan and they clearly do not want it on their platform.

The TF OpenCL issue is vocal on the repo. Yet to see progress for macos.
[https://github.com/tensorflow/tensorflow/issues/22](https://github.com/tensorflow/tensorflow/issues/22)

Last but not least there is an issue with the ocl support. It is (was?) done
on linux using computeCPP, compiled to SPIR (Standard Portable Intermediate
Representation). MacOS does not support SPIR at the moment.

My best guess would be to use IOMMU magic and hardware virtualization to hook
a GPU to a linux VM with MacOS as a host.

------
qixiang109
I run bazel build and I get this:

ERROR:
/private/var/tmp/_bazel_qixiang/5571543a3fba611a0b0ca8efd02f3a37/external/protobuf_archive/BUILD:265:1:
C++ compilation of rule '@protobuf_archive//:js_embed' failed (Exit 1). gcc-7:
error: unrecognized command line option '-fcolor-diagnostics' gcc-7: error:
unrecognized command line option '-Wthread-safety'; did you mean '-fthread-
jumps'? gcc-7: error: unrecognized command line option '-Wself-assign'; did
you mean '-Wcast-align'? Target
//tensorflow/tools/pip_package:build_pip_package failed to build

any help?

~~~
earcar
Author of the post here.

Bazel recognizes it's compiling on macOS, so it's using clang-compatible
flags, which are incompatible with gcc. You should use the default host
compiler, as stated in the [configure output][1] in the post. /usr/bin/gcc is
for all intents and purposes clang on macOS.

gcc-7 is only installed to provide libgomp which is otherwise missing from a
standard macOS installation.

I'll update the post to make it clearer. Thanks for pointing that out!

[1]:
[https://gist.github.com/crmne/a22858264d68dd9fe935fc4ee48e04...](https://gist.github.com/crmne/a22858264d68dd9fe935fc4ee48e0453#file-
configure_output-txt-L54)

~~~
qixiang109
wow...it works! THX！

------
srcmap
Should also publish the benchmarks of best of class machines running
TensorFlow - for Linux, Windows and Mac HWs.

Show Apple why they need to release better Mac Desktop/Laptop HW or risk loss
the heart and mind of next generation of developers.

------
nl
It's worth noting that _any_ TF user (including those on NVidia Macs) can get
significant speedups (20%+) by recompiling to use all the features of your
CPU.

TF even warns you about this when you start up.

~~~
acoye
if tf runs most of the workload GPU side, SSE enabled binary is less
compatible and no longer a bottleneck.

~~~
nl
On OSX (as the linked post shows) it's pretty rare to use the GPU.

Not all TF components are GPU enabled anyway. The default LSTM isn't and you
need to use CuLSTM. That is nice but doesn't support the GoBackwards operation
so you can't use it in BiLSTMs.

GPUs are great but there is lots done on the CPU too.

Edit: To clarify, the comments on the LSTM implementations are actually on the
Keras/TF LSTM. Not sure what the native TF one is like.

~~~
p1esk
Are you talking about LSTM implementation in OSX version of TF? Because it
definitely runs on GPU in Windows/Linux.

