• Announcements

    • Brian

      Introducing T|I Marketplace/Classifieds!   11/24/16

      After a long wait, Tech|Inferno now has a Marketplace/Classifieds section where all registered (promoted and above) members can participate in selling, trading and seeking out items. This service is free to all members to use as they wish. Currently all ads last for a period of 14 days before they expire for promoted users. Those users belonging to T|I Elite, Contributor, Developer and Moderator have access to 30 day ad periods that are featured   Some easy rules to remember: Do not post multiple ads of the same product. Do not advertise here if you are a retailer or business. You must contact Tech|Inferno for advertising space. Keep ads civil, do not try to lowball members. You may contact them in private via PM if you feel their price is not to your liking. Harassing members will result in an infraction. It is recommended you have Heatware/eBay feedback to establish trading credibility.    Tech|Inferno assumes no liability for any sales posted in the Classified section. Always use common sense when buying/selling with traders and ask for their heatware/ebay feedback!   Enjoy!
euqlaog

[SCRIPT] Automating the installation of eGPU on OS X (inc display output)

932 posts in this topic

I've ceased development of this script in favor of my EFI app. However, others are invited to continue its development on GitHub, for personal and non-commercial use only.

 

I recommend encryption. It doesn’t prevent rip off, but makes it a bit more difficult. The encrypt/decrypt mechanism is pretty trivial. I am sure that there are programmers out there who know how pipelines and I/O redirections work. You should be able to generate new encrypted copyright notices easily in the Terminal.

 

Please do not release anything under the MIT (v0.9.8), it would be VOID under the Apple’s SLA:

http://images.apple.com/legal/sla/docs/macOS1012.pdf

 


Nando suggested me to create a new thread how to get external monitors detected via Nvidia eGPU on OS X. Well, I did something more - a shell script with the following features:

 

- Detects your OS X product version and build version

- Lists available web drivers from Nvidia

- Automatic download and driver installation

- Automatic IOPCITunnelCompatible mods + web driver mod

- Detects your Mac board-id and enables eGPU screen output

- Confirmed: Mid 2014 15” rMBP Iris Pro, Late 2014 Mac mini

 

We know that new technologies, including TB3, USB-C, and Apple’s Metal API in OS X 10.11 most likely bring external GPUs to a completely new level, so I try to keep this post up to date.

 

The script is designed to work in any Mac / OS X version (if the web driver is available from Nvidia) and it tries to determine correct driver download path by data scraping techniques. Installation takes place within the Terminal. You don’t have to double click the pkg. Just press “y” to questions. This is the first version, but already confirmed to work with two Macs.

 

Instructions:

1) Download the script on your desktop

 

The latest version:

curl -o ~/Desktop/automate-eGPU.sh https://raw.githubusercontent.com/goalque/automate-eGPU/master/automate-eGPU.sh

 

2) chmod +x ~/Desktop/automate-eGPU.sh

3) cd ~/Desktop

4) sudo ./automate-eGPU.sh

 

UPDATE:

Version 0.9.9 is released with new licensing:

Copyright (c) 2016 Goalque

 

1. You are free to modify and redistribute the script, as long as the above copyright notice 

    and this list of conditions are retained.

2. Backward modification or merging with earlier versions is prohibited, including changes to support macOS Sierra as described in issue #31.

3. No one is allowed to wrap the script into an installation tool or execute it from another program or script.

    No one is allowed to modify Apple's copyrighted binary files.

4. You may not use this script for commercial purposes.


What’s new in 0.9.9:

* native support (experimental) for R9 Nano and RX 480 with a Baffin personality

* Nvidia web driver support (experimental) for macOS Sierra beta builds

 

What's new in 0.9.8

- Support for OS X Mavericks 10.9.5 and Kepler cards
- Added board-ids for iMac15,1 and iMac17,1
- Fixed issue #8
- Fixed issue #9 (thanks keymone)
- Fixed issue #13

 

What's new in 0.9.7

- SetIOPCIMatch() function which sets and appends device IDs (both the AMD and Nvidia)

- Automatic NVIDIA Driver Manager uninstalling

- Minor bug fixes

 

What's new in 0.9.6

- Detects dGPUs for determining the correct [-a] mode behaviour

- Fixed issue #3 https://github.com/goalque/automate-eGPU/issues/3

- Fixed issue #4 https://github.com/goalque/automate-eGPU/issues/4

- Checks for the existence of application support path and if the script is ran as root

- Support for OS X El Capitan 10.11 beta 7 (15A263e)

 


- Native AMD support, masks for any card if codename is found

- Possible to use Nvidia official driver for Kepler cards [-skipdriver]

- Detects Thunderbolt connection

- Detects GPU name by scraping device id from The PCI ID Repository

- Hot-plugging required

- Automatic backups with rsync

- Uninstalling with [-uninstall] parameter

- OpenCL benchmarking (https://github.com/krrishnarraj/clpeak)

30 people like this

Share this post


Link to post
Share on other sites

O M F G

That is awesome! So with a vanilla OSX 10.10.X I will just have to follow the 3 steps? No other preparations?

Share this post


Link to post
Share on other sites

Yes, the terminal is a very powerful tool :) It should work even if you have already pre-installed web driver or modified kexts (correctly), but there might be situations that it cannot handle. Feedback is welcome!

Share this post


Link to post
Share on other sites

Tested on Late 2013 15” rMBP Iris Pro, External Display and eGPU is now working, epic! :joyous:

post-32580-1449500029506_thumb.png

But I have that errors from script:

Error 17 File Exists, but there is no any file with name expanded.pkg on the desktop and it wasn't there. :suspicion:

post-32580-14495000295457_thumb.png

post-32580-14495000294374_thumb.png

2 people like this

Share this post


Link to post
Share on other sites
@Shez: Was the eGPU switched on during the installation? Or was it turned off, installed everything and rebooted with eGPU?

Share this post


Link to post
Share on other sites
Tested on Late 2013 15” rMBP Iris Pro, External Display and eGPU is now working, epic! :joyous:

But I have that errors from script:

Error 17 File Exists, but there is no any file with name expanded.pkg on the desktop and it wasn't there. :suspicion:

Thanks!

- Are you sure that you didn’t have your own “expanded.pkg” on your desktop before running the script? I should add check or force delete if there exists such a file.

- Did you run the script with sudo?

- The expanded.pkg is a temporary file, it will be deleted right after web driver modification (in order to pass validateHardware/validateSoftware checks). If you try to run the script again, do you still see “file exists” error? Answer “n” if you see error messages.

- You have previously added manually IOPCITunnelCompatible keys, that’s why it notifies “Entry already exists”. This is a known issue.

Share this post


Link to post
Share on other sites

Hey Goalque,

first of all, I want to express my deepest respect for this amazing work. I think this is a huge step forward – towards a "install and then plug and play"-solution. Really great job, I cannot appreciate that enough.

I tried it with a Macbook Air 13" (mid-2013, OS X 10.10.3) with a Gigabyte GTX 750Ti Windforce + Sonnett Echo SE II. Unfortunately, the card is just detected as Nvidia chip model afterwards but as this was not my first try to use this card, I'm beginning to think that the card is the problem and not the setup. I'll try out another card as soon as I can get it. Will keep you posted if it works with that.

Share this post


Link to post
Share on other sites

@goalque: Just had a test installation. Works like a charm. Had to change into the desktop folder, though…

post-26280-1449500029688_thumb.jpg

post-26280-14495000297279_thumb.jpg

1 person likes this

Share this post


Link to post
Share on other sites

Maybe some suggestions:

1) I tried it on the 10.10.4 Beta and (of course) it doesn't detect the driver from NVIDIA. Maybe you could add an exit to the script there because it was searching forever at this point.

2) Sometimes it might be good just to do the kext-thing e.g. – maybe you could implement a settings-variable where the user can choose with which step to start. :)

3) It'd be cool to have the same backwards. I.e. if your script would backup the kexts and a complementary script could undo everything if necessary.

4) What would you think about (optionally?) implementing the CUDA-installation as well?

PS: Sorry for the ongoing updating, I'm just really exited about this.

1 person likes this

Share this post


Link to post
Share on other sites
Maybe some suggestions:

1) I tried it on the 10.10.4 Beta and (of course) it doesn't detect the driver from NVIDIA. Maybe you could add an exit to the script there because it was searching forever at this point.

2) Sometimes it might be good just to do the kext-thing e.g. – maybe you could implement a settings-variable where the user can choose with which step to start. :)

3) It'd be cool to have the same backwards. I.e. if your script would backup the kexts and a complementary script could undo everything if necessary.

4) What would you think about (optionally?) implementing the CUDA-installation as well?

PS: Sorry for the ongoing updating, I'm just really exited about this.

Great development ideas! :) Yes, data scraping method is not perfect yet. The user should check if the first item of the list build version matches to “Your build version”.

CUDA is only required if you run GPGPU apps, which use CUDA. Technically possible to automate this as well.

@Dschijn, @Simurgh5, @Shez:

As Dschijn told, the current directory must be ~/Desktop. I will try to fix this, but “cd ~/Desktop” is a solution for now. I am curious about 2015 Mac models, we have seen some unsuccessful tries on OS X as well.

Share this post


Link to post
Share on other sites
@Shez: Was the eGPU switched on during the installation? Or was it turned off, installed everything and rebooted with eGPU?

Fully off and not connected, rebooted with eGPU after installation.

- Are you sure that you didn’t have your own “expanded.pkg” on your desktop before running the script? I should add check or force delete if there exists such a file.

Yes I'm sure.

- Did you run the script with sudo?

Without sudo, looks like I missed sudo word being so exciting from this script

I think you should add force permission check before start the script, if possible. And if someone is already installed Web driver but want only activate eGPU screen output, your script doesn't allow that at that state of version of course ;)

1 person likes this

Share this post


Link to post
Share on other sites

Can confirm that the eGPU display output on a 13" MBPr late 2013 is working as well with that script!

post-26280-14495000358054_thumb.jpg

post-26280-1449500035837_thumb.jpg

Share this post


Link to post
Share on other sites

post-36170-14495000360068_thumb.jpgHi guys,

can you give me some advice how to select my eGPU after using the script?

Nvidia taskbar icon, syssettings panel active, Web Driver is selected, I see both cards in sysinfo but on the screen tab only iGPU is "active".

I'm on OSX 10.10.2

my terminal log:

air:~ user$ chmod +x ~/Desktop/automate-eGPU.shair:~ user$ cd ~/Desktop/

air:Desktop user$ sudo ./automate-eGPU.sh

Password:

Your OS X version: 10.10.2

Your build version: 14C1514

Searching available drivers...

Found the following matching drivers:

-------------------------------------

346.01.01f01 for 10.10.2 (14C1514)

343.02.02f04 for 10.10.2 (14C1514)

-------------------------------------

Newest driver:

http://us.download.nvidia.com/Mac/Quadro_Certified/346.01.01f01/WebDriver-346.01.01f01.pkg

Do you want to download this driver to your desktop (y/n)?

y

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 48.0M 100 48.0M 0 0 1449k 0 0:00:33 0:00:33 --:--:-- 9593k

Driver downloaded.

Modifying driver...

Driver mod done. Do you want to install (y/n)?

y

installer: Package name is NVIDIA Web Driver 346.01.01f01

installer: Installing at base path /

installer: The install was successful.

installer: The install requires restarting now.

IOPCITunnelCompatible mods done.

Add: ":IOKitPersonalities:AppleGraphicsDevicePolicy:ConfigMap:Mac-35C1E88140C3E6CF" Entry Already Exists

Nvidia eGPU screen output enabled.

IOBluetoothHostControllerUARTTransport.kext has no Info.plist file.

IOBluetoothHostControllerUARTTransport.kext has no Info.plist file.

IOBluetoothHostControllerUARTTransport.kext has no Info.plist file.

IOBluetoothHostControllerUARTTransport.kext has no Info.plist file.

IOBluetoothHostControllerUARTTransport.kext has no Info.plist file.

All ready. Please restart the Mac.

air:Desktop user$

post-36170-14495000359739_thumb.jpg

Share this post


Link to post
Share on other sites

@BastiFH: Did you connet the external monitor directly to the eGPU? Seems like you have it just connected to the MB.

Share this post


Link to post
Share on other sites
@Dschijn: Air -Apple TB-Cable-> Akitio -Akitio TB-Cable-> LGI even switched TB ports on the Akitio, detached Akitio and switched to default gfx driver and back on; nothing.--checked kext files for CFBundleIdentifier:
/System/Library/Extensions/NVDAStartup.kext/Contents/Info.plist/System/Library/Extensions/IONDRVSupport.kext/Info.plist[FONT=Consolas]/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/Info.plist[/FONT]
[FONT=Consolas]<[/FONT][FONT=Consolas]key[/FONT][FONT=Consolas]>IOPCITunnelCompatible[/FONT][FONT=Consolas]key[/FONT][FONT=Consolas]>[/FONT][FONT=Consolas]<[/FONT][FONT=Consolas]true[/FONT][FONT=Consolas]/>[/FONT]
^ was missing a couple of times, reboot but no luck.

Share this post


Link to post
Share on other sites
Quote

@Dschijn: Air -Apple TB-Cable-> Akitio -Akitio TB-Cable-> LGI even switched TB ports on the Akitio, detached Akitio and switched to default gfx driver and back on; nothing.--checked kext files for CFBundleIdentifier:

/System/Library/Extensions/NVDAStartup.kext/Contents/Info.plist/System/Library/Extensions/IONDRVSupport.kext/Info.plist[FONT=Consolas]/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/Info.plist[/FONT]
[FONT=Consolas]<[/FONT][FONT=Consolas]key[/FONT][FONT=Consolas]>IOPCITunnelCompatible[/FONT][FONT=Consolas]key[/FONT][FONT=Consolas]>[/FONT][FONT=Consolas]<[/FONT][FONT=Consolas]true[/FONT][FONT=Consolas]/>[/FONT]
^ was missing a couple of times, reboot but no luck.



Where's that second TB cable from Akitio to LG plugged into? The Akitio itself, second port? That way you'd be daisy chaining it with your Macbook which won't let it be powered by the eGPU. Attach the monitor directly to the graphics card.

Share this post


Link to post
Share on other sites

No no no no no… you are connecting a Thunderbolt display to the 2nd TB port on the AKiTiO? That is daisy chaining TB devices and by that your LG is directly connected to the MacBook. To get eGPU display output, you have to connect the display to the output ports of the GPU you are using and not the TB device hosting it.

Share this post


Link to post
Share on other sites

Got a new 750Ti – your script makes it run smoothly. Beautiful. Wonderful. Thank you so much for this! :-)

MBA 2013 – OS X 10.10.3. Check!

Share this post


Link to post
Share on other sites

I know, it is an insanely simple modification but here is a shortened version that allows you to start with any Version of the Nvidia Driver lying on the desktop (~/Desktop/WebDriver.pkg). I found it useful while trying the OS X 10.10.4 beta driver.

#!/bin/sh#

# Script (automate-eGPU.sh)

# This script automates Nvidia eGPU setup on OS X.

#

# Version 0.9 - Copyright © 2015 by goalque (goalque@gmail.com)

#

# - Detects your OS X product version and build version

# - Lists available web drivers from Nvidia

# - Automatic download and driver installation

# - Detects your Mac board-id and enables eGPU screen output

# - Confirmed: Mid 2014 15” rMBP Iris Pro, Late 2014 Mac mini

#

echo "Modifying driver..."

pkgutil --expand ~/Desktop/WebDriver.pkg expanded.pkg

sed -i '' -E "s/if \(\!validateHardware\(\)\) return false;/\/\/if \(\!validateHardware\(\)\) return false;/g" ~/Desktop/expanded.pkg/Distribution

sed -i '' -E "s/if \(\!validateSoftware\(\)\) return false;/\/\/if \(\!validateSoftware\(\)\) return false;/g" ~/Desktop/expanded.pkg/Distribution

pkgutil --flatten ~/Desktop/expanded.pkg ~/Desktop/WebDriver.pkg

rm -rf ~/Desktop/expanded.pkg

echo "Driver mod done. Do you want to install (y/n)? "

read answer

if echo "$answer" | grep -iq "^y" ;then

volume_name=$(diskutil info / | awk '/Volume Name/ {print substr ($0, index ($0,$3))}')

/usr/sbin/installer -target /Volumes/"$volume_name" -pkg ~/Desktop/WebDriver.pkg

else

echo "Ok."

exit

fi

/usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:1:IOPCITunnelCompatible bool true" /System/Library/Extensions/IONDRVSupport.kext/Info.plist

/usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:2:IOPCITunnelCompatible bool true" /System/Library/Extensions/IONDRVSupport.kext/Info.plist

/usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:3:IOPCITunnelCompatible bool true" /System/Library/Extensions/IONDRVSupport.kext/Info.plist

/usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:NVDAStartup:IOPCITunnelCompatible bool true" /System/Library/Extensions/NVDAStartup.kext/Contents/Info.plist

/usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:BuiltInHDA:IOPCITunnelCompatible bool true" /System/Library/Extensions/AppleHDA.kext/Contents/Plugins/AppleHDAController.kext/Contents/Info.plist

echo "IOPCITunnelCompatible mods done."

sudo /usr/libexec/PlistBuddy -c "Add :IOKitPersonalities:AppleGraphicsDevicePolicy:ConfigMap:"$(ioreg -c IOPlatformExpertDevice -d 2 | grep board-id | sed "s/.*<\"\(.*\)\">.*/\1/")" string none" /System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/AppleGraphicsDevicePolicy.kext/Contents/Info.plist

echo "Nvidia eGPU screen output enabled."

nvram boot-args="kext-dev-mode=1 nvda_drv=1"

touch /Extensions

kextcache -system-caches

echo "All ready. Please restart the Mac."

Share this post


Link to post
Share on other sites

The next version includes:

- detects if your system has been updated and suggests reinstallation

- if the new driver is not yet available from Nvidia after OS X update (for example 10.10.4), it can modify the previous driver on the desktop and reinstall it within the terminal automatically

- bug fixes, much better error handling if the web driver is not found

3 people like this

Share this post


Link to post
Share on other sites

Keep it up goalque! Really like it that you are keep improving it. :D

Share this post


Link to post
Share on other sites

I can now also confirm that it works with the 2014 15-inch MBPr with GT750m – congratulations. :)

Share this post


Link to post
Share on other sites
I can now also confirm that it works with the 2014 15-inch MBPr with GT750m – congratulations. :)

So… what was the problem? :D

Share this post


Link to post
Share on other sites

@ Dschijn + Morv:

thanks for pointing that out, I thought it would be logical to use the same kind of (TB) port for the screen.

Anyway, by the time you answered I already threw out all that nvidia stuff.

So I just reinstalled the script (new version) and connected though DP to my LG but the only difference is in sysinfo: the LG screen is now assigned to my gtx 970.

But on the screen tab you can see that only iGPU is used for both screens, web driver is selected.

Air -original TB cable-> Akitio -DP cable-> LG

tried switching drivers with and without TB cable attached

thanks for your support :)

post-36170-14495000360366_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now