Jump to content

Recommended Posts

NOTE: The US$180 BPlus TH05 (inc Thunderbolt cable) native Thunderbolt adapter used in this implementation was recalled in Jan 2013 due to (presumably) threats by Intel/Apple per TH05 recall notice. As a result refer to this solution that can be implemented today: [URL]http://forum.techinferno.com/diy-e-gpu-projects/4570-%5Bguide%5D-2012-13-rmbp-gtx660-sonnet-echo-express-se-%40-10gbps.html#post63754[/URL] (recommended for 15" rMBP/MBP due to iGPU issues) or 2013 11" Macbook Air + Win7 + Sonnet Echo ExpressCard + PE4L + Internal LCD [US$250].





While reading some threads about EFI-Boot on Mac I finally made my eGPU work.

I fixed my "error 12" by enabling VGA Output on the PCI bridge connected to my Thunderbolt ports using the EFI-Shell.



For this task I installed rEFIt and used "pci -i -b" / "pci xx xx xx -i -b" to find VGA devices and their bridges.

I noted all Bus/Dev/Func as well as the required registars. After that I had to set those registars using "mm".





On a Mac Book Pro 15" 2012 you'll have to do the following:



1. Install rEFIt



2. In Mac OS mount the EFI partition using terminal:

mkdir /Volumes/EFI

sudo mount -t msdos /dev/disk0s1 /Volumes/EFI




3. Create a textfile called "startup.nsh" in it's root:

echo -off

echo "Setting Registars"

# IGPU Intel HD 4000

# I noticed some improvements in boottimings while deactivating the Intel HD

# (don't use this if your running a 13" single gpu model)

mm 00020004 1 ;PCI :0



# eGPU PCI Bridge

# this line does the magic by enabling VGA Output

mm 0001013E 1 ;PCI :8



echo "Booting Windows"

fs0:EFIBootootx64.efi




4. Reboot while eGPU is connected (SW1=1) and select "start EFI-Shell" in rEFIt.

"startup.nsh" launches and Windows 8 starts up with eGPU enabled.





Update:


Replaced rEFIt with rEFInd which is is a fork of rEFIt.

I'm now able to create an menuentry which boots Windows using my startup script. I'm also able to hide the non functional Windows entries.



Here's my current refind.conf:



timeout 20

hideui banner

showtools shell, reboot, shutdown

dont_scan_dirs EFI/Boot, EFI/Microsoft



menuentry "Windows 8 with eGPU" {

icon EFI efindiconsos_win.icns

loader EFI oolsshell.efi

options "fs0:StartupseGPU.nsh"

}







Update (experimental):

Thanks to Linux's "apple-gmux" developer Andreas Heider I was able to switch graphics before booting Windows and enable Intel HD as primary VGA device. Though Intel HD is still bugged this probably allow us to enable Optimus functionality in the future.



You can also boot with Intel HD enable by installing gfxCardStatus 2.1.1(!) and setting it to integrated only, too.



For now you'll receive a black screen and reboot due to some "igdkmd64.sys" error.



Add this to your startup.nsh before "mm 0001013E 1 ;PCI :8":



echo Switch select

mm 7C2 1 ;IO :1

stall 100000

mm 7D4 1 ;IO :28



echo Switch display

mm 7C2 1 ;IO :2

stall 100000

mm 7D4 1 ;IO :10



echo Switch DDC

mm 7C2 1 ;IO :2

stall 100000

mm 7D4 1 ;IO :40



echo Power down discrete graphics

mm 7C2 1 ;IO :1

stall 100000

mm 7D4 1 ;IO :50



mm 7C2 1 ;IO :0

stall 100000

mm 7D4 1 ;IO :50



echo enable eGPU

mm 0001013E 1 ;PCI :8



echo Boot Windows

fs0:EFIBootootx64.efi











Some numbers:





























































Model:



rMBP 15"



OS:





Windows 8 EFI-Boot



CPU:



Intel-i7 3820QM @ 2.7gHz



RAM:



16GB



iGPU:



Intel HD Graphics 4000 (broken for Win8)



dGPU:



Nvidia GT 650m



Adapter:



TH05







I tried some overclocking and ended up with some strange results for 3D Mark 06. No matter what you change you'll have lower points than default settings.

































































dGPU GT650m



eGPU GT

X

560Ti





eGPU GTX660Ti



eGPU GTX660Ti OC



3DMark 2011:





2431p



4415p



71

10

p



74

63

p



3DMark Vantage:



10633p



16

755

p



23810p



24702p



3DMark 2006:



15289p



17479p



179

79

p



like 15900?











This might work for BIOS boot aswell but I don't know how to launch an MBR partition. (Update: BIOS method by nando)



I'll try to tweak this a bit and hope for an Intel fix.

Is there anyone with some more knowledge in EFI Shell?
  • Thumbs Up 10
Link to comment
Share on other sites

Good work in figuring this out . . .

echo -off
echo "Setting Registars"
# IGPU Intel HD 4000
# I noticed some improvements in boottimings while deactivating the Intel HD
mm 00020004 1 ;PCI :0

# eGPU PCI Bridge
# this line does the magic by enabling VGA Output
mm 0001013E 1 ;PCI :8

echo "Booting Windows"
fs0:\EFI\Boot\bootx64.efi

If can chainload to Win7 from Setup 1.1x using 'grub4dos mbr' or 'grub4dos uefi' then you could achieve the same result with setpci. Ie:


:: Disable the iGPU
:: mm 00020004 1 ;PCI :0
setpci -s 0:2.0 4.b=0

:: Enable (VGAEN) This bit controls the routing of processor initiated transactions
:: targeting VGA compatible I/O and memory address ranges.
:: mm 0001013E 1 ;PCI :8
setpci -s 0:1.1 3E.b=8

Then chainload to Win7.

The setpci command also allows bitmasking, so you could type 'setpci -s 0:1.1 3E.b=8:8' to just flip the 0x8 bit on (VGA enable).

Link to comment
Share on other sites

Appreciate you sharing your efforts Shelltoe. I have just recently begun reading up on eGPU for Thunderbolt MacBook's (as I have 15" 2011 with iGPU and dGPU).

I primarily want the extra GPU performance for Adobe After Effects and Final Cut X and 3D work in OSX 10.8. Do you have the 560 working in OSX?

Thanks,

Alex

Link to comment
Share on other sites

No OSX for now. Maybe the Hackintosh community has some information eg. Mulitbeast looks interessting

Graphics

Install to enable QE/CI full Graphics acceleration. Only install if the default

GraphicsEnabler=Yes is not working correctly.

NVIDIA Fermi > 2GB OpenCL Patch

These patches enable OpenCL for Fermi 4xx/5xx cards with 2GB or more of RAM.

10.8.0 OpenCL Patch

This will patch the 10.8.0 /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL using patch info from netkas.org.

NVIDIA GTX 470/480/560Ti 448/570/580 Support

These patches enable OpenCL for Fermi 4xx/5xx cards.

10.8.0 OpenCL Enabler

This will patch the 10.8.0 /System/Library/Extensions/GeForceGLDriver.bundle using patch info from netkas.org.

NVIDIA GTX 670/680/690 Support

10.8.0 Patched GeForceGLDriver.bundle

This will update the GeForceGLDriver.bundle in /System/Library/Extensions/ with a patched libclh.dylib from netkas.org to allow OpenCL on GTX 670, GTX 680 and GTX

690 cards.

Tested an GTX 660 Ti and received error 43 in Device Manager.

Link to comment
Share on other sites

Tested an GTX 660 Ti and received error 43 in Device Manager.

Use Setup 1.1x's Video Cards->Initialize function to eradicate error 43. So your startup.bat would look like:

:: Wait up to 60 secs for user to hotplug eGPU
call vidwait 60 10de:1183

:: Initialize NVidia eGPU to eradicate error43
call vidinit -d 10de:1183

:: IGPU Intel HD 4000
:: I noticed some improvements in boottimings while deactivating the Intel HD
:: mm 00020004 1 ;PCI :0
setpci -s 0:2.0 4.b=0

:: eGPU PCI Bridge
:: this line does the magic by enabling VGA Output
:: mm 0001013E 1 ;PCI :8
setpci -s 0:1.1 3E.b=8

:: Run result of PCI compaction (if any)
if exist pci.bat call pci.bat

:: Chainload to your OS. Depending on your partitioning,
:: it would be one of the following:
call grub4dos uefi
call grub4dos mbr

Link to comment
Share on other sites


setpci -s 0:2.0 4.b=0

returns in 'Warning: No device selected for "4.b=0"'


:: Run result of PCI compaction (if any)
if exist pci.bat call pci.bat

compaction hangs after a success while trying to reenter the menu

calling pci.bat at startup results in hang too


call grub4dos uefi

results in systemfailure and reboot (I saw error message followed by some lines of HexCode flashing up)

Link to comment
Share on other sites

returns in 'Warning: No device selected for "4.b=0"'

That means the HD4000 iGPU isn't on the pci-e bus. Explains why Optimus isn't possible in Win7.

compaction hangs after a success while trying to reenter the menu

calling pci.bat at startup results in hang too

Please remove the \config\pci.bat or the pci.bat line in startup.bat. Doesn't appear to like the result of pci compaction. The Macbooks have a low TOLUD so Win7 may be able to sort things out.

results in systemfailure and reboot (I saw error message followed by some lines of HexCode flashing up)

This is the #1 issue. If can't get chainloading out of Setup 1.1x to work then can't use it to do pci fixups on a Macbook. Good news is I am in the process of organising a 13" Macbook Pro now for delivery in approx 2 weeks. Will help tremendously to work out these issues. That's all except the 15" Macbook Pro iGPU activation which would require Apple's involvement.

The vidinit eradicates error43 by setting register 0x114 to 0x1 on the NVidia video card. Maybe you can use mm to do that? Do note that a lot of utilities won't allow pci-e registers beyond 0xFF to be modified. If mm is affected, but can work on a memory address then it's possible to calculate the mem offset where 0x114 of the NVidia video card is. MCFG + bus + slot + reg (google).

Link to comment
Share on other sites

That means the HD4000 iGPU isn't on the pci-e bus. Explains why Optimus isn't possible in Win7.

Please remove the \config\pci.bat or the pci.bat line in startup.bat. Doesn't appear to like the result of pci compaction. The Macbooks have a low TOLUD so Win7 may be able to sort things out.

This is the #1 issue. If can't get chainloading out of Setup 1.1x to work then can't use it to do pci fixups on a Macbook. Good news is I am in the process of organising a 13" Macbook Pro now for delivery in approx 2 weeks. Will help tremendously to work out these issues. That's all except the 15" Macbook Pro iGPU activation which would require Apple's involvement.

The vidinit eradicates error43 by setting register 0x114 to 0x1 on the NVidia video card. Maybe you can use mm to do that? Do note that a lot of utilities won't allow pci-e registers beyond 0xFF to be modified. If mm is affected, but can work on a memory address then it's possible to calculate the mem offset where 0x114 of the NVidia video card is. MCFG + bus + slot + reg (google).

Great news,

Did you get your hands on a retina 13"??

I recently got windows 8 so I might try this out when I get time.

Thanks Shelltoe for the info, really great work.

Link to comment
Share on other sites

Great news,

Did you get your hands on a retina 13"??

I recently got windows 8 so I might try this out when I get time.

Thanks Shelltoe for the info, really great work.

Have my eyes on a ~AU$900 2011 13" Macbook Pro with Thunderbolt port just to have a devel box to play with. A 13" MBPr is like > AU$1800 or a third-gen 13" MBP is > $1200. I can't justify that sort of $$ when it's highly likely my 12.5" Dell E6230 with i5-3320M that costs 1/3 or 1/2 of that is more satisfying to use (internal HSPA+ 3G, traditional keyboard, matte LCD, 1.6kgs, 66Whr 6-cell).

Only other benefit of the latest MBPr is it does have two Thunderbolt ports so might be possible to SLI/XF two eGPUs to get more performance. The earlier MPBs only have 1 Thunderbolt port. We discovered a while back that need at least a x4 link to do SLI so would need a pricier Sonnet/OWC Thunderbolt enclosure to try it.

Link to comment
Share on other sites

That means the HD4000 iGPU isn't on the pci-e bus. Explains why Optimus isn't possible in Win7.

Yeah its not

The vidinit eradicates error43 by setting register 0x114 to 0x1 on the NVidia video card. Maybe you can use mm to do that? Do note that a lot of utilities won't allow pci-e registers beyond 0xFF to be modified. If mm is affected, but can work on a memory address then it's possible to calculate the mem offset where 0x114 of the NVidia video card is. MCFG + bus + slot + reg (google).

Thanks. I'll try it as i saw some pcie options for mm. IMHO it would be great to have an efi only solution. New notebooks with uefi and preinstalled windows8 will probably have the same issues in the future.

Maybe its not even that hard. Found some grub files which I'll try later.

Link to comment
Share on other sites

Thanks. I'll try it as i saw some pcie options for mm.

In that case, there is an easier way to solve your error 43. Boot Setup 1.1x and run the Video cards->Initialize on your GTX660Ti. It will give you a PT commandline where you'll see the memory address of the 0x114 pci-e register of your GTX660Ti. Just translate that to your mm command, apply it, then boot Win7 and you should be golden.

Link to comment
Share on other sites

According to this guide on NBR, your iGpu should work by removing a file in windows.

So maybe you can get optimus working

User who wrote that had a MBA with an iGPU but no dGPU. We've discovered above that the iGPU isn't even present on the pci-e bus after boot on a dGPU equipped 15" MBP - the system boots with the dGPU as the primary active video device. In which case there's no chance of getting the x1 pci-e compression and transparent internal LCD mode that NVidia Optimus offers only when it detects the iGPU as the primary bootup device (4500MHD, HD, HD3000, HD4000). This requires Apple to modify how their 'bios' or whatever they use to boot the system with.

Wish it wasn't so. 15" MBP/MBPr is otherwise a impressive package: TB, dGPU-HD6750M/GT650M, i7-quad, thin-and-light. Just need a way to make the iGPU the primary bootup device in Windows.

Link to comment
Share on other sites

According to this guide on NBR, your iGpu should work by removing a file in windows.

So maybe you can get optimus working

Posted this guide earlier in this thread.

By removing "igdkmd64.sys" Windows will fallback to standard VGA drivers. That's not what I'd call "a working iGPU". Windows wont even boot if you don't do it.

Link to comment
Share on other sites

I don't know how I did it exactly but I'm currently running GTX660Ti.

I'd love to run benchmarks but 3DMark shows 3.7 fps during physics test. Seems like it only uses 1 core.

Already noticed this yesterday so its not because of the GTX660ti.

Anyone got a hint to fix this? Maybe i should restore my windows install as it worked some days ago.

EDIT:

Restoring a clean install solved all problems. GTX660Ti works with OPs startup.nsh

3D Mark 2011: 7056p

3D Mark Vantage: 23810p

3D Mark 2006: 17923p

Link to comment
Share on other sites

I don't know how I did it exactly but I'm currently running GTX660Ti.

I'd love to run benchmarks but 3DMark shows 3.7 fps during physics test. Seems like it only uses 1 core.

Already noticed this yesterday so its not because of the GTX660ti.

Anyone got a hint to fix this? Maybe i should restore my windows install as it worked some days ago.

EDIT:

Restoring a clean install solved all problems. GTX660Ti works with OPs startup.nsh

3D Mark 2011: 7056p

3D Mark Vantage: 23810p

3D Mark 2006: 17923p

Wow nice Shelltoe,

I pickup my retina 13" macbook pro tonight. I know it's overpriced but I've already sold my old macbook pro and decided to go the 13" route since I prefer the size of it. I may take it back and change to the 15 but having already used the 13" I'm fine with what I can do.

I will have to try set it up with an egpu this weekend.

Link to comment
Share on other sites

You should receive almost the same results using a 13" MacBook Pro with Quad-Core CPU.

EDIT:

Managed to launch with Intel HD enabled. It's not functional as no resources are allocated but maybe this can be done too.

There is a driver called apple-gmux for linux which enables GPU switching:

https://github.com/ah-/gmux/blob/master/apple_gmux.c

https://wiki.archlinux.org/index.php/MacBookPro_Retina

It sets several values using "outb" so it could work.

Link to comment
Share on other sites

I don't know how I did it exactly but I'm currently running GTX660Ti.

I'd love to run benchmarks but 3DMark shows 3.7 fps during physics test. Seems like it only uses 1 core.

Already noticed this yesterday so its not because of the GTX660ti.

Anyone got a hint to fix this? Maybe i should restore my windows install as it worked some days ago.

EDIT:

Restoring a clean install solved all problems. GTX660Ti works with OPs startup.nsh

3D Mark 2011: 7056p

3D Mark Vantage: 23810p

3D Mark 2006: 17923p

Are you using Optimus to push the image to the internal display? I'm interesting in seeing if Optimus works with the 600 series cards.

Link to comment
Share on other sites

Are you using Optimus to push the image to the internal display? I'm interesting in seeing if Optimus works with the 600 series cards.

No Optimus for now as Intel HD 4000 is no primary Bootdevice. Probably wont happen in the near future.

I've documented my setup instructions for a 17" MacBook Late 2011 + TH05 + Win 8 here:

http://forum.techinferno.com/diy-e-gpu-projects/2385-17-macbook-pro-late-2011-th05-win-8-setup-guide.html

Nice. Looking forward for some benchmarks.

Link to comment
Share on other sites

  • Tech Inferno Fan changed the title to 2012 15" rMBP GT650M + GTX560Ti@8Gbps-TB1 (TH05) + Win8.1 [Shelltoe]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.