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

Page 1 / 11 Next
  RSS

goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 14, 2017 3:02 pm  

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

 

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

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] www.youtube.com/watch?v=koE5r0Kg1Rc

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

 

Edited: 1 month  ago

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


cpauya, fireheadman, thatorangeguy and 10 people liked
ReplyQuote
ikir
 ikir
Honorable Member
Joined:10 months  ago
Posts: 429
January 14, 2017 3:25 pm  

Time to celebrate!!!!!

eGPU.it | LG 29" curved ultrawide display
MacBook Pro 2016 touchbar i7 3.3Ghz - 16GB RAM - 512GB PCIe SSD + Mantiz Venus with AMD Radeon RX 580


ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613

ikir and nando4 liked
ReplyQuote
Dschijn
Active Member
Joined:10 months  ago
Posts: 16
January 16, 2017 10:09 am  

Awesome!


ReplyQuote
samklee
Eminent Member
Joined:9 months  ago
Posts: 31
January 16, 2017 1:18 pm  

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.  


ReplyQuote
Denis
New Member
Joined:8 months  ago
Posts: 3
January 16, 2017 1:54 pm  

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

Edited: 8 months  ago

goalque and theitsage liked
ReplyQuote
ikir
 ikir
Honorable Member
Joined:10 months  ago
Posts: 429
January 16, 2017 2:09 pm  
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!!!

eGPU.it | LG 29" curved ultrawide display
MacBook Pro 2016 touchbar i7 3.3Ghz - 16GB RAM - 512GB PCIe SSD + Mantiz Venus with AMD Radeon RX 580


ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613

ReplyQuote
ikir
 ikir
Honorable Member
Joined:10 months  ago
Posts: 429
January 16, 2017 3:10 pm  
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

eGPU.it | LG 29" curved ultrawide display
MacBook Pro 2016 touchbar i7 3.3Ghz - 16GB RAM - 512GB PCIe SSD + Mantiz Venus with AMD Radeon RX 580


ReplyQuote
plans
New Member
Joined:8 months  ago
Posts: 2
January 16, 2017 5:54 pm  

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 🙂

Edited: 8 months  ago

theitsage and nando4 liked
ReplyQuote
Rycco
Estimable Member
Joined:8 months  ago
Posts: 119
January 17, 2017 2:19 pm  

Is this helpful only if I wanna run the eGPU on macos or on windows with bootcamp too?

mid-2017 15" Macbook Pro RP555 + GTX1080i@32Gbps-TB3 (Mantiz Venus) + macOS & Win10


ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 17, 2017 2:53 pm  

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

https://egpu.io/forums/mac-setup/egpu-setup-1-30/#post-55

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


ReplyQuote
Denis
New Member
Joined:8 months  ago
Posts: 3
January 17, 2017 7:34 pm  

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


ReplyQuote
plans
New Member
Joined:8 months  ago
Posts: 2
January 18, 2017 5:02 am  

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

– Plans

Edited: 8 months  ago

goalque liked
ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 18, 2017 5:21 am  

Thanks for reminding to disable SIP. It’s the first necessary step in OS X El Capitan and macOS Sierra.

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


ReplyQuote
imcalledandy
Trusted Member
Joined:9 months  ago
Posts: 92
January 18, 2017 7:08 am  

Thank you for the updated script however, I still can’t get my TITAN X Maxwell to work with nMP and Akitio Thunder2 🙁

Steps:

Installed using the latest script

Shutdown

Tried to boot with eGPU connected

Freeze at Apple screen

Shutdown

Booted without eGPU

Ran script in -a mode

Shutdown

Connected eGPU and booted

System boots

No eGPU in Hardware > Graphics / Displays

Akitio is recognised in Hardware > Thunderbolt though

 

Am I missing something?

Edit: OS 10.12.2

Edited: 8 months  ago

ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 18, 2017 7:37 am  

The first thing is to check if your kexts are loaded:

kextstat -l | grep NVDA

Edited: 8 months  ago

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


ReplyQuote
imcalledandy
Trusted Member
Joined:9 months  ago
Posts: 92
January 18, 2017 7:57 am  

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.

Edited: 8 months  ago

ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613

ReplyQuote
imcalledandy
Trusted Member
Joined:9 months  ago
Posts: 92
January 18, 2017 8:23 am  

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.


ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 18, 2017 8:34 am  

You said earlier that “system boots”? So it’s random… Have you confirmed that your GPU works in PC Windows?

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


ReplyQuote
imcalledandy
Trusted Member
Joined:9 months  ago
Posts: 92
January 18, 2017 8:37 am  

Yes, it works on a PC.

Now I just get the kernel panic loop 😔


ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613
January 18, 2017 8:55 am  

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.

Edited: 8 months  ago

automate-eGPU.shapple_set_os.efi
--
late-2016 13" Macbook Pro nTB + Vega64@32Gbps-TB3 (Netstor HL23T) + macOS & Win10
late-2016 13" Macbook Pro nTB + GTX980/RX580@32Gbps-TB3 (Netstor HL23T) + macOS & Win10


ReplyQuote
imcalledandy
Trusted Member
Joined:9 months  ago
Posts: 92
January 18, 2017 9:12 am  

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!


goalque liked
ReplyQuote
Dschijn
Active Member
Joined:10 months  ago
Posts: 16
January 18, 2017 5:23 pm  

The script was featured on 9to5mac.

Edited: 7 months  ago

ikir, goalque and nando4 liked
ReplyQuote
ikir
 ikir
Honorable Member
Joined:10 months  ago
Posts: 429
January 18, 2017 6:03 pm  
Posted by: Dschijn

 

The script was featured on 9to5mac.

   

Very nice article and video indeed!

Edited: 7 months  ago

eGPU.it | LG 29" curved ultrawide display
MacBook Pro 2016 touchbar i7 3.3Ghz - 16GB RAM - 512GB PCIe SSD + Mantiz Venus with AMD Radeon RX 580


ReplyQuote
mdr1a
Active Member
Joined:8 months  ago
Posts: 15
January 19, 2017 2:54 am  

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.

?1

 

 

Edited: 8 months  ago

ReplyQuote
Denis
New Member
Joined:8 months  ago
Posts: 3
January 19, 2017 4:05 am  

mdr1a what app did you used on the last screenshot ? 


ReplyQuote
mdr1a
Active Member
Joined:8 months  ago
Posts: 15
January 19, 2017 9:30 am  

iStat Menus useful tool.


Denis liked
ReplyQuote
goalque
Honorable Member Admin
Joined:10 months  ago
Posts: 613

ReplyQuote
Page 1 / 11 Next
  
Working

Please Login or Register