Contribute
Register

SSDT GPU (Graphics Card) Injection

Status
Not open for further replies.
You could try changing "PCI Slot 1" to "Slot-1" but I'm not sure what the nv driver manager is polling for. Either way, I don't think ECC or G-Sync function in macOS so I have no idea why there are option tabs for them.
Yes, "Slot-1" is what the NVDA driver was looking for. Thanks! OCD, sorry. ha
 
Work in progress...
Updated step 3b and files 2/22/2017.

If you have come to this guide to deal with a "Black Screen" issue, please read this post first:

http://www.tonymacx86.com/graphics/...ro-6-1-imac-15-imac-17-system-definition.html

You may also want to take a look at this post if you feel you might be having other Nvidia Web Driver related issues:
Solving NVIDIA Driver Install & Loading Problems

Injecting your GPU/s in your ACPI tables can:
• Enable HDMI audio functionality from your GPU.
• Possibly resolve issues with connecting multiple monitors.
• Solve ports not working.
• Fix issues with hot-plugging monitors.
• Naming your GPU to "GFX1" can eliminate the "Black Screen" issue with the MacPro6,1 system definition e.g. losing video signal to your monitor when OSX finishes loading and you should reach the desktop at boot time (the system is running, fully functional but there is no signal to the monitor). [credit: dgsga and furter]. NOTE: The system will still be responsive (not frozen). If your system is unresponsive with a black screen, this will not help you.
I prefer SSDTs over the DSDT for device injection as updating the BIOS, moving PCI cards, or adding/removing PCI cards may require you to extract and edit a new DSDT.

Background:

In OEM Apple ACPI tables, the GPU Devices are named as follows:

iMac13/14/15/17: Discrete GPU = "GFX0" (@0). Integrated GPU = "IGPU" (@2 or 0x00020000)
MacPro3,1/5,1: Discrete GPU#1 = "PSX1" (@0).
MacPro6,1: Discrete GPU#1 = "GFX1" (@0). Discrete GPU#2 = "GFX2" (@0).

The usual school of thought is that each GPU should have a unique name (1st GPU = GFX0, 2nd GPU = GFX1 etc etc etc). However, If you use MacPro6,1 with multiple GPUs, you need to name all GPUs GFX1. Any GPU with a different name will lose video signal after the "Apple Logo" boot progress screen.

Preparation:


The file attachment at the bottom of this post contains a basic starter SSDT named SSDT-1.aml. Please download and unzip the files now.

Restart your hackintosh and enter the Clover GUI (you may need to hold down the spacebar while it's booting if you have Timeout set to 0). Press the F4 key (this will extract your motherboard's OEM ACPI tables) and wait for 5 seconds (Clover won't give you any indication that it has extracted the files). Boot your hackintosh and mount your EFI partition (see my included Mount EFI apps).

IMPORTANT:
Make sure your clover config won't conflict with your new SSDT injection. Open your Clover config.plist (EFI/CLOVER/config.plist).

Make sure that you don't have "AddHDMI" active. If it is present, set it to "false":

Code:
    <key>ACPI</key>
    <dict>
        <key>DSDT</key>
        <dict>
...
            <key>Fixes</key>
            <dict>
...
                <key>AddHDMI_8000000</key>
                <false/>

I'm not sure if it matters if Clover is adding properties to your GPU. If they are present, you may want to remove them. If any of these keys are not present, it's OK, don't add them.
Code:
    <key>Devices</key>
    <dict>
        <key>AddProperties</key>
        <array>
            <dict>
                <key>Device</key>
                <string> *your GPU* </string>
                <key> *key* </key>
                <string> *any* </string>
...

Make sure that Clover is not using a EFI string to inject your GPU (you would have had to put it there yourself).
Code:
        <key>Inject</key>
        <false/>
        <key>NoDefaultProperties</key>
        <false/>
        <key>Properties</key>
        <string> *string of numbers* </string>

I'm not sure if it matters if Clover is faking your discrete GPU's device ID. Fake device ID's can be added to the SSDT if needed (info coming later but you might want to wait if you need a fake GPU ID). UseIntelHDMI might be OK but I'm not positive that it won't conflict with our Discrete GPU SSDT injection. If any of these keys are not present, it's OK, don't add them.
Code:
        <key>FakeID</key>
        <dict>
            <key>ATI</key>
            <string>0x0</string>
...
            <key>IntelGFX</key>
            <string>0x0</string>
...
            <key>NVidia</key>
            <string>0x0</string>
...
        <key>UseIntelHDMI</key>
        <false/>

Navigate to the EFI/CLOVER/ACPI/patched folder. If you have DSDT.aml or SSDT*.aml in this folder, verify that you don't already have an entry/s for your GPU/s in these files. If there are GPU entry/s in these ACPI files, you may either remove them, modify the device name/s or leave them alone and skip making a new one/s. You can not inject the same device more than once. If you already have a SSDT named SSDT-1.aml there, rename the starter SSDT-1.aml you just downloaded using the next sequentially higher number IE: SSDT-2.aml or SSDT-3.aml etc etc etc. Names you can use are: "SSDT.aml" or "SSDT-0.aml" through "SSDT-9.aml". If you have more than 1 GPU installed and would like to create SSDTs for them too, duplicate the unmodified starter SSDT and name it using the previously mentioned naming conventions. Continue duplicating and renaming until you have enough for all the GPUs you'd like to inject.


1) Location:

Find your GPU's location in your IO Registry. I prefer IORegistryExplorer.app but you can use IOJones if you prefer. Open your IO Registry viewer and find your GPU. You can try searching for the word "display" if you are lost. In this example, the GPU is located in the PCI slot named "NPE3" and the address is "@2"(0x00020000).
NOTE: The GPU was given the name "display" by default because it has no given name in the ACPI tables. It's address is @0 (Zero or 0x00) in NPE3 which is @2 (0x00020000) in PCI0. Your GPU may already have a name assigned to it in the ACPI tables like "GFX0@0" or "PEGP@0".
171402-ioreg-finddisplay.jpg


NOTE: "AppleACPIPCI" is the driver and not a device. "IOPP" is the PCI bridge for that slot and not a additional device (it has no "@" address). Take a note of the GPU's device name, or name of the PCI slot that your GPU is installed in. Use TextEdit to record your notes.

2) Path:


Navigate to the EFI/CLOVER/ACPI/origin folder. Open DSDT.aml with MaciASL http://sourceforge.net/projects/maciasl/ and enter the name you found in step 1 in the search box labeled "Find" at the top of the app. Use the ">" button next to the search box to go to the matching results. NOTE: The result you are looking for will start with the word "Device". EXAMPLE: "Device (NPE3)".

171401-maciasl-finddevice.jpg


Take a note of the device path at the far bottom left corner of the app but discard "DSDT" and separate each device with a period ".". Example: "_SB.PCI0.NPE3".
NOTE: If you can't find your device in the DSDT, open your SSDTs from the origin folder and search for the device in each of them. Discard "SSDT" instead of "DSDT" in the path if the device was in a SSDT. Take a note of the device's "Name (_ADR, ...)" (address). If it is "Name (_ADR, 0x00010000)", "Name (_ADR, 0x00020000)", "Name (_ADR, 0x00030000)", or something similar, you will add GFX1 to it in step 3a.
Examples:
PCI0@0 > NPE3@2 > display@0 (_SB.PCI0.NPE3)
PCI0@0 > NPE1@1 > display@0 (_SB.PCI0.NPE1)
PCI0@0 > NPE7@3 > display@0 (_SB.PCI0.NPE7)
PCI0@0 > NPE9@3,2 > display@0 (_SB.PCI0.NPE9)

If it is "Name (_ADR, Zero)", "Name (_ADR, 0x00)" or "Name (_ADR, 0xFFFF)", you will need to disable the device and replace it with GFX1 in step 3b. You should also take note of what device it is inside of and what other devices are located there and what their addresses are. In the example below, the GPU is loaded in "Device (H000)" which is in BR3A. BR3A is the PCI slot but has many other devices in it. H000-H007 and D07E are reserved addresses for devices to load. "Device (H000)" will need to be disabled so that "Device (GFX1)" [new GPU name] can take the address "Name (_ADR, 0x00)". "Device (H001)" will need to be disabled as well so that "Device (HDAU)" [HDMI audio] can take the address "Name (_ADR, 0x01)".

full


BUT, we're not done yet. In the image below, you can see that "Device (D07E)" has the address "Name (_ADR, 0xFFFF)". Because it is FFFF it can be enumerated to anything. The GPU will try to load to it before the new GFX1 device in the new SSDT. So we will need to disable D07E as well. Take note of all these device names and paths.

full


Examples:
PCI0@0 > PEG0@1 > PEGP@0 (\_SB.PCI0.PEG0.PEGP)
PCI0@0 > BR3A@3 > H000@0 (_SB.PCI0.BR3A.H000)
PCI0@0 > BR3A@3 > D077@0 (_SB.PCI0.BR3A.D07E)
PCI0@0 > BR2A@2 > H000@0 (_SB.PCI0.BR2A.H000)
PCI0@0 > BR2A@2 > D075@0 (_SB.PCI0.BR3A.D075)


3) Patching:


Open the downloaded SSDT-1.aml (or the duplicate you are working on) in MaciASL.

If your GPU already had a device name (GFX0, PEGP, PXSX, H000, D077 or anything else) with a Zero (0x0) address in the OEM ACPI tables (DSDT or a SSDT), Skip to Step 3b.


If your GPU had no entry in the OEM ACPI tables, and showed up in IORegistryExplorer as "display@0" , continue here with step 3a.

3a) Add GFX1 to the PCI slot device:

Replace "_SB.PCI0.NPE3" with your device path from step 2 (if it is different), but leave ".GFX1" ".HDAU" at the end for the 2 devices.

EXAMPLE: If your path was \_SB.PCI0.PEG0, then Replace just the red part in "Device (_SB.PCI0.NPE3.GFX1)" & "Device (_SB.PCI0.NPE3.HDAU)" with \_SB.PCI0.PEG0.

BEFORE:

Code:
{
    Device (_SB.PCI0.NPE3.GFX1)
    {
        Name (_ADR, Zero)
        Name (_SUN, One)
    }


    Device (_SB.PCI0.NPE3.HDAU)
    {
        Name (_ADR, One)
    }
}

AFTER:

Code:
{
    Device (\_SB.PCI0.PEG0.GFX1)
    {
        Name (_ADR, Zero)
        Name (_SUN, One)
    }


    Device (\_SB.PCI0.PEG0.HDAU)
    {
        Name (_ADR, One)
    }
}

Continue to Step 3c


.
 
Shilohh,
I really appreciate all of the help you have provided with this. Although I have a programing background I have not yet stumbled upon the magic formula for decoding the SSDT creation and patching. Could you possibly point me in the right direction for my next tasks. The cards I am using are all MAC Cards and work OOB they just don't present themselves correctly in the system profiler.

https://www.tonymacx86.com/threads/creating-custom-ssdt-for-add-in-cards.216450/#post-1456929

Thanks,
Kevin
 
Shilohh,
I really appreciate all of the help you have provided with this. Although I have a programing background I have not yet stumbled upon the magic formula for decoding the SSDT creation and patching. Could you possibly point me in the right direction for my next tasks. The cards I am using are all MAC Cards and work OOB they just don't present themselves correctly in the system profiler.

https://www.tonymacx86.com/threads/creating-custom-ssdt-for-add-in-cards.216450/#post-1456929

Thanks,
Kevin
As far as I know, Apple hasn't published anything about their unique ACPI spec or methods. What I've learned, I've dug out of old threads from all the hack forums. I think the issue you're having is in the _DSM (device specific method) and _SUN (slot user number) methods. _SUN is a Apple "automatic" function to show PCI devices in system profile. _SUN will override anything you've put in AAPL,slot-name in the _DSM. So, remove _SUN first and add whatever you want to AAPL,slot-name within _DSM. You could use "Toilet" if you wanted ;) It's 100% cosmetic.
 
Hi Shilohh!

Awesome thread. Thank you.

I have an odd problem related to all this, I believe. I'll try to be brief but I will probably fail at that :)

I actually have everything 'working' but not perfectly. I have one 1440p monitor, an old DVI QNIX monitor - no problem with this. I also have an ASUS PQ321 4K MST monitor, as well as the HP Z27q 5K monitor which is similar to the DELL 5K 27" one. It's on an X79-UP4 board, with a GTX 980 in first slot and a GTX 680 in 3rd slot (both PCI-e 16 slots). I use the machine for FCPX video editing/resolve.

I have used your guide and successfully changed the name of both of my GPUs to GFX1. It shows up as that in IOReg. Nice. But I wasn't having trouble with black screens before, as long as I ran all monitors off the GTX 980 which has 3 DP and 1 DVI, and can almost handle all 3 monitors on its own (see below for why I don't just leave it this way). So it wasn't absolutely necessary to do the SSDT as per this guide. The reason I tried it is because what I AM getting a problem with is getting the 2nd GPU working under my sys def, to actually output. Now, because I have a MST display (the ASUS), I have to have my sys def as Macmini6,2. It's the ONLY sys def that will run the MST display at full 4K @ 60hz. It's also the only sys def that responds to my hack to force the HP 5K display be recognized over 2 display port cables and run at full 5K (or at HiDPI at 3360x 1890 which is what is just about right for me). Once I do this the HP 5K display is actually recognized as the DELL UP2715K which is the only monitor to have had a hack applied by NVIDIA in the web driver. That's another story.

Anyway. If I switch to MacPro6,1, with your SSDT method (I have 2 x SSDT, one for each GPU as you instructed)... yes, I now get all ports working on BOTH GPUs. However, with that sys def I now lose 2 things:

• The HP 5K display now stops working properly, gets recognized as 2 separate displays and won't be 5K or any of the HiDPI options below 5K. The max I get out of it is now 4K (so 2048 HiDPI which is way too large) and there's another rogue display in preferences that the system thinks the other display port cable is running to. MacPro6,1 (or 5,1 or even 3,1 with a hack to let Sierra run on it) all sees this display as 2 separate ones. Same goes for every other sysdef I've tried. The other 2 iMac ones that respond to your SSDT just do the same as MacPro6,1. No MST and no 5K.

• The ASUS PQ321 4K MST now also won't run any more, it is stuck with a half screen in the center. I could switch it back to SST and then I get full 4K full screen, but it's now stuck at 30Hz.

Macmini6,2 solves both the above problems, but disables any ports on the 2nd GPU from being active. My systems DOES recognise the card, and will use it for Davinci Resolve rendering, but given my second card is a GTX 680 (ie. slower) that actually defeats the purpose and slows DOWN my rendering compared to if I just pulled the 680 out of the machine. I could tell Davinci Resolve to just use the 980 for rendering, but then I literally have a 680 sitting in the machine doing absolutely nothing other than SLIGHTLY helping out FCPX sometimes.

Additionally, the reason I need another GPU inside (other than for editing and coloring) is because the I can't get BOTH the 5K and MST goodness out of 1 GTX 980. The only way to get 5K working is to turn off MST, and vice versa, the only way to get MST is to make the 5K act as a 4K display.

It makes much more sense to try to get the GTX 680 to power 2 of the monitors (leaving the 5K dual display port connecting to the 980, which has the ports for that) and that way the load is spread, my 5K display will get enough power to be 5K, the other 2 monitors can also work properly and MST can be active so I get 60Hz and the MST and 5K display don't fight over resources.

Whew - hope that makes sense so far!

Because, by having all 3 monitors going thru the GTX 980, I'm hitting a resolution wall. It's too much for even this top end card to power a 5K display over 2 display ports, a 4K display MST, AND a 1440p display. If I have the PQ321 4K in MST mode, it causes the 5K display to revert back to 4K and look terrible, or if I switch to SST on the 4K then I get full 5K again on the HP, but I'm now on 30Hz with the 4K!! It's just round and round. Frustrating.

And to top it off, the sys def Macmini6,2 also causes some cursor issues especially in FCPX and other apps, where it won't line up properly where it is showing the cursor to be, say in changing volume levels or changing sizes of clips etc - any time you're doing fine tuning type work that requires precision, the cursor is off center and not in alignment with where you expect it to be. Photoshop has problems with brush cursors not showing up and all sorts of issues. I've heard this is a common issue with the Macmini sys def. So the Macmini sys def is great for MST and 5K goodness, but crap for multi-GPUs and cursor hiccups.

Ideally, I want to alter...something.... to make MST & 5K work under the MacPro6,1 sys def. I know my system has the CAPABILITY of driving these 2 monitors in their intended optimal mode, because I can achieve it with the Macmini sys def. So it's clearly just a clover/SSDT issue, nothing else.

My goal was to have the 4K and 1440p display connected to the old GTX 680, my 5K display connected to the 980, and then all displays should be happy and the main "GUI" display would be the 4K leaving the non-GUI display for Davinci resolve to use the 980 and be as fast as possible.

I cannot for the LIFE of me work out why MST and 5K work fine under Macmini6,2 but nothing else. I don't know what it is about this sys def that triggers it all to work. But given I can make different elements work under different scenarios, I know there must be a solution by just changing these settings, but after weeks I've finally given in and resorted to reaching out to you!!! Which I'm loathe to do because it's not a simple request! Haha.

Oh, I have also edited manually AGDP Kext and changed a lot of the Config1 to none just in case - for all the different sys defs I've tried, basically. I was told when researching the MST issue not working that the reason it worked under Macmini was that the Macmini board-id doesn't even EXIST in AGDP, so it just automatically works. But changing MacPro6,1 board-id to none or even deleting the board-id from the AGDP info.plist does NOT make MST work under MacPro6,1, which tells me nobody really knows why Macmini works for MST. I find it unbelievable that these monitors that are SUPPOSED to work connected to a MacPro 6,1 (a real one) don't work here. Why would Macmini be superior to MacPro6,1 a later and more advanced machine?

I have an override in some folder for the HP 5K display as well. I also have 2 other SSDT that enable USB 2 on my board under Sierra. My system is basically the same as yours in terms of the names for the graphics cards, so the SSDTs I made will be instantly familiar to you (attached). I made sure I used the right patch for the 680 SSDT-2 and the 980 SSDT-1. I'll attach everything anyway if you want to look. I tried changing the names of GFX1 to GFX2, 3 and 0. I tried it for different ones, making the other GPU onboard-1 instead of onboard-2 etc. No change.

Any clues of what else I can investigate? I don't need any hand holding as I've been hackintoshing for 5 years and helped others with RAID issues with clover and all sorts of things, but my situation is so unique, I've read 100% of all the posts on this & related topics, all the black screen threads etc. to no avail.

Questions / Possible approaches to fix:

• What is it about your SSDT edits that only affect MacPro6,1 and the 2 x iMac ones? One approach is to try to make the Macmini sys def respond to the SSDT in some way (altho in IOReg it is still 'responding' to it in the name change, it just doens't have a positive affect on the ports on the 2nd GPU noticing anything is plugged into it)... Is there a way so that the Macmini will at least recognise the 2nd GPU? Why won't Macmini see the 2nd GPU when displays are connected to it? I have played around with the boot display code in the SSDT, but as far as I understand it that's just for which display should display the boot startup thing (which I really don't care about, and has always worked for me anyway). I don't have any of those other issues with boot screens not working or needing to shut off one monitor until login etc.

• What is it in Macmini6,2 that makes 5K over dual DP cables work, as well as MST 60hz work? Surely there's some way I can force these two things to work under MacPro6,1? What is Macmini sys def DOING to enable MST 60hz and 5K to work?

Anyway, those are my 2 possible approaches and questions that should lead me to a solution, if you have any insight on one or both ideas. Thanks mate. Have a nice day and thank you for any help you can be. Thanks for reading the entire post.

Ben
 

Attachments

  • config.plist
    4.9 KB · Views: 189
  • SSDT-1.aml
    350 bytes · Views: 152
  • SSDT-2.aml
    296 bytes · Views: 156
  • SSDT-8.aml
    198 bytes · Views: 140
  • SSDT-9.aml
    1.8 KB · Views: 142
  • Screen Shot 2017-03-24 at 11.55.54 PM.jpg
    Screen Shot 2017-03-24 at 11.55.54 PM.jpg
    132 KB · Views: 121
Last edited:
So update - I can make the MacPro6,1 sys def act like the Macmini one by:

• Changing board-id in Clover config.plist to be slightly different (say change the 6 at the end to a 7)
• Adding that altered/unique board-id to the PlatformSupport.plist in S/L/CoreServices

Now MST and 5K work, under a MacPro sys def.

So that's how Macmini works, it's board-id is something not picked up on by AGDP or somewhere else in the system, and thus some sort of 'default' kicks in that is far more functional, EXCEPT that only 1 GPU ports work at any one time. (If I unplug everything from GPU 1, I can make GPU 2 actually work, but only one or the other, which one works is actually kinda random)

Not sure if this helps anybody, but if you want 5K or MST to work but you really want the MacPro6,1 sys def (or any other for that matter), change the board-id to something weird and add that to PlatformSupport.plist. I have no idea what else this breaks (including continuing to have a faulty cursor like I have noticed sometimes on Macmini) but yeah.

Hasn't solved my problem though. At least I'm a bit closer to figuring out what it is that controls these things.
 
Just a quick question

Since I prefer using 17,1 for my skylake build, should I change GFX1 to GFX0?

Edit-2017/03/26
=============
Seems like neither GFX0 nor GFX1 works on 17,1 SMBIOS. However, I do get Pro 6,1 working without blackscreen with GFX1, CPU stages seems to be working fine too.
螢幕快照 2017-03-26 下午3.18.44.png

The only thing doesn't work is boot monitor, I followed the tutorial and set my DisplayPort monitor for boot screen, but it still shows up on the DVI port one. It doesn't do any harm, but I would like to fix it anyway.

Thanks for the tutorial!!!
 

Attachments

  • 螢幕快照 2017-03-26 下午3.18.44.png
    螢幕快照 2017-03-26 下午3.18.44.png
    285.7 KB · Views: 206
Last edited:
So update - I can make the MacPro6,1 sys def act like the Macmini one by:

• Changing board-id in Clover config.plist to be slightly different (say change the 6 at the end to a 7)
• Adding that altered/unique board-id to the PlatformSupport.plist in S/L/CoreServices

Now MST and 5K work, under a MacPro sys def.

So that's how Macmini works, it's board-id is something not picked up on by AGDP or somewhere else in the system, and thus some sort of 'default' kicks in that is far more functional, EXCEPT that only 1 GPU ports work at any one time. (If I unplug everything from GPU 1, I can make GPU 2 actually work, but only one or the other, which one works is actually kinda random)

Not sure if this helps anybody, but if you want 5K or MST to work but you really want the MacPro6,1 sys def (or any other for that matter), change the board-id to something weird and add that to PlatformSupport.plist. I have no idea what else this breaks (including continuing to have a faulty cursor like I have noticed sometimes on Macmini) but yeah.

Hasn't solved my problem though. At least I'm a bit closer to figuring out what it is that controls these things.
I'd think that nv_spanmodepolicy=1 probably only works with MacPro5,1 and macmini board IDs. It most likely doesn't work with MacPro6,1 because they use AMD graphics and that flag is nvidia specific. Don't know if amd_spanmodepolicy=1 or ati_spanmodepolicy=1 exist in macOS. It won't be the best for CPUPM if you've spent any time setting it up but you should try MacPro5,1 as well.
 
Status
Not open for further replies.
Back
Top