[SCRIPT] automate-eGPU.sh v1.0.1 - macOS eGPU installation tool
The home of this script is at GitHub: https://github.com/goalque/automate-eGPU
General instructions (OS X 10.9.5 - macOS 10.12.* )
1) Disable SIP (introduced in OS X El Capitan 10.11). As derived from here:
Your system is not less safe SIP disabled than it was on OS X 10.10. However, if you want more protection, you can try:
csrutil enable --without kext
which requests an unsupported configuration, allowing unsigned kexts.
2) Download & run the script. Here's video instructions if you need them.
cd ~/Desktop && curl -o automate-eGPU.sh https://raw.githubusercontent.com/goalque/automate-eGPU/master/automate-eGPU.sh && chmod +x automate-eGPU.sh && sudo ./automate-eGPU.sh
4) Set the eGPU display/ghost display as the primary as shown at 0:22 in this video
The procedure for AMD cards goes as follows (macOS 10.12.2 or newer):
This script is not applicable to High Sierra.
Apple announced official support for AMD external graphics, starting from macOS 10.13. IOPCITunnelCompatible keys are now built-in [RX 480 / RX 580]. Thank you! 🙂
1) Hot plug the eGPU and run: sudo ./automate-eGPU.sh
2) Shut down
3) Disconnect eGPU
4) Boot into macOS, hot plug, rerun: sudo ./automate-eGPU.sh
5) If your Mac is newer than Late 2014, you might have to turn on -a mode: sudo ./automate-eGPU.sh -a. If the first try is not successful -a mode turned on, turn it off (sudo ./automate-eGPU.sh -m), start from the beginning and skip this step.
6) Shut down
7) If you have a TB3 Mac, an USB-C adapter (such as USB-C to USB, USB-C to DP) plugged in the other TB3 port is necessary for now. Thanks to FricoRico for the hint to boot into macOS with an external display, and later switch over to the eGPU output. This method works when eGPU does not share dGPU’s framebuffer (Mid 2015 15” MBP w/ M370X + RX 480 for example).
UPDATE: The USB-C trick that was necessary to have acceleration on macOS 10.12.2/10.12.3 + AMDs, doesn’t work after macOS 10.12.4 upgrade. Downgrading to 10.12.3 doesn't help. If you can do firmware downgrade, that might help.
8) Connect eGPU and boot into macOS, and soon you hear the “whoosh” sound!
- Nvidia Kepler (10.9.5 - 10.12.*): Apple's native driver support, up to GTX 780 6GB (sudo ./automate-eGPU.sh -skip-web-driver)
- Nvidia Maxwell (10.10 - 10.12.*): beta web driver support (automatic downloading)
- Nvidia Pascal (10.12.4 - ): beta web driver support (automatic downloading)
All AMD cards from Bonaire, Hawaii, Pitcairn, Tahiti, Tonga, Verde and Baffin families are natively supported.
Recommended AMD cards: HD 7970, R9 Fury/Nano, RX 460/470/480. Avoid XFX brand.
I have not tested RX 500 series. They have same device ids as RX 4XXs cards as far as I know and should work.
Mid 2011 Mac mini with HD 6630M
Late 2014 - Late 2015 5K iMacs
Some conflicts may happen with dGPU equipped Macs depending on the OS/firmware version.
"sudo ./automate-eGPU.sh -a" may help, but it's not guaranteed.
It's preferred to use the latest macOS version.
-uninstall option should be very reliable with Nvidia since there have no been any bug reports about this at GitHub for years. If some kexts are manually modded at any point prior to the script execution, uninstall option can’t restore the originals as they never were available.
-a option does the same as hot plugging during the boot process. As of macOS Sierra, Apple changed kext loading mechanism significantly and I am not sure if this is required at present but it was necessary to turn on with Macs released after 2014, especially if you had a multi-slot enclosure. When turned on, you just have to click the OK button and restart the Mac when a new Nvidia web driver is available. The -a mode is not supported on Macs released after 2015.
-url option allows Nvidia beta driver installation
-skip-web-driver allows to use Apple’s official Nvidia drivers (Kepler), starting from OS X 10.9.5
-clpeak option is a good tool to test if you have eGPU acceleration or not
-skip-agdc option should not mess up iMac 5K screen. If it does, it’s a bug. It does not provide eGPU screen output with Nvidia but CUDA, OpenCL and Metal calculation should be still possible. No one has tested AMD.
All options are meant to be used one at a time.
An alternative approach, including support for 5K iMac
@Rastafabi has applied a codeless kext solution to macOS eGPU automation. Currently for Nvidia cards only:
What's new in v1.0.1? (29-Apr-2017)
- Added support for AMD Baffin in 10.12.4
What's new in v1.0.0? (15-Jan-2017)
The script takes care of nearly every Mac model, thanks to feedback from eGPU community. It does matter if you use a multi-slot enclosure. The nMP freezes on startup on Sonnet III-D and Netstor NA211TB. You need to use the -a option. The same with the Late 2013 15” MBP (with 750M), and Early 2015 13” MBP.
On macOS Sierra, Nvidia driver kindly clears the obsolete “boot-args” key, and sets “nvda_drv” nvram value as default.
And last but not least, AMD Polaris & Fiji support for macOS. RX 480 and R9 Nano confirmed to work.
I’ve discontinued the script development but my friend FricoRico is willing to continue. He added Polaris support and advised Ikir in his Thunder3 implementation.
The first ever TB3 implementation was reality with an AMD card on macOS. FricoRico’s Polaris support changes were surprisingly similar to mine. I’ve simplified and fine-tuned, added a completely new cache file rebuilding. Now it’s better than ever. Beginning from the Mavericks build 13F34, the script survived from each OS upgrade in my testing.
goalques-MacBook-Pro:Desktop goalque$ sudo ./automate-eGPU.sh -skip-agdc Password: *** automate-eGPU.sh v1.0.0 *** * (c) 2016, 2017 by Goalque & FricoRico * ***************************************** Detected eGPU GK110 [GeForce GTX 780 Rev. 2] Current OS X 10.9.5 13F34 Previous OS X [not found] Latest installed Nvidia web driver Version: 334.01.03f01 Source: 3rd Party Install Date: 14/01/17 01:16 You are running official Nvidia driver. Checking IOPCITunnelCompatible keys... Searching for matching driver... Driver [334.01.03f01] found from: http://us.download.nvidia.com/Mac/Quadro_Certified/334.01.03f01/WebDriver-334.01.03f01.pkg Do you want to download this driver (y/n)? y % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 39.0M 100 39.0M 0 0 6485k 0 0:00:06 0:00:06 --:--:-- 6620k Driver downloaded. Removing validation checks... Modified package ready. Do you want to install (y/n)? y installer: Package name is NVIDIA Web Driver 334.01.03f01 installer: Upgrading at base path / installer: The upgrade was successful. installer: The install requires restarting now. Checking IOPCITunnelCompatible keys... IOPCITunnelCompatible mods done. Rebuilding caches... All ready. Please restart the Mac.
The original script (v0.9) was a small weekend project, in summer 2015. Let’s go back in time to the year 2011 when Apple introduced the first generation Thunderbolt Macs - the first machines featuring completely new I/O technology. The Mid 2011 Mac mini is still one of my favourite machines. Would have served well as a media center with an EyeTV, but Apple TV replaced it.
Whose idea was it originally to use external GPUs over Thunderbolt on OS X?
The first public implementations are from 2012:
The first version of a document for developers was published on [21/12/2011], and actually, the idea of “PCI expansion” is proposed by Apple in Figure 1-3:
Apple’s documents also describe the key word “IOPCITunnelCompatible". That’s all we need and how the script has been working when the initial AMD support was added in v0.9.4. It doesn’t apply AGDC modification when an AMD card is present.
Someone wrote on other forums that AppleIntelFramebufferAzul didn’t have anything to do with AGDC. I encourage questioning, and critical thinking.
IGFB:: %s:%d Do not allow Non-boot External Displays until asked by AGDC fb = %d\n
Written by Apple for debugging purposes in AppleIntelFramebufferAzul.kext’s connectionProbe method. This limitation was removed in Mavericks build 13F1066. Then Apple put it back on Yosemite. By comparing ioreg command outputs of 13F34 & 13F1066, I found another way to have eGPU screen output via an Nvidia card.
My Late 2013 13” MBP gave the screen output, but the 15” Late 2013 MBP didn’t. The reason was simply a missing board-id in AppleGraphicsDevicePolicy.kext’s Info.plist file.
Turned out that the same method was originally discovered by Pike [17/04/2014].
Late-2016 forum re-organization
I was kicked off from TechInferno forum for unexplained reasons very soon after Nando. The same thing happened to a group of other long-term TI users. I cannot recommend a site whose admins don’t reply to emails and ban users without explanation, and suddenly relocates to an East African island.
Why do I still have motivation to stand up after my automate-eGPU threads were hijacked? What theitsage did, is invaluable. He built us a new home. We are a community.
macOS eGPUs are popular
GitHub’s traffic statistics indicate that automate-eGPU.sh is still widely familiar regardless of my decision to quit. Selling hacks is a dead end idea due to Apple’s SLA. Bizon found a short cut and spammed Wolfe’s kickstarter project. Arrogant marketing. Why haven’t we seen any official driver development for outsourcing the CUDA/OpenCL/Metal computing? I do hope that Wolfe will be back with the solution that works SIP enabled. I know it’s possible. Gaming laptops are heavy and noisy, and have the worst battery life. Properly assembled eGPU enclosure is silent, it can be portable too but professionals prefer high-end performance and upgradable GPUs. Intel has finally allowed eGFX enclosures along with TB3 technology, but the start has been firmware mismatch mess.
It would be AMD’s and Nvidia’s duty to create official eGPU compatible drivers on macOS. If they don’t, we developers do our best. Some people still think what’s the purpose of kernel extension/EFI solution if the script is still necessary. It’s not necessary.
One small typo corrected.
Hopefully it simplifies the booting process with AMDs.
Yes it's time to celebrate ! Goalque & FricoRico ... Awesome work !
Today I testing and benchmarking my eGPU, and it work great for me !
DELL 24' 4k
MacBook Pro 15' (Mid 2015)
Sonnet Echo III D + Asus RX480 4G
And for comparison benchmark with AMD R9370X (internal macbook pro GPU)
R9 M370X (1080p) 8x Ultra
One small typo corrected.
Hopefully it simplifies the booting process with AMDs.
Included in next version?
@ikir: it's already included, but I don't know if it helps with your random boot issue.
@ikir: it's already included, but I don't know if it helps with your random boot issue.
I will try soon! PS: maybe i understood how to be able to boot with eGPU every time
Is this helpful only if I wanna run the eGPU on macos or on windows with bootcamp too?
@Rycco: The -a mode is helpful on Macs released Late 2014 and after, on Windows Boot Camp. It stays persistent only on OS X/macOS.
Today I continue eGPU benchmark, in this time with Resolume Arena 5.
I think DVI couse some problem. Maybe it was my DVI-HDMI adapter (looks veeery Chinese), but it slown down a lot GPU work.
I plug-in four 50' samsung TV and one projector on the eGPU graphic card, and one projector in HDMI output in my laptop. On the each output I play different video clip in 720p - in that case the fps is very low (13-15fps max).
Also I realize that system in monitor settings show 7 external monitor (though I put only 6 outputs). Cause was DVI output in eGPU graphic card. When I plug-out DVI projector FPS was much higher. (about 28-30fps) It's not perfect, but still quite nice score. When I plug 6th output i my second TB2 output fps stopped be satisfactory (20-24fps).
Also when I plug only 4 outputs on the eGPU graphic card (DVI included) fps still is very low (13-16fps).
@goalque I can report another success here with my 2016 13" nonTouchBar i7 MacBook Pro.
👏your work has been wonderful ever since v.01 of this script.
The one thing that tripped me up: it wasn't clear step-by-step that I needed to disable SIP. I only found out after I couldn't get eGPU to post... so i tried -a then -m and only then it instructed me to disable SIP.
Everything else was magic though. Cheers and looking forward to your EFI app when you get closer to showing.
Thanks for reminding to disable SIP. It's the first necessary step in OS X El Capitan and macOS Sierra.
Thank you for the updated script however, I still can't get my TITAN X Maxwell to work with nMP and Akitio Thunder2 🙁
Installed using the latest script
Tried to boot with eGPU connected
Freeze at Apple screen
Booted without eGPU
Ran script in -a mode
Connected eGPU and booted
No eGPU in Hardware > Graphics / Displays
Akitio is recognised in Hardware > Thunderbolt though
Am I missing something?
Edit: OS 10.12.2
The first thing is to check if your kexts are loaded:
kextstat -l | grep NVDA
Thanks @goalque - here's the output from Terminal:
165 0 0xffffff7f84c61000 0x3000 0x3000 com.nvidia.NVDAStartupWeb (10.1.5) B27A401E-3A0C-314A-B7A2-41D2499CF78E <12 4 3>
166 2 0xffffff7f84c64000 0x329000 0x329000 com.nvidia.web.NVDAResmanWeb (10.1.5) 5273B57C-0D1D-344A-93A7-BEFDDD7C0F73 <109 104 103 12 7 5 4 3 1>
167 0 0xffffff7f84f8d000 0x2a6000 0x2a6000 com.nvidia.web.NVDAGM100HalWeb (10.1.5) BEBAB721-B71D-3E29-8FE6-85C8215911B1 <166 12 4 3>
Edit: I hot plugged and ran the terminal command.
Edit 2: I had a look in System Information > Software > Extensions and ran the command again and the NVDAStartupWeb had unloaded.
What does it say after reboot?
I can't boot using -a mode with the eGPU plugged in now.
If I run the command without the eGPU connected / hot plugged there is no output.
You said earlier that "system boots"? So it's random... Have you confirmed that your GPU works in PC Windows?
Yes, it works on a PC.
Now I just get the kernel panic loop 😔
Is this a regular PC card (not Mac EFI)? It's very likely that your card is not eGPU friendly. I suggest you to try with other cards, such as a reference GTX 980, GTX 780, or something from AMD.
Thanks for your replies!
It is a regular PC card. It has been tested to work with the Alienware Graphics Accelerator, so works on PC eGPU side.
You're probably right, I should try other cards but I know people who have the TITAN X working with different enclosures and different systems. The nMP does not seem to be eGPU friendly!
Hello! After follow all the step, I successfully connect my GTX 970 eGPU to my 2015 Macbook Pro 15' ,at first it perform perfectly but few minutes later the AMD R9 m370 dGPU started to take all the work away from GTX 970! Can I just disable this shitty dGPU ?
After few miuntes later R9 M370 dGPU start to work.
iStat Menus useful tool.
@mdr1a: Either Iris Pro or M370X is always active. App-specific acceleration should work with this MBP as well:
@goalque I will try again next week with a 980Ti - I believe you confirmed that to work with the nMP?
@nickmilitello Curious as to what you're using with the Titan Z's... a 2013 Mac Pro?
and to answer my own question, so far no luck with 2 Titan Z on nMP. Boots fine with the single card plugged in. Hangs on boot with second card. tried different ports, etc. Any thoughts?
Also separately, has anyone tried it with FCPX 10.3. I get a crash when a single Z is plugged in every time. Didn't happen in previous version and only happen on nMP. MacBook Pro with eGPU and FCPX 10.3 everything is fine. Just nMP.
Here is the error.
[FFHGRendererInfo initWithLocation:] CGLSetVirtualScreen failed - didn't expect to get here. Investigate why this code ran: [FFHGRendererInfo initWithLocation:] CGLSetVirtualScreen failed: loc=2, ctxt=0x7f7f97d0b800, err=10008
I've been struggling with the nMP too - tried to get a Titan X running - no joy. What was your process for getting a single card working? Please can you share - possibly in another thread?
@nickmilitello: Have we discussed before?
EDIT: I think you are the same guy:
I am glad that you found egpu.io forum 🙂
At the times of El Capitan (or Yosemite), the nMP was able to run max 3 Kepler GPUs plus one Maxwell via an Amfeltec splitter by automate-eGPU.sh script. As I am not a nMP owner, can only say what I’ve been told. I don’t know the current situation in Sierra, but it should work with one eGPU at least. If not, the UEFI ROM of the GPU is not Mac friendly. Avoid XFX brand. Reference cards from Gigabyte and EVGA are often compatible.
You must disconnect all other devices to free up resources for multiple eGPU use. My script possibly enables Bus 1 and Bus 2 (4 upper ports) for eGPU use when the -a mode is turned on, but it’s recommended to use Bus 0.