[SCRIPT] automate-eGPU.sh v1.0.1 - macOS eGPU installation tool
 
Notifications
Clear all

[SCRIPT] automate-eGPU.sh v1.0.1 - macOS eGPU installation tool  

 of  32
  RSS

goalque
(@goalque)
Noble Member Admin
Joined: 4 years ago
 

The home of this script is at GitHub: https://github.com/goalque/automate-eGPU
License: https://github.com/goalque/automate-eGPU/blob/master/SCRIPT-LICENSE.txt

 


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:

csrutil disable

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 https://www.youtube.com/embed/MeOqTzGcgPI?start=70&end=152 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

 

3)  Restart the Mac

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):

EDIT [6/6/2017]:

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! Smile

https://egpu.io/forums/thunderbolt-enclosures/apple-metal-2-external-graphics-development-kit/


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.

2016 13" MBP w/ touchbar is not affected

8)  Connect eGPU and boot into macOS, and soon you hear the “whoosh” sound!

 


Supported GPUs

 

  • 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.

 


Unsupported Macs

 

Mid 2011 Mac mini with HD 6630M
Late 2014 - Late 2015 5K iMacs

Notes:

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.

 


Command-line options

 

-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:

https://egpu.io/forums/pro-applications/imac-egpu-simply-for-3d-accelleration/#post-3756

 


Changelog

 

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.

 

 

 


Background

 

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: 

[23/04/2012]

[24/08/2013] www.journaldulapin.com/2013/08/24/a-thunderbolt-gpu-on-a-mac-how-to/

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:

https://developer.apple.com/library/content/documentation/HardwareDrivers/Conceptual/ThunderboltDevGuide/Basics/Basics.html#//apple_ref/doc/uid/TP40011138-CH2-SW5

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 itsage 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.

 

automate-eGPU EFIapple_set_os.efi

Mid 2015 15-inch MacBook Pro eGPU Master Thread

 
2018 13" MacBook Pro [8th,4C,U] + Radeon VII @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 1809 [build link]  


Eli T, Cyril Pauya, fireheadman and 11 people liked
ReplyQuote
ikir
 ikir
(@ikir)
Prominent Member
Joined: 4 years ago
 

Time to celebrate!!!!!


MacBook Pro 2018 Touch Bar i7 quad-core 2.7Ghz - 16GB RAM - 512GB PCIe SSD
my awesome Radeon VII eGPU
my Mantiz Venus extreme mod with Sapphire Nitro+ RX Vega 64

 
2018 13" MacBook Pro [8th,4C,U] + Radeon VII @ 32Gbps-TB3 (Mantiz Venus) + macOS 10.15 [build link]  


Eydawn liked
ReplyQuote
goalque
(@goalque)
Noble Member Admin
Joined: 4 years ago

ikir and nando4 liked
ReplyQuote
Dschijn
(@dschijn)
Active Member
Joined: 4 years ago
 

Awesome!

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
samklee
(@samklee)
Eminent Member
Joined: 4 years ago
 

Thank you so much for your hard work in getting this together!

 

Is anyone running this script with tMBP 15 w/ a core and gtx970 or gtx980?  I still an ongoing issue where my success in running via mac os is dependent on timing the right moment to hotplug the core.  

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
Denis
(@denis)
New Member
Joined: 3 years ago
 

Yes it's time to celebrate ! Goalque & FricoRico ... Awesome work !

Today I testing and benchmarking my eGPU, and it work great for me ! 

Benchmark setup:
DELL 24' 4k 
MacBook Pro 15' (Mid 2015)
Sonnet Echo III D + Asus RX480 4G 

Benchmark test:
RX480 (1440p) 8x High
RX480 (1080p) 8x Ultra

And for comparison benchmark with AMD R9370X (internal macbook pro GPU)
R9 M370X (1080p) 8x Ultra

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

goalque and itsage liked
ReplyQuote
ikir
 ikir
(@ikir)
Prominent Member
Joined: 4 years ago
 
Posted by: goalque

 

One small typo corrected.

https://github.com/goalque/automate-eGPU/commit/323b78b16f3d21601573033d41cf09b0730f7898#diff-56b9b332313c51282ce78e1fd91d2d20

Hopefully it simplifies the booting process with AMDs.

   

Included in next version?

 


@denis

very nice!!!


MacBook Pro 2018 Touch Bar i7 quad-core 2.7Ghz - 16GB RAM - 512GB PCIe SSD
my awesome Radeon VII eGPU
my Mantiz Venus extreme mod with Sapphire Nitro+ RX Vega 64

 
2018 13" MacBook Pro [8th,4C,U] + Radeon VII @ 32Gbps-TB3 (Mantiz Venus) + macOS 10.15 [build link]  


ReplyQuote
goalque
(@goalque)
Noble Member Admin
Joined: 4 years ago
 

@ikir: it's already included, but I don't know if it helps with your random boot issue.

automate-eGPU EFIapple_set_os.efi

Mid 2015 15-inch MacBook Pro eGPU Master Thread

 
2018 13" MacBook Pro [8th,4C,U] + Radeon VII @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 1809 [build link]  


ReplyQuote
ikir
 ikir
(@ikir)
Prominent Member
Joined: 4 years ago
 
Posted by: goalque

 

@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


MacBook Pro 2018 Touch Bar i7 quad-core 2.7Ghz - 16GB RAM - 512GB PCIe SSD
my awesome Radeon VII eGPU
my Mantiz Venus extreme mod with Sapphire Nitro+ RX Vega 64

 
2018 13" MacBook Pro [8th,4C,U] + Radeon VII @ 32Gbps-TB3 (Mantiz Venus) + macOS 10.15 [build link]  


ReplyQuote
plans
(@plans)
New Member
Joined: 3 years ago
 

Thanks for all the hard work! Tried this and it resolved my boot issues on 2013 15" rMBP 750m --- boots straight into macOS / Windows 10. Stoked. 

Akitio Thunder2
980 Ti Reference

Will test the new non-touchbar 2016 13" i7 when it comes this week Smile

2016 13" Macbook Pro (no TouchBar)
Razer Core X
AMD Vega 56


itsage and nando4 liked
ReplyQuote
 of  32