Do not connect the eGPU to your Macbook until instructed.
1 . Update to macOS High Sierra, version 10.13.5
Do this by Apple > About This Mac > Software Update...
-
Connect only the eGPU to your Macbook (connect cable then switch on). Ensure no other devices are connected by thunderbolt 3. You should see the Akitio Node under Apple > (holding option) System Information... > Thunderbolt
-
Install the macOS-eGPU drivers. This is done by
- restart and hold command + R This boots into recovery mode
- open Utilities > Terminal
- enter
csrutil disable; reboot
- after reboot, disconnect the eGPU
- open terminal and enter
bash <(curl -s https://raw.githubusercontent.com/learex/macOS-eGPU/master/macOS-eGPU.sh)
and follow instructions
-
when finished, reconnect the eGPU then restart
-
you should see two new icons at the top of your computer, once which mentions your GPU name when clicked.
-
check the GPU name (e.g. Quadro P6000) appears under Apple > (holding option) System Information... > Graphics/Displays
Say NO to any NVIDIA driver update window
- Disable auto-NVIDIA updating, which will relentlessly break everything. Click the new NVIDIA icon in the toolbar > Open NVIDIA Driver Manager Preferences > Updates, then disable Automatically check for updates (may have to unlock via bottom left first).
If you want to write programs for the GPU (e.g. use QuEST) you'll need the NVIDIA compiler nvcc
, which wraps around an existing compiler on your machine.
Unfortunately nvcc
doesn't support modern Clang (default compiler on OSX) nor GNU compilers (e.g. gcc 4.9
that non-GPU QuEST recommends)
We'll instead use Clang 3.7
. Note Clang
doesn't support OpenMP so you won't be able to simultaneously use CPU parallelism. This may mean you'll later need to remove #include <omp.h>
from your library code.
If you don't have Homebrew, download it via
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Next, try
brew install llvm37
If that fails with an xcrun
error, repeat after trying
sudo xcode-select --install
or search for alternate v3 versions with
brew search llvm
Check installation was successful by entering
clang++-3.7 --version
though this may require first adding clang-3.7
to your path. Instructions should be displayed in the brew output, and require closing and reopening a new Terminal after following.
We're now ready to install nvcc
.
brew tap caskroom/drivers
brew cask install nvidia-cuda
This will open a dialogue window at some point during installation.
Check nvcc
was installed successfully via
/usr/local/cuda/bin/nvcc --version
To make nvcc
a recognised command, edit /etc/profile
via
sudo nano /etc/profile
and add to the bottom:
# resolving nvcc to use GPU
export PATH=/Developer/NVIDIA/CUDA-9.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib\ {DYLD_LIBRARY_PATH:+:$$
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export PATH=/usr/local/bin:$PATH
Exit and save (ctrl-x
then y
then Enter
), then run
source /etc/profile
Test nvcc
is recognised
nvcc --version
Caution It is important to turn off your computer when connecting or disconnecting the eGPU. Otherwise, applications being rendered by the GPU may crash, including your OS.
When compiling with nvcc
, you'll need to tell it to wrap Clang 3.7 using the ccbin
flag:
nvcc -ccbin clang++-3.7 ...
Hi Dennis,
Sounds like everything's actually set up fine. If you're using the eGPU as a GPGPU (like this guide is for), you can run
nvidia-smi
at the command line to check the GPU is targetable bynvcc
.If you're using the eGPU to render for an external monitor, then be sure to connect the GPU directly to your external monitor (with no connection to your computer), e.g. with a DP cable. It will then be impossible for your internal GPU to render for the external monitor. Note that I don't know whether it's possible for MacOS to continue rendering one monitor using the internal card, and an external monitor using the eGPU - it's certainly seems impossible on Windows (where the internal monitor must be disabled).
Hope this helps!