According to
https://www.tensorflow.org/install/install_mac Note: As of version 1.2, TensorFlow no longer provides GPU support on Mac OS X. GPU support for OS X is no longer provided.
However, I would want to run an e-gpu setup like akitio node with a 1080 ti via thunderbolt 3.
What steps are required to get this setup to work? So far I know that
- disable SIP
- run automate e-gpu script https://github.com/goalque/automate-eGPU
are required. What else is needed to get CUDA / tensorflow to work?
I wrote a little tutorial on compiling TensorFlow 1.2 with GPU support on macOS. I think it's customary to copy relevant parts to SO, so here it goes:
pip install tensorflow-gpu
. Once you get that working, the CUDA set-up would also work if you’re compiling TensorFlow. If you have an external GPU, YellowPillow's answer (or mine) might help you get things set up.git checkout r1.0
withgit checkout r1.2
. When doing./configure
, pay attention to the Python library path: it sometimes suggests an incorrect one. I chose the default options in most cases, except for: Python library path, CUDA support and compute capacity. Don’t use Clang as the CUDA compiler: this will lead you to an error “Inconsistent crosstool configuration; no toolchain corresponding to 'local_darwin' found for cpu 'darwin'.”. Using/usr/bin/gcc
as your compiler will actually use Clang that comes with macOS / XCode. Below is my full configuration.tensorflow/third_party/gpus/cuda/BUILD.tpl
, whichcontained linkopts = [“-lgomp”]
(but the location of the line might obviously change). Some people had issues with zmuldefs, but I assume that was with earlier versions; thanks to udnaan for pointing out that it’s OK to comment out these lines.Here is my solution to install an e-gpu on a mac. Tensorflow doesn't support tensorflow-gpu anymore, so there are definitely better approaches to get it working:
My configuration:
Advantages of windows bootcamp installation:
Howto:
Command:
Check your installation
The display driver has been installed correctly when you can plug a screen to the GTX 1080 ti card.
Call C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe to check if your video card is available for CUDA.
Execute the following tensorflow command to see available devices:
Troubleshooting and hints:
Ubuntu solution:
I couldn't find a working solution but here are some approaches:
It seems that my GTX 680 (iMac) and my GTX 1080 ti won't work together. Ubuntu could not be started anymore after installing the display driver via apt-get: Ubuntu not starting anmore. Try to download the official display driver from NVIDIA download page.
OSX Solution: Tensorflow GPU is only supported up to tensorflow 1.1. I tried to install a newer version but couldn't build tensorflow-gpu with cuda support. Here are some approaches:
Conclusion: The windows installation is easier than OSX or Ubuntu installation because display drivers work properly and tensorflow and must not be build on your own. Always check the software version you use. The must match exactly.
I hope this will help you!
Assuming that you have already setup your eGPU box and attached the TB3 cable from the eGPU to your TB3 port:
1. Download the automate-eGPU script and run it
You might get an error saying:
All you need to do now is to restart your computer and when it's restarting hold down
cmd + R
to enable the recovery mode. Then locate the Terminal while in recovery mode and type in:Then restart your computer and re-run the
automate-eGPU.sh
script2: Download and installing CUDA
Run the
cuda_8.0.61_mac.dmg
file and follow through the installation phase. Then afterwards you will need to set the paths.Go to your Terminal and type:
Or whether you have stored your environmental variables and then add these three lines:
3. Downloading and installing cuDNN
To download cuDNN is a bit more troublesome you have to sign up to be a developer for Nvidia and then afterwards you can download it. Make sure to download
cuDNN v5.1 Library for OSX
as it's the one that Tensorflow v1.1 expects Note that we can't use Tensorflow v1.2 as there is no GPU support for Macs :(([![enter image description here][1]][1]
Now you will download a zip file called
cudnn-8.0-osx-x64-v5.1.tgz
, unzip and, which will create a file calledcuda
and cd to it using terminal. Assuming that the folder is in DownloadsOpen terminal and type:
Now we need to copy
cuDNN
files to whereCUDA
is stored so:4. Now install Tensorflow-GPU v1.1 in your conda/virtualenv
For me since I use
conda
I created a new environment using Terminal:5. Verify that it works
First you have to restart your computer then:
In terminal type
python
and enter:If you have a GPU this should run with no problem, if it does then you should get a stack trace (just a bunch of error messages) and it should include
If not then you're done congratz! I just got mine set up today and it's working perfectly :)
I could finally make it work with the following setup
Hardware
Software versions
I wrote a gist with the procedure:
https://gist.github.com/jganzabal/8e59e3b0f59642dd0b5f2e4de03c7687