"Using an External GPU via Thunderbolt on a MacBook Pro
My plan was to attempt to run an external Graphics Card (GPU) via the Thunderbolt port of my MacBook Pro 13" (Retina, Late 2012) and see see if I could improve on the poor performance of the built-in Intel 4000 GPU (included in my Macbook Pro's 2.5GHz i5 processor).
The theory is as follows, GPU's are typically connected via PCIe ports and since there are several manufacturers that provide Thunderbolt to PCIe expansion chassis for MacOS, physically connecting a GPU to a Thunderbolt equipped Macintosh is easy. However, there is a catch; as delivered MacOS doesn't support or recognize a GPU connected to an external PCIe chassis via Thunderbolt.
Conducting some pre-purchase research on the internet was not encouraging since most of the opinions confirmed that MacOS will not drive displays over Thunderbolt and even if it would, since the PCIe bus is so much faster than Thunderbolt, a GPU will be continuously constrained by the bandwidth of the Thunderbolt interface. There were also a few articles by people that had successfully enabled video cards over Thunderbolt.
Due to the increasing popularity of Thunderbolt accessories, the price of PCIe Thunderbolt docks has dropped to the point where I was prepared to take the plunge and buy an AKiTiO "Thunder2 PCIe Box" to connect to my MacBook Pro (Retina, 13, Late 2012). This particular AKiTiO box supports a single half length PCIe card and supplies 25W of bus power (as per the PCIe specification).
Since my Macbook is fitted with a Thunderbolt 1 interface and the AKiTiO chassis has a Thunderbolt 2 interface (2x the transfer rate of Thunderbolt 1), my chosen combination will have the Thunderbolt 1 port on the MacBook Pro as the speed limiting bottleneck, however I still wanted to see what performance could be possible.
Half length GPU's are much rarer than full length ones which tends to limit the available choice, notwithstanding since MacOS 10.10 natively supports NVIDIA cards, I acquired a cheap Gigabyte GT 740 GPU (with 2 gig of ram), and a 600w AT (ATX?) Power supply to power the GPU (actually the GPU would have also been fine with a much less powerful power supply).
(See "Troubleshooting" notes below for general info on external power supply, jumpering and cables.)
I then followed the excellent instructions found on www.journaldulapin.com/2013/08/24/a-thunderbolt-gpu-on-a-mac-how-to. In addition to the guide, I used "Nano" contained within the MacOS terminal to actually perform the editing of the files and I also needed to issue the command "sudo kextcache -system-caches" to actually get the MacOS to boot and recognise the revised kext files. (and check permissions after editing.) With these tasks complete, I rebooted my MacBook with the GPU connected via Thunderbolt, startup was normal on the MacBook and the external screen remained blank.
Once the log-on screen was completed, the external screen came to life and I was running two screens. NB I have successfully run this modification on pretty much all versions of MacOS 10.10 (up to 10.10.5 at the time of writing).
"About this Mac" reported the two screens and also identified the Intel GPU for the MacBook Screen and the NVIDIA Card for the external display.
Interestingly the "System Information" correctly identifies the GPU and screens under "Graphics and Displays", but is unable to identify the NVIDIA card under PCI. (Because it's used via Thunderbolt?)
How does it perform, in short - very well.
I ran two benchmark tests, firstly the FurMark test from Geeks3D GPU Test, this reported 8fps for the Intel HD4000 GPU and 19fps on the NVIDIA GT 740.
I also ran Cinebench R15, this test generated much more interesting results, since under Cinebench the same GPU operated both screens, that is if I set the MacBook to run its built-in screen as the main display then Cinebench rendered using the Intel HD 4000 GPU on both displays, however if I started the application with the external screen connected to the Thunderbolt port as the main screen, then Cinebench would use the NVIDIA GT 740 to render on both screens. (? I'd think the internal display only uses the internal graphics, as that's the only connection it has. The 740's output is only connected to the external display. Unless it's using the 740 for rendering and passing that data to the Intel 4000's shared vram onboard memory? Like a 2013 Mac Pro uses the 2nd GPU for rendering/computations.)
This was a surprise, as all of my prior research had suggested that MacOS was incapable of using an external Thunderbolt GPU to render on the built-in MacBook Screen (only an Apple supplied discrete GPU such as the one fitted to the MacBook Pro 15" was capable of displaying on internal screen)
For Cinebench the following was observed:
- Intel HD 4000 GPU: MacBook Screen 15.25fps : External Screen 14.47fps
- NVIDIA GT 740 (T'Bolt): MacBook Screen 40.32fps : External Screen 43.73fps.
Following loading of the NVIDIA "Web Driver" (and re-modifying the kext files since they were reset), I ran Cinebench again and now 48.32fps was returned on the external screen and 41.34fps on the MacBook screen. so the NVIDIA driver is worth about 10% more speed on an external display for this test, however it had no real effect on the internal display. Clearly there is some additional overhead needed to pass a signal back along the Thunderbolt connection to the built-un display after it has been rendered by the external GPU.
(FYI: Nvidia web drivers are specific to OS X version/build numbers (and build numbers change when applying OS X security updates, which means another Nvidia driver update is required). I try to keep links to the latest (non-beta) drivers and CUDA posted at Nvidia's website for OS X 10.9.5 and later on the Video topics page. As noted above however, they will need to be modified for cards used in a Thunderbolt case. (Updates appear first in Nvidia Web Driver Prefs before they post a D/L page.)
BTW: Resetting the Mac's nvram will clear Nvidia Web driver setting and revert to the standard OS X driver, which doesn't support some PC Nvidia card models. (For instance as of this post date (fall 2015), the Nvidia GTX 780Ti and Titan Black require the Nvidia Web drivers *and* OS X 10.9.2 or later. The Nvidia GTX 750Ti, GTX950/960/970/980/980 Ti and Titan X require OS X Yosemite or later *and* the Nvidia web drivers.) I don't use OS X 10.11 El Capitan but I suspect these driver edits/mods will not work with "System Integrity Protection" enabled.)
Based on the benchmark tests, the NVIDIA GT 740 over Thunderbolt 1 offers over double (and almost triple) the performance of the Intel HD 4000 GPU, and you also get CUDA enabled with the GT 740.
Regardless of the selected GPU or screen, Cinebench returned the same CPU performance index. (GPU not used for that test.)
While I don't generally play games, I own a copy of Deus Ex - Macintosh Edition (not steam) and I also purchased a copy of Bioshock Infinity to see how the system would perform in this environment. In both cases I had the GPU connected to a HD TV and set the game to 1920 x 1080 resolution and standard quality settings. Deus Ex comfortably ran at a average of 55 - 60 fps and Bioshock made 25 - 30 fps. Increasing Bioshock to high quality settings has the frame count remain at about 25 - 30 fps. Both game exhibited some vertical sync issues (resulting in some screen tearing when panning the view)
A faster GPU would no doubt work better, and with modifications to the AKiTiO enclosure, a full length GPU card could be accommodated.
The GT 740 does not appear to be limited by the Thunderbolt 1 interface speed, however this is not a particularly fast GPU and maybe a faster card would show limitations to the Thunderbolt 1 standard. Recent Macintoshes have the faster Thunderbolt 2 ports and will be less affected.
Notwithstanding this simple and relatively cheap peripheral has effectively extended the life of my MacBook Pro and also made it more flexible. If Apple improves the Mac mini specification (bring back the Quad Core i7 option please) I think that the combination of its Thunderbolt 2 ports and the external GPU will make quite powerful and cheap alternative to a desktop Macintosh (which was my original motivation for this experiment).
A final word of warning, MacOS needs to be hacked for the card to be recognised and while Thunderbolt is a hot-pluggable standard, unplugging the Thunderbolt box with a GPU while the mac is running causes a Kernel Panic that requires a restart to clear.
Thanks Andrew, well done. (I have a late 2012 Mac Mini 2.3GHz i7 quad core and want to do something similar some day.) I don't have any apps that take advantage of Nvidia's CUDA but would be curious if/how well that would work in that setup. (Video topics page has links to Nvidia CUDA and Nvidia OS X drivers for OS X El Capitan, OS X 10.10.5, 10.9.5 and 10.8.5.)
Also remember even if the driver is working (card supported/driver correct), if it's not a "Mac" (Mac EFI) video card there's no video until after the OS loads drivers. (FYI for anyone using the TBolt card for the startup/main display.)