Mid 2015 15-inch MacBook Pro eGPU Master Thread
 
Notifications
Clear all

Mid 2015 15-inch MacBook Pro eGPU Master Thread  

 of  10
  RSS

nicefour
(@nicefour)
Active Member
Joined: 2 months ago
 

I managed my sapphire rx 580 to work in windows by using startup.nsh. Now windows can boot with rx right to internal screen and without it as well (by using igpu). Also i disable some pci bridges to lower pci pressure.  After this i flashed my rx 580 bios from sapphire to the standart  (amd rx580 card id) and now the card is fully plug and play in mac os. But i dont think that mac is using full card power due to internal screen. I will post a buid soon!

*If i have my thunderbolt to ethernet adapter connected - windows cannot boot.

Now i have few questions :

1. how to disable dgpu im mac os?                     2. is it possible to drive internal screen from m.2 gpu in mac os (now the screen acceleration  goes either from iris or 370x)

 

* I also saw one detail about this topic, if you open it in safari (mobile) - you cannot see all the answers. In google chrome - can. For example i’m not able to see @macnexus answer about hevc support  

 

 

This post was modified 1 month ago

modulating egpu with my imagination and taobao links


ReplyQuote
macnexus
(@macnexus)
Active Member
Joined: 2 months ago
 
Posted by: @nicefour

I managed my sapphire rx 580 to work in windows by using startup.nsh. Now windows can boot with rx right to internal screen and without it as well (by using igpu). Also i disable some pci bridges to lower pci pressure.  After this i flashed my rx 580 bios from sapphire to the standart  (amd rx580 card id) and now the card is fully plug and play in mac os. But i dont think that mac is using full card power due to internal screen. I will post a buid soon!

*If i have my thunderbolt to ethernet adapter connected - windows cannot boot.

Now i have few questions :

1. how to disable dgpu im mac os?                     2. is it possible to drive internal screen from m.2 gpu in mac os (now the screen acceleration  goes either from iris or 370x)

 

* I also saw one detail about this topic, if you open it in safari (mobile) - you cannot see all the answers. In google chrome - can. For example i’m not able to see @macnexus answer about hevc support  

 

 

1. I have tried to disable the dGPU using the startup.nsh script but the internal LCD remains blank when I boot into macOS.

2. Further tests required to confirm. I think it is possible although it might be app specific? If you can let me know how to test it I am happy to give it a try.

Computer: Mid 2015 MacBook Pro 15" with M370X dGPU
eGPU: R43SG + Sapphire Nitro+ RX 580 8GB


ReplyQuote
macnexus
(@macnexus)
Active Member
Joined: 2 months ago
 

@nicefour, I have carried out some tests on macOS Catalina using the internal LCD only. I have Lilu and WhateverGreen kexts installed. Boots args are "agdpmod=pikera shikigva=80 -wegtree" without any startup scripts. This configuration does not require OpenCore or Clover. Just two kexts and boot args. You will notice in the screenshots that the M370X dGPU is detected as Slot 1 and the RX 580 (via M.2 PCI) is detected as Slot 2. Both GPUs are shown as GFX0 in the IO Register. Without the kexts, the RX 580 will be detected as SSD0 in the IO Register and there will be no HEVC hardware acceleration.

In summary, the internal LCD can be accelerated by the RX 580 but it is dependant on the app. I am not sure if there is any method to specify which GPU you prefer the app to use at launch. There is no "Prefer eGPU" option as the RX 580 is not connected via Thunderbolt 2.

I get different results when I change the settings in gfxCardStatus to "Integrated only", "Discrete only" or "Dynamic Switching".

 

Starcraft Remastered with "Integrated only" settings:

As you can see in the screenshot below, the game is accelerated using RX 580. The dGPU is not used at all.

Geekbench 5 Metal test. There is option to select RX 580 in Geekbench so it is obvious that the RX 580 was used:

HEVC hardware acceleration detected by VideoProc and confirmed via playing a 4K 60fps H.265 video using VLC. It is impossible to play this video smoothly without HEVC hardware acceleration.

Unigine Heaven is one of the apps that do not work with this set up. In "Integrated only" mode, it uses the iGPU. In "Discrete only" mode, it uses the M370X. I am not sure how to force it to use the RX 580.  

When used with a 5K monitor (via 2 x DPs) connected to the RX 580, I have to force "Discrete only" mode sometimes to enable some apps to launch. I am not sure if this is a problem with MBP 2015 15" with dGPU. Perhaps @itsage can carry out some tests if he is still using his MBP with the RX 580.

 

Computer: Mid 2015 MacBook Pro 15" with M370X dGPU
eGPU: R43SG + Sapphire Nitro+ RX 580 8GB


itsage liked
ReplyQuote
nicefour
(@nicefour)
Active Member
Joined: 2 months ago
 

@macnexus

Thank you for your tests. BTW the link that you provided for the HEVC support is incorrect - it follows to rx580 amazon page. And we have a bit different cards. Im surprised that pulse and nitro - made it plug and play different. May be because of the dual bios on the nitro. But with bios flashing it’s not a problem  anyway.

1. How did you disable the dgpu with startup.nsh for mac. I mean what did you change inside the script and which folder did you put it in, to boot into mac os. - Really interested.

2. I tested dota 2 on mac - where i can get around 80 fps (and the acceleration is totally done by the egpu), but im not sure about the full power of the card - because in windows i can get 150-200 fps with the same settings.

3. After looking at your post im thinking that app accleration is going in the same way with or without those kext’s installed (and to make it clear - kexts were needed only for the HEVC acceleration, right?)

4. Im currently thinking that there should be an easy way to disable dgpu - or make rx580 accelerate the retina display within the system - and not by the app. When im running some apps in mac rx 580 is totally there. but in the graphics/displays retina lcd never goes under rx580, it always switches between iris and 370.

And it’s really weird that by using startup.nsh your screen remains blanc, because intel iris graphics usually drives the display.

I wish we have more mac os focused people in this thread.

 

Also i recently got the idea that it might be possible to fully disable dgpu first (370) using startup.nsh then flash rx 580 bios so it can fit model and identification number of m370x, but leave clock speed and other high stats, then mac system will treat it to drive internal display natively. Please share how to make startup.nsh work with mac os boot.

BTW in my activity monitor - there is no GPU spot between cpu and memory. Is it because if the kexts installation?

And here is a link to usefull terminal gpu swithing comands, due to gfx card status not stable perfomance - https://nathansnelgrove.com/how-to-force-your-macbook-pro-to-use-its-discrete-graphics-card-when-its-plugged-in/

modulating egpu with my imagination and taobao links


ReplyQuote
macnexus
(@macnexus)
Active Member
Joined: 2 months ago
 

@nicefour, I changed the last line of the startup.nsh script from:

\EFI\Microsoft\Boot\bootmgfw.efi

to

fs2:
\System\Library\CoreServices\boot.efi

This is assuming that your macOS partition is detected as fs2. It can be fs1 or even fs3 depending on how many drives you have. The easiest way to check is to type in "fs2:" in the EFI shell, followed by "ls". If you see the files for macOS then it means you have found the correct drive. The boot.efi for macOS can be found in \Systems\Library\CoreServices\boot.efi so once you run the file it will boot into macOS.

I suggest you try to run the startup.nsh script without any "mm" commands because they turn off the internal LCD and you will end up with a blank screen (without backlight). However, macOS will still boot and you will notice the backlight of the keyboard comes on when the MBP has booted to the desktop. You will be able to verify this if you have an external monitor connected to the RX 580. One of the screenshots that I posted in Page 7 shows the M370X completely disabled and "disappeared" from System Information.

I do not have Windows installed so I cannot verify that I have the correct startup.nsh script.

I am not sure what is causing the internal LCD to go blank. Can you please try if the internal LCD on your MBP becomes black after you execute the startup.nsh script with mm commands?

Computer: Mid 2015 MacBook Pro 15" with M370X dGPU
eGPU: R43SG + Sapphire Nitro+ RX 580 8GB


ReplyQuote
macnexus
(@macnexus)
Active Member
Joined: 2 months ago
 
Posted by: @nicefour

@macnexus

Thank you for your tests. BTW the link that you provided for the HEVC support is incorrect - it follows to rx580 amazon page. And we have a bit different cards. Im surprised that pulse and nitro - made it plug and play different. May be because of the dual bios on the nitro. But with bios flashing it’s not a problem  anyway.

1. How did you disable the dgpu with startup.nsh for mac. I mean what did you change inside the script and which folder did you put it in, to boot into mac os. - Really interested.

2. I tested dota 2 on mac - where i can get around 80 fps (and the acceleration is totally done by the egpu), but im not sure about the full power of the card - because in windows i can get 150-200 fps with the same settings.

3. After looking at your post im thinking that app accleration is going in the same way with or without those kext’s installed (and to make it clear - kexts were needed only for the HEVC acceleration, right?)

4. Im currently thinking that there should be an easy way to disable dgpu - or make rx580 accelerate the retina display within the system - and not by the app. When im running some apps in mac rx 580 is totally there. but in the graphics/displays retina lcd never goes under rx580, it always switches between iris and 370.

And it’s really weird that by using startup.nsh your screen remains blanc, because intel iris graphics usually drives the display.

I wish we have more mac os focused people in this thread.

 

Also i recently got the idea that it might be possible to fully disable dgpu first (370) using startup.nsh then flash rx 580 bios so it can fit model and identification number of m370x, but leave clock speed and other high stats, then mac system will treat it to drive internal display natively. Please share how to make startup.nsh work with mac os boot.

BTW in my activity monitor - there is no GPU spot between cpu and memory. Is it because if the kexts installation?

And here is a link to usefull terminal gpu swithing comands, due to gfx card status not stable perfomance - https://nathansnelgrove.com/how-to-force-your-macbook-pro-to-use-its-discrete-graphics-card-when-its-plugged-in/

3. Yes the kexts are mainly for HEVC acceleration. If I use the startup.nsh script to disable the dGPU and have an external monitor connected to the RX 580, the HEVC hardware acceleration does not work. I am not sure what is the reason.

4. I am not sure if disabling the dGPU will force the MBP to use the RX 580? There is a chance that it will stick with iGPU only? 

I still do not understand why you need to flash the BIOS of your RX 580. Mine just works out of the box with the stock firmware.

Computer: Mid 2015 MacBook Pro 15" with M370X dGPU
eGPU: R43SG + Sapphire Nitro+ RX 580 8GB


ReplyQuote
nicefour
(@nicefour)
Active Member
Joined: 2 months ago
 

@macnexus

I flashed the bios because the sapphire id was 0x6fdf  - which is a bit different from the standart rx 580,  0x67df. Without the bios procidure  - card was discovered as internal display without supported kexts. Flashing is really easy ( the only thing needed was windows environment), also by flashing the bios it’s possible to change clock speeds and other parameters (overclock the card) possible chage  wattage. Many xfx and sapphire cards have this small id difference.   

I also was surprised about it, because on the Apple website this card (pulse model) is in egpu reccomended.

 

Thank you for the sturtup.nsh explanation. I already tried it (by using sd card to handle efi folder). It definetly worked - mac os turned on and m.2 gpu fans stopped to work as during  usuall  boot. Keyboard lights regulators also worked. Screen was black.  So i think i have the same output as in your case. Without dgpu disabling in the script, efi on sd card booted macos as usuall. 

 

I think if you connecting external display you can also disable igpu by adding more rows to the script. ( apple  set os efi removal wont help in mac os case). BTW  how are the stats during the external display usage? Are they better?

Now im thinking that possible way to enable rx 580 internal display acceleration might be some kexts or script that routes display directly to selected card. Also there might be some kext that enables egpu usuall check box menu on the egpu usage - bit for any card.

 

Also there was a weird thing before i flashed the bios - the card determined by the mac os as a display adapter was still using by the system - and it was definetly accelerated whole retina display. - I did such test - i put computer to sleep then wake it up there was some latency and small artifacts on the screen - after i turned on dota 2 - but the app told me that it needs full render system or something like this. 

 

One more thing - wattman menu and GPU z in windows showed that card enegy supply needs just about 50 - 80 w at high perfomance, where DA is 220 w.  Im interested if someone will try rx 5700xt with dell da2 ( may be undervolted. )

This post was modified 1 month ago

modulating egpu with my imagination and taobao links


ReplyQuote
macnexus
(@macnexus)
Active Member
Joined: 2 months ago
 

@nicefour, the Sapphire RX 580 Nitro+ 8GB that I have has device ID 0x67df out of the box so I am not sure why is yours 0x6fdf. If you bought it used, perhaps the previous owner might have flashed a custom firmware.

I am not sure if the performance is better with external display. I have the RX 580 connected to a 5K display and the fans on the MBP stays around 2000 rpm which is one of the main reasons why I opted for this set up in the first place. Previously, with the 5K monitor connected directly to the M370X, the fans on the MBP were constantly at high speed. 

I have been trying to find out if there is any method to disable the dGPU but keep the internal LCD working but no success so far. It is interesting that it works for Windows (and probably Linux as well?). I might have to install Linux and explore how to disable the dGPU and switch the internal LCD to iGPU.

If you are interested to understand what those mm commands in the EFI shell actually do, try searching for apple-gmux.c in Google. 

#define GMUX_PORT_SWITCH_DISPLAY 0x10
#define GMUX_PORT_SWITCH_GET_DISPLAY 0x11
#define GMUX_PORT_SWITCH_DDC 0x28
#define GMUX_PORT_SWITCH_EXTERNAL 0x40
#define GMUX_PORT_DISCRETE_POWER 0x50
#define GMUX_PORT_VALUE 0xc2
#define GMUX_PORT_WRITE 0xd4

Based on some of the information from apple-gmux.c, to power down the dGPU, these codes are executed in Linux:

gmux_write8(gmux_data, GMUX_PORT_DISCRETE_POWER, 1); //GMUX_PORT_DISCRETE_POWER is 0x50
gmux_write8(gmux_data, GMUX_PORT_DISCRETE_POWER, 0); //GMUX_PORT_DISCRETE_POWER is 0x50
pr_debug("Discrete card powered down\n");

The mm commands that we got from here appears to be quite similar to those codes:

mm 7C2 ;IO :1 -n
mm 7D4 ;IO :50 -n
mm 7C2 ;IO :0 -n
mm 7D4 ;IO :50 -n

 

It would be nice if we can route the internal LCD directly to the RX 580. I am not sure if it is even possible. The internal LCD is connected via eDP. We need to find out if it is connected directly to the iGPU or dGPU or a switchable IC.   

 

 

Computer: Mid 2015 MacBook Pro 15" with M370X dGPU
eGPU: R43SG + Sapphire Nitro+ RX 580 8GB


ReplyQuote
nicefour
(@nicefour)
Active Member
Joined: 2 months ago
 

@macnexus 

 

My cards full name is sapphire pulse rx580 2048 sp 8gb - it’s slightly cutted version of original one  that AMD sells only in China. I bought it new and knew about id differences only after. With the bios flashing i also overclocked standart clock speed for 1366 MHz standart and 2000 boost.

It would be interesting if you can disable both igpu and dgpu with extension commands and run test on external screen only with rx580.

I will continue to look up for the solution on how to disable dgpu and drive internal screen. Or how to disable both gpus and drive internal screen only with RX.

 

BTW. My metal score in geekbench 5 is - 42142. Also the whole set up cost was around 220 $ including 256 gb ssd and orico usb c external enclosure that supports usb c - usb a. I think after i this set up and  common understanding i might go with radeon VII and may be macmini a bit later.

 

This post was modified 1 month ago

modulating egpu with my imagination and taobao links


ReplyQuote
nicefour
(@nicefour)
Active Member
Joined: 2 months ago
 

 

Here is some really interesting test. Im playing only 1 game (Dota2) which is supported on the mac. And i don’t like how it looks in windows (graphics rendering and mouse acceleration feels really different).

So i was checking graphics perfomance to see limits ( with opened gpu history ).

 

Besides that, in the game folder there is a txt file with additional graphic setups - such as gpu level gpu memory level, cpu  level and ddr memory. I maxed out gpu level and gpu memory level.

i opened the  game in exlusive fullscreen mode.

With r370m + rx580. It doesnt feels smooth on any resolution higher then 1280. And both cards are working.

No matter what fps value im choosing. 60 /120.  It’s not so constant and has slutters.

74C2E349 D56D 4CA4 94D1 CD25120B1099

 (Im thinking that in that case, r370 m goes as a display controller and still trying to drive the game toogether with rx, or both of the cards driving the game throught iris controller - which cause slutters and uncosistency.

 

But when im choosing igpu in gfx and run the game. Everything is really smooth - stable 60 fps. No matter what graphics settings or resolution. By this i mean that 3k with everything maxed out still has stable 60 fps without any slutters. And gpu history shows only rx in use. In this mode theres only one restriction - can not put fps higher then 60. I’m guessing that intel iris  used as a display controller in this case. And fps restriction connected to mbp 60hz framrate or the hight resolution pressure - where iris tooks all power to accelarate the display and the game cathed up by rx580. At 3 k resolution i cant even go back to the desktop. It’s seems that no matter on which of two internal cards display controller relies - under   heavy load/high resolution it enters “through mode only” and  able to use only 1 card.

196891DA F58F 4130 9BDA 828E6A61D416

1F484622 7310 4B30 B105 C7E9ACB648D9

 

I’m thinking about few ways of reproducing this behavior outside of the game. Script that puts iris/display controller only in that mode. Virtul display with exlusive fullscreen mode or hight resolution that copies the original one and pushing iris/display controller to enter that mode and chose to use egpu resources/display information after boot.  

 

 

BTW @macnexus - when you are using external screen is iris igpu active in perfomance?

modulating egpu with my imagination and taobao links


ReplyQuote
 of  10