[Sticky] 2016 Macbook Pro: solving eGPU error 12 in Windows 10  

  RSS

nando4
Honorable Member
Joined: 3 months  ago
Posts: 404
December 23, 2016 6:48 am  
Below are a number of strategies to resolve error 12 on a bootcamped Win10 2016 13" or 15" Macbook notebook. These are presented in order of user difficulty sometimes requiring a combination solution.
 
1. ensure your iGPU is enable. 

Posted by: goalque

So many people are missing the most important part:

https://egpu.io/forums/mac-setup/how-to-keep-mbps-irisiris-pro-activated-when-booting-into-windows-boot-camp

No need to disable anything, no DSDT override, it resolves the error code 12. Just use the Windows 10 version 10.0.10586.

 

2. Disable and re-enable the Thunderbolt PCIe bridge hosting the iSight Camera utilising a large PCIe aperature

Go to Device Manager -> View -> Device by Connection
Find the "iSight Camera". Disable the PCI Root Bridge above it.
Find your NVidia eGPU. Disable the PCI Root Bridge above it.
Wait for the Windows Error sound
Go to the same PCI Root Bridge above your NVidia.  Click "Enable"
Reboot your system to see error 12 gone.

 

3. Have windows reallocate your Thunderbolt PCIe bridges

A Windows reinstall being one way of doing this. The other is to:

Go to Device Manager -> View Devices By Connection. Find your eGPU then disable the PCIe bridges above it one at a time like shown below including the (in this case) Root port #5. . Then re-enable them. The idea is to force reallocation by Windows. This worked on a Zbook 15/17 G2. A variation of this is to uninstall the top level PCI Bridge/Port so as to have Windows re-pnp the system upon reboot.

 
 
 
4. Perform a DSDT override to allow eGPU allocation in 36-bit space
 
Reported by several 2016 MBP owners as fixing their error 12:
 
 
Do the bridge reallocation in (2) if still see error 12.
 
 

 5. Set the VGA Enable bit on the hosting PCIe bridge using rEFIt/rEFInd

 

i. Install rEFIt

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

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

iii. Create a textfile called "startup.nsh" in it's root. The bridge set  based on theitsage's 13" MBP research here and the 15" lspci output here.  Be sure to uncomment the required line as in the instructions:

echo -off
echo "Setting VGA Enable register on PCI bridge hosting eGPU . . ."

########################################################################
# Remove the hash on the line after your system to include that parameter
########################################################################
# 2016 13" MBP setting                                                 
# 2013 13" MBP
# 2013 11/13" MBA
# mm 001C043E 1 ;PCI :8
# 2016 15" MBP setting                                                 
# mm 0001023E 1 ;PCI :8

echo "Booting Windows"
fs0:/EFI/BOOT/bootx64.efi

iv. Reboot while eGPU is connected and select "start EFI-Shell" in rEFIt.

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

Consider replacing rEFIt with rEFInd , a fork of rEFIt. It allows creation of a menuentry which boots Windows using your startup script, plus hides the non functional Windows entries. @DANgerous25 covers this in the followup post . . .

 
Edited: 22 hours  ago

DIY eGPU Setup 1.35eGPUing since '09


ReplyQuote
DANgerous25
Eminent Member
Joined: 2 weeks  ago
Posts: 20
February 21, 2017 12:33 am  

Using rEFInd to set the VGA Enable bit

After a few days of intensive research, trial and error, I've managed to get rEFInd working with with a variation of the script posted by nando4. Caveat: I am on the road right now and don't have my eGPU with me, so I can't tell if the solution actually works. I'll edit the post when I can.

In any case the rEFInd setup may well be of use to some people in a similar boat to me. Attached is a screen of my boot loader screen. From left to right, top row: Win 10, Win 10 + eGPU (using variant of nando4's solution), MacOS Sierra 10.12.3. Bottom row: MacOS recovery mode, EFI Shell, power off, restart, exit rEFInd.

Rough procedure to achieve this:

  • Download and install rEFInd. (Suggested downloaddocumentation)
  • Download and install an EFI Shell.  (Suggested download | documentation*)
    • Note that to install this, you have to copy the Shell_Full.efi file in the download page to your EFI/tools directory, however you must rename it to shell.efi (lowercase). I believe that rEFInd expects the exact filename shell.efi no matter which shell you use. If you use the suggested rEFInd download then there's a handy script in the zip which you can execute with sudo <your_download_path>/mountesp to mount to the EFI area so that you can copy the shell binary and create/edit the script that is coming up later on. 
    • You have to enable the EFI shell in your refind.conf by ensuring that you have showtools shell in there somewhere.
    • * = The documentation link doesn't match the suggested download shell; if you want to use the matching shell then here is the download. The commands look the same but some of the syntax is different (and crucially the mm command is different). However this document gave me vital clues as to how to do anything with the shell. Top tip: the -b option shows output page by page, so try help -b and your troubles will diminish.
  • Create a script in the EFI/tools directory, which I've named win_plus_gpu.nsh (the name doesn't matter but you need to refer to it later). Note that I am using a late 2016 13" MBP with Touchbar hence the uncommented line. 
echo -off
echo "Setting VGA Enable register on PCI bridge hosting eGPU . . ."
########################################################################
# Remove the hash on the line after your system to include that parameter
########################################################################
# 2016 13" MBP setting
# 2013 13" MBP
# 2013 11/13" MBA
mm 001C043E 1 ;PCI :8
# 2016 15" MBP setting
# mm 0001023E 1 ;PCI :8
echo "Pausing for 10s"
stall 10000000
echo "Booting Windows"
echo "Executing command = fs0:\EFI\Boot\bootx64.efi"
fs0:\EFI\BOOT\bootx64.efi
  • If like me you are using a simple MacOS Sierra install with a single Windows 10 in Bootcamp, then adding the following lines to your refind.conf will give you the boot option that will launch your script via the EFI shell. If you're not using a rEFInd theme then you can omit the icon line.
menuentry "Win 10 + GPU" {
    icon EFI\refind\themes\rEFInd-minimal-master\icons\os_win8_eGPU.png
    ostype "Windows"
    loader \EFI\tools\shell.efi
    options "fs0:\EFI\tools\win_plus_gpu.nsh"
}

That's it! Some final notes/things to be aware of:

  • In case you are trying to reproduce the look of my boot loader, I've installed the rEFInd-minimal theme, and I've used a simple image editing program to essentially invert the colours in the background and the icons to make everything white on black. For Windows + eGPU I've resized the Windows icon that comes with the rEFInd-minimal theme, and added one of the other icons (with some colour editing) to the Windows logo for the eGPU one. I've removed the badges and hints by editing the refind.conf (or theme.conf if using a theme) with the line hideui badges,hints, and set the icon style to large by including small_icon_size 96 and big_icon_size 256 as separate rows in the refind.conf (although they still come up small on my MBP due to screen res).
  • I've had a lot of trouble doing anything useful with the EFI shell because my MBP+TB doesn't have working function keys whilst in the shell. So I can't do anything with the edit command (which is a text editor). This means that I have to edit files by mounting the EFI in MacOS. No big drama, but a bit annoying. If anyone has any clue how to enable function keys at the EFI stage, or if there is another way to use the edit command in the EFI shell without the use of function keys, then please let me know.
  • For the same function key reason above I can't do as much as I'd like with the rEFInd boot loader at the loader screen. Hitting shift+[=] (for +) gives some options, but not sure if they'll all the options. F keys and insert (neither of which I have) also do something, not sure what though.
  • The "mm" command in the EFI script isn't confirmed to work for me [yet]. Syntactically it is accepted by the shell, but I don't have a eGPU connected right now to see if it does anything. I also have no clue what it does... maybe someone can chime in here!
  • I have tried to change the screen resolution in rEFInd so that everything isn't so small, but haven't had much luck. If anyone has found a working set of resolutions for a 13" MBP then please let me know.

Do let me know if anyone has questions on the above.

Dan

1487658834-bootscreen.jpg
 
(Edit 22/2/2017: Simplified instructions, provided new shell which seems to work better.)
Edited: 2 days  ago

nando4 liked
ReplyQuote
DANgerous25
Eminent Member
Joined: 2 weeks  ago
Posts: 20
February 24, 2017 4:16 am  

Hi @nando4/anyone, finally I'm able to test the startup.nsh script. I don't get any errors, but it has no effect. My observations:

  • If I try to boot Windows with the eGPU plugged in, Windows won't boot. The Windows logo flickers a couple of times and just hangs.
  • If I boot into Windows with no eGPU plugged in, then plug it in once I'm logged in, I get error 12. My device manager is pretty much identical to yours except my GPU is the Intel Iris Graphics 550.
  • Disabling and enabling the switch ports doesn't seem to do the job.
  • I don't have an "iSight camera" item anywhere in the tree that I can see. I'm using a late 13" 2016 MBP+TB.

So my burning question is now this: nando4's script, and my rEFInd replica don't seem to help. Can someone help me to understand what this mm command is, what it is supposed to do in this context? If I can understand it then maybe I can determine if the values are somehow different to what's required for my setup.

Thank you!

 


ReplyQuote
goalque
Estimable Member
Joined: 3 months  ago
Posts: 174
February 24, 2017 5:02 am  

So many people are missing the most important part:

https://egpu.io/forums/mac-setup/how-to-keep-mbps-irisiris-pro-activated-when-booting-into-windows-boot-camp

It should be sticky. No need to disable anything, no DSDT override, it resolves the error code 12. Just use the Windows 10 version 10.0.10586.

Edited: 22 hours  ago

ReplyQuote
nando4
Honorable Member
Joined: 3 months  ago
Posts: 404
February 24, 2017 5:33 am  

DANgerous25, pls test @goalque's suggestion above and advise if it does resolve your error 12. If not, then I'll continue investigating some other EFI Bootloaders.

@goalque, I've quoted your suggestion as the #1 sticky item in the opening post.

Edited: 21 hours  ago

DIY eGPU Setup 1.35eGPUing since '09


ReplyQuote
DANgerous25
Eminent Member
Joined: 2 weeks  ago
Posts: 20
February 24, 2017 6:11 am  

@goalque - thank you for the suggestion and link. Here is the initial feedback as I was able to try it quickly owing to my rEFInd setup:

  • Following the suggestion in goalque's post I'm now able to start Windows with the eGPU plugged in. That's one problem solved, yippee!
  • I'm now getting error 12 in two of the four "PCI Express Downstream Switch Port" nodes, and the GTX 980 Ti no longer appears.
  • If I disable the first one, then scan for hardware changes, the GTX 980 Ti shows up in the list where it normally would but still shows error 12.
  • Uninstalled Windows nVidia drivers, rebooted, re-installed nVidia drivers from nVidia website. No change.
  • I've been doing all of the above whilst running my win_plus_egpu.nsh script, which has the magical line mm 001C043E 1 ;PCI :8 . I just tried running the script (again following goalque's apple_set_os.efi trick)... boom, this time I see my external monitor flash, and then my MPB+TB screen has a blue screen of death which is a blue background with some white fuzzy sprinkles. Then auto-reboot. That happens if I boot with the eGPU plugged in, or if plug it in after booting. So that mm command was doing something... 

The obvious gap I see at the moment is that my Win 10 build is different; goalque says use 10.0.10586. When I use winver it says "Version 1607 (OS Build 14393.693)". I'm guessing this is not the same. I'm not averse to re-installing if I can find the right version.

I will play with it a bit further and edit the post if anything new happens. 

(Edit: Added bullet point 4 & 5 above. Anyone know if my mm command is at fault and what the correct syntax is?)

Edited: 20 hours  ago

ReplyQuote
goalque
Estimable Member
Joined: 3 months  ago
Posts: 174
February 24, 2017 6:25 am  

Thanks,

I've successfully used this method with the non-touch 2016 13" MBP (both TB3 and TB2 enclosures).

For the dGPU equipped Macs I recommend combining gpu-switch integrated mode prior to executing apple_set_os.efi but I don't know if it will work.

Uninstall all the default Nvidia Windows drivers, and keep the eGPU monitor plugged in during the startup, then install the latest from Nvidia's web site. AMD cards are easier to get working with Windows 10 built-in drivers.


nando4 liked
ReplyQuote
Raphax
Active Member
Joined: 3 weeks  ago
Posts: 6
February 24, 2017 10:01 am  

@goalque so if I install the windows 10.0.10586 on my non-touchbar MBP 13" 2016 the eGPU will work without DSDT override (error 12)??

Thanks!!!

Macbook Pro 13" 2016 (Two Thunderbolt Port)
Akitio Thunder3 (Default)
ZOTAC NVIDIA GTX 1050TI 4GB

eGPU working with bootcamp and dstd override on Windows TestSigning ON


ReplyQuote
goalque
Estimable Member
Joined: 3 months  ago
Posts: 174
February 24, 2017 10:30 am  

@Raphax: I haven't tried any Pascal card yet, only Maxwell from Nvidia.


Raphax liked
ReplyQuote
DANgerous25
Eminent Member
Joined: 2 weeks  ago
Posts: 20
February 25, 2017 12:21 am  
Posted by: nando4

 

DANgerous25, pls test @goalque's suggestion above and advise if it does resolve your error 12. If not, then I'll continue investigating some other EFI Bootloaders.

Hi @nando4/goalque, unfortunately I just can't get it working. I've also tried re-installing Windows, and that doesn't help either. I don't have @goalque's recommended Win10 build, so either the problem is with the Win10 build, or it's something specific to the 13" MBP+TB (as I'm presuming only the non-TB versions were the ones tested).

Any ideas? I'm going to start looking into the DSDT override now. Looks messy though...

   


ReplyQuote
nando4
Honorable Member
Joined: 3 months  ago
Posts: 404
February 25, 2017 12:38 am  
Posted by: DANgerous25

 

Posted by: nando4

 

DANgerous25, pls test @goalque's suggestion above and advise if it does resolve your error 12. If not, then I'll continue investigating some other EFI Bootloaders.

Hi @nando4/goalque, unfortunately I just can't get it working. I've also tried re-installing Windows, and that doesn't help either. I don't have @goalque's recommended Win10 build, so either the problem is with the Win10 build, or it's something specific to the 13" MBP+TB (as I'm presuming only the non-TB versions were the ones tested).

Any ideas? I'm going to start looking into the DSDT override now. Looks messy though...

   

   

Dan, pls do up to Step 1 (ii) at https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/#step1 and then email me your \dsdt folder. I am preparing reference DSDT files at https://egpu.io/DSDT_overrides/ and would like to include your model.

DIY eGPU Setup 1.35eGPUing since '09


ReplyQuote
DANgerous25
Eminent Member
Joined: 2 weeks  ago
Posts: 20
February 25, 2017 12:43 am  

Ok nando4, doing now. The WDK is taking forever to download, and I'm not sure I've downloaded the right one (as I got a message about there being no compiler). The link in your other page is a landing page but doesn't point to a specific link (that I found, anyway).


ReplyQuote

eGPU

11 User(s) Online Join Server
  • navalava
  • DitIsTijn
  • CharlieWax
  • jahrudz
  • A§H»rUnRiÕt
  • -2EZ
  • Markcus
  • Wasabi
  • James2406
  • AquaeAtrae
  • Mikeal
  
Working

Please Login or Register