From 089f6f823fe134ce5b7021c1787b4e0115e15637 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Fri, 14 Feb 2020 12:21:56 -0700 Subject: [PATCH] Add inital VBIOS and DISABLE Guide --- .gitignore | 1 + Desktops/desktop-disable.md | 49 +++++++++++++ Universal/spoof.md | 2 +- Universal/vbios.md | 103 +++++++++++++++++++++++++++ extra-files/SSDT-GPU-DISABLE.dsl | 46 ++++++++++++ extra-files/SSDT-GPU-DISABLE.dsl.zip | Bin 0 -> 1273 bytes icons/.DS_Store | Bin 6148 -> 0 bytes 7 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 Desktops/desktop-disable.md create mode 100644 Universal/vbios.md create mode 100644 extra-files/SSDT-GPU-DISABLE.dsl create mode 100644 extra-files/SSDT-GPU-DISABLE.dsl.zip delete mode 100644 icons/.DS_Store diff --git a/.gitignore b/.gitignore index 194cfe2..a20c055 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store icons/.DS_Store icons/.DS_Store +icons/.DS_Store diff --git a/Desktops/desktop-disable.md b/Desktops/desktop-disable.md new file mode 100644 index 0000000..134fac4 --- /dev/null +++ b/Desktops/desktop-disable.md @@ -0,0 +1,49 @@ +# Disabling unsupported GPUs(Desktops) + +So this is mainly needed for GPUs that are not supported in macOS, mainly this will be Nvidia users who wish to pair an AMD GPU for macOS use. While WhateverGreen does support the boot-arg `-wegnoegpu`, this only works when running on iGPU so for the rest of us we'll need to make an SSDT. + +So to disable a specific GPU, we need to find a couple things: + +* ACPI Path of the GPU +* [SSDT-GPU-DISABLE](https://github.com/khronokernel/Getting-Started-With-ACPI/blob/master/extra-files/SSDT-GPU-DISABLE.dsl.zip) + +## Finding the ACPI Path of the GPU + +To find the PCI path of a GPU is fairly simple, best way to find it is running Windows: + +* Open Device Manager +* Select Display Adapters, then right click your GPU and select Properties +* Under the Details Tab, search for "Location Paths" + +![](https://cdn.discordapp.com/attachments/456913818467958789/675210740231176212/unknown.png) + + +The second "ACPI" is what we care about: +``` +ACPI(_SB_)#ACPI(PC02)#ACPI(BR2A)#ACPI(PEGP)#PCI(0000)#PCI(0000) +``` + +Now converting this to an ACPI path is quite simple, remove the `#ACPI` and `#PCI(0000)`: + +``` +`_SB_.PC02.BR2A.PEGP +``` +And voila! We've found our ACPI path, now that we have everything we're ready to get cooking + +## Making the SSDT + +To start grab our [SSDT-GPU-DISABLE](https://github.com/khronokernel/Getting-Started-With-ACPI/blob/master/extra-files/SSDT-GPU-DISABLE.dsl.zip) and open it up. Here there's a couple things to change: + +``` +External (_SB_.PCI0.PEG0.PEGP, DeviceObj) +Method (_SB.PCI0.PEG0.PEGP._DSM, 4, NotSerialized) +``` +For our example, we'll change all mentions of : + +* `PCI0` with `PC02` +* `PEG0` with `BR2A` + +Hint: If your ACPI path is a bit shorter than the example, this is fine. Just make sure the ACPI paths are correct to your device, some users may also need to adapt `_SB_` to their path + +## [Now you're ready to compile the SSDT!](/Manual/compile.md) + diff --git a/Universal/spoof.md b/Universal/spoof.md index 0f810db..de0a97f 100644 --- a/Universal/spoof.md +++ b/Universal/spoof.md @@ -49,7 +49,7 @@ To find the PCI path of a GPU is fairly simple, best way to find it is running W * Open Device Manager * Select Display Adapters, then right click your GPU and select Properties -* Under the Details Tab, search for "Loaction Paths" +* Under the Details Tab, search for "Location Paths" ![](https://cdn.discordapp.com/attachments/456913818467958789/675210740231176212/unknown.png) diff --git a/Universal/vbios.md b/Universal/vbios.md new file mode 100644 index 0000000..dc77210 --- /dev/null +++ b/Universal/vbios.md @@ -0,0 +1,103 @@ +# Injecting a compatible VBIOS + +**Work in progress** + +So this is mainly needed for GPUs that are not natively supported OOB due to their odd VBIOS, most commonly: + +* XFX +* PowerColor +* HIS +* VisionTek + +Instead, these GPUs need to be flashed to a model that works best in macOS which gernally being Sapphire. This is the brand that AMD uses for making their reference cards and what Apple bases a lot of their GPU logic off of. + +One small problem, flashing VBIOSes can be a bit dangerous and can even brick a card. So for us, we'll be injecting one via an SSDT that will only load in macOS. This means 2 things: + +* Much easier to recover from, as you just remove the SSDT +* Allows you return the GPU easily incase of hardware issues + +So to force a VBIOS onto the GPU, we need to find a couple things: + +* Suitable VBIOS for the GPU +* ACPI Path of the GPU +* [SSDT-VBIOS]() + + +## Finding a suitable VBIOS + +To find a suitable VBIOS, we'll be using [TechPowerUps Video BIOS Collection](https://www.techpowerup.com/vgabios/) which has a full database of basically all GPU VBIOSes. For this example, we'll be creating a VBIOS SSDT for the XFX RX 560 4GB. Now lets pull up the [Sapphire RX 560 4GB](https://www.techpowerup.com/vgabios/192320/sapphire-rx560-4096-170419) and download the VBIOS linked at the bottom: + +``` +Sapphire.RX560.4096.170419.rom +``` +Now we have 1 small issue, our VBIOS must be padded to 65536 bytes(64KB). And our VBIOS is 262KB... *Shit* + +[Insert magic software to shrink our VBIOS] + + + + + + + + + + + + + + +## Finding the ACPI Path of the GPU + +To find the PCI path of a GPU is fairly simple, best way to find it is running Windows: + +* Open Device Manager +* Select Display Adapters, then right click your GPU and select Properties +* Under the Details Tab, search for "Loaction Paths" + +![](https://cdn.discordapp.com/attachments/456913818467958789/675210740231176212/unknown.png) + + +The second "ACPI" is what we care about: +``` +ACPI(_SB_)#ACPI(PC02)#ACPI(BR2A)#ACPI(PEGP)#PCI(0000)#PCI(0000) +``` + +Now converting this to an ACPI path is quite simple, remove the `#ACPI` and `#PCI(0000)`: + +``` +`_SB_.PC02.BR2A.PEGP +``` +And voila! We've found our ACPI path, now that we have everything we're ready to get cooking + +## Making the SSDT + +To start grab our [SSDT-VBIOS]() and open it up. Here there's a couple things to change: + +``` +External (_SB_.PCI0, DeviceObj) +External (_SB_.PCI0.PEG0.PEGP, DeviceObj) +``` +For our example, we'll change all mentions of : + +* `PCI0` with `PC02` +* `PEG0` with `BR2A` + +Hint: If your ACPI path is a bit shorter than the example, this is fine. Just make sure the ACPI paths are correct to your device. + +Now that the ACPI pathing is correct, we can finally inject our VBIOS!! + +So the part we want to change: + +**VBIOS**: +``` +"ATY,bin_image", +Buffer (0x00010000) +{ + // Put your VBIOS here +}, +``` + + +## [Now you're ready to compile the SSDT!](/Manual/compile.md) + diff --git a/extra-files/SSDT-GPU-DISABLE.dsl b/extra-files/SSDT-GPU-DISABLE.dsl new file mode 100644 index 0000000..84191be --- /dev/null +++ b/extra-files/SSDT-GPU-DISABLE.dsl @@ -0,0 +1,46 @@ +// Used for disabling unsupported GPUs in macOS +DefinitionBlock ("", "SSDT", 2, "Slav", "spoof", 0x00000000) +{ + External (_SB_.PCI0.PEG0.PEGP, DeviceObj) + + Method (_SB.PCI0.PEG0.PEGP._DSM, 4, NotSerialized) // _DSM: Device-Specific Method + { + If ((!Arg2 || (_OSI ("Darwin") == Zero))) + { + Return (Buffer (One) + { + 0x03 // . + }) + } + + Return (Package (0x0A) + { + "name", + Buffer (0x09) + { + "#display" + }, + + "IOName", + "#display", + "class-code", + Buffer (0x04) + { + 0xFF, 0xFF, 0xFF, 0xFF // .... + }, + + "vendor-id", + Buffer (0x04) + { + 0xFF, 0xFF, 0x00, 0x00 // .... + }, + + "device-id", + Buffer (0x04) + { + 0xFF, 0xFF, 0x00, 0x00 // .... + } + }) + } +} + diff --git a/extra-files/SSDT-GPU-DISABLE.dsl.zip b/extra-files/SSDT-GPU-DISABLE.dsl.zip new file mode 100644 index 0000000000000000000000000000000000000000..ac54db6119d7f393442271f9f565baefd4425004 GIT binary patch literal 1273 zcmWIWW@Zs#-~htNaK8WsC@5xOU=U$YUA2-S7*40d$#an(yH&It|SWnjN` z-!1MA5QFH_3T_5QmamKq3_z0@7|sSA%xiKG*!x*DxT=w*F+xB0kz=)}OcUu8Uw+Raqd&TXwW-*U}j>c`UQat_p5e%Q4$Du|39edh=23)Kz?M z&1?h@md4trgzU7G^VlZBv*n#pR|mt{WS8}Vuf8x9>6)t_ES{h|bF0zqRma0DcU0@z z@ja_>bC}#~b)Pd_GEU%Uf7ZdjB1Rv-U6OdUb{5h!G1 zWMf=%+%Uol9gx73h;`6QZ*X^EUtLB$;Q?+cuMco-Y3f$N|SuJNC zRb^x2wpgHeoMUQ&OYn)Go?mAjlK+1<{<+vIGj6l6sn=`v)cy}!ov#0w^Leh5&(dYt zVXU>0$8+BN-~46M!+F~@t<6uQ%`Xay{+M@Yzh&^__1{YP;`_p-4CK7gzV{?>aP5=`PC}{+EGct)VBT5D21O+M;U|>ljh($2vU@0TeZ9uji hlrUjnN#lK>nH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0