Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
182 lines (121 sloc) 5.94 KB

GPU Patching

Last edited: January 13, 2020

This little section is for those who need more than what is provided by simple framebuffer patching and WhateverGreen's autopatches:

  • Applying a fakeID for unsupported GPUs
  • iGPU BusID patching for 300 series motherboards

Converting a clover fakeID to OpenCore

With OpenCore, GPU FakeIDs are handled a bit differently. Specifcally that you need to have the PCIRoot path to apply the properties. Luckily FakeIDs are not required to boot, instead only needed for proper GPU acceleration so this can be done in post-install.

Finding the PCIRoot of your GPU

To find the PCIRoot, you'll want to grab gfxutil and run the following in terminal:

path/to/gfxutil -f GFX0

This should give you something like this:

PciRoot(0x20)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)

Note: GFX0 can be replaced with GFX1, etc if the GPU you're fakeIDing isn't the first/main GPU. And machine running with CSM enabled and Windows8.1/10 mode(WHQL) disabled may find that the GPU is named display so adjust the above command accodingly.

Apply the fakeID

So lets grab a clover fakeID and go through how we'd convert it, for use we'll choose 0x67981002 which is the ID associated with the R9 280x and is commonly used by R9 280/380 users.

Looking through clover's source code we find that fakeIDs are converted into the following properties:

AMD GPUs:

device-id
ATY,DeviceID
@0,compatible
vendor-id
ATY,VendorID

To convert them, we'll need to do byte swap. This is due to Endianness:

  • DeviceID: 67 98 -> 98 67
  • VendorID: 1002 -> 02 10

Now we can apply the properties:

Key Type Value
device-id Data 98670000
ATY,DeviceID Data 9867
vendor-id Data 02100000
ATY,VendorID Data 0210

You may notice we excluded @0,compatible, the reasoning for this is thatit actually interferes with WhateverGreen and macOS's ability to properly setup the GPU. See here for more info.

Now navigate into your config.plist under DeviceProperties -> Add where you can apply these properties:

iGPU BusID Patching

This section is for users running "true" 300 series motherboards( B360, B365, H310, H370, Z390) who are having issues setting up their iGPU as a display out.

So to get started I'll assume you've already done basic framebuffer patches in your config from the Coffeelake portion of the guide, it should look something like this:

Now that we're prepped, we can start looking into busID patching. Checking the dumps on Insanelymac shows us this for the 3E9B0007 ID(Desktop UHD 630):

ID: 3E9B0007, STOLEN: 57 MB, FBMEM: 0 bytes, VRAM: 1536 MB, Flags: 0x00801302
TOTAL STOLEN: 58 MB, TOTAL CURSOR: 1 MB (1572864 bytes), MAX STOLEN: 172 MB, MAX OVERALL: 173 MB (181940224 bytes)
GPU Name: Intel UHD Graphics 630
Model Name(s):
Camelia: Disabled
Mobile: 0, PipeCount: 3, PortCount: 3, FBMemoryCount: 3
[1] busId: 0x05, pipe: 9, type: 0x00000400, flags: 0x000003C7 - DP
[2] busId: 0x04, pipe: 10, type: 0x00000400, flags: 0x000003C7 - DP
[3] busId: 0x06, pipe: 8, type: 0x00000400, flags: 0x000003C7 - DP
01050900 00040000 C7030000
02040A00 00040000 C7030000
03060800 00040000 C7030000

Looking at all this can be quite overwheling, but we'll break it down to be a bit simpler. For use we care about this:

[1] busId: 0x05, pipe: 9, type: 0x00000400, flags: 0x000003C7 - DP
[2] busId: 0x04, pipe: 10, type: 0x00000400, flags: 0x000003C7 - DP
[3] busId: 0x06, pipe: 8, type: 0x00000400, flags: 0x000003C7 - DP
01050900 00040000 C7030000
02040A00 00040000 C7030000
03060800 00040000 C7030000

These are your iGPUs ports by default, lets go through port 1 and see what each section is used for:

The first port:

01050900 00040000 C7030000

Port: 01

  • 01050900 00040000 C7030000

busId: 0x05

  • 01050900 00040000 C7030000

Pipe Number 9 (little endian):

  • 01050900 00040000 C7030000

Connector type: DisplayPort

  • 01050900 00040000 C7030000

Flags - We leave it as default:

  • 01050900 00040000 C7030000

Things to note:

  • You cannot use the same busId twice, having 2 in use will create conflicts
  • Pipe number and flags don't need to changed

List of connector types:

  • 00 04 00 00 - DisplayPort
  • 00 08 00 00 - HDMI
  • 04 00 00 00 - Digital DVI
  • 02 00 00 00 - LVDS (for laptops)
  • 01 00 00 00 - Dummy port

Mapping video ports

  1. Plug display into HDMI port
  2. Set Port 1 to the HDMI connector type:
  • 01xx0900 00080000 C7030000
  1. Disable ports 2 and 3 with busid=00:
  • 02000A00 00040000 C7030000
  • 03000800 00040000 C7030000
  1. Walk through busids for Port 1 if the previous didn't work(yup you gotta do a shit ton of reboots). The maximum busid on most platforms is 0x06
  • 01010900 00080000 C7030000
  • 01020900 00080000 C7030000
  • 01030900 00080000 C7030000
  • etc

If you still get no output, set port 1's busid to 00 and start going through busids for port 2 and so on

  • 01000900 00040000 C7030000
  • 02xx0A00 00080000 C7030000
  • 03000800 00040000 C7030000

Adding to your config.plist

So adding these patches are simple though a bunch of entires are required:

  • framebuffer-con0-enable = 01000000
  • framebuffer-con1-enable = 01000000
  • framebuffer-con2-enable = 01000000
  • framebuffer-con0-alldata = port 1
  • framebuffer-con1-alldata = port 2
  • framebuffer-con2-alldata = port 3

So when adding the patches, port 1 will actually become con0 as the ports start at 0. These are also all data types when entering your values.

A finished config should look something like this:

Source for iGPU BusID patching: CorpNewt's Brain

You can’t perform that action at this time.