From 8acedca4033f8b32f32ac872c4d1389ec4be04c4 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Thu, 2 Apr 2020 13:47:54 -0600 Subject: [PATCH] Add dGPU disabling guide --- Desktops/desktop-disable.md | 1 + Laptops/backlight.md | 6 +++ Laptops/laptop-disable.md | 78 +++++++++++++++++++++++++++ Universal/awac.md | 4 +- extra-files/SSDT-GPI0.dsl | 3 ++ extra-files/SSDT-GPI0.dsl.zip | Bin 908 -> 916 bytes extra-files/SSDT-GPU-DISABLE.dsl.zip | Bin 1146 -> 1146 bytes extra-files/SSDT-GPU-SPOOF.dsl | 1 - extra-files/SSDT-GPU-SPOOF.dsl.zip | Bin 1818 -> 1692 bytes extra-files/SSDT-NoHybGfx.dsl | 50 +++++++++++++++++ extra-files/SSDT-NoHybGfx.dsl.zip | Bin 0 -> 1199 bytes extra-files/SSDT-dGPU-Off.dsl | 35 ++++++++++++ extra-files/SSDT-dGPU-Off.dsl.zip | Bin 0 -> 1146 bytes 13 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 Laptops/laptop-disable.md create mode 100644 extra-files/SSDT-NoHybGfx.dsl create mode 100644 extra-files/SSDT-NoHybGfx.dsl.zip create mode 100644 extra-files/SSDT-dGPU-Off.dsl create mode 100644 extra-files/SSDT-dGPU-Off.dsl.zip diff --git a/Desktops/desktop-disable.md b/Desktops/desktop-disable.md index 134fac4..b5a08ff 100644 --- a/Desktops/desktop-disable.md +++ b/Desktops/desktop-disable.md @@ -14,6 +14,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 "Location Paths" + * Note some GPUs may be hiding under "BIOS device name" ![](https://cdn.discordapp.com/attachments/456913818467958789/675210740231176212/unknown.png) diff --git a/Laptops/backlight.md b/Laptops/backlight.md index d954330..eed2dba 100644 --- a/Laptops/backlight.md +++ b/Laptops/backlight.md @@ -10,3 +10,9 @@ No configuration required for most, just drop the prebuilt file into your EFI: * For Coffeelake users if the regular SSDT doesn't work, try SSDT-PNLF first and do not mix together Note: there are some rare cases where the iGPU is called `GPU0` or `VID`in the DSDT, you can double check by searching for `PCI0.GFX0`, `PCI0.VID` and `PCI0.GPU0`. Whichever shows up is your device + +If Windows has been installed on the device, you can also do the following: + +```text +Device Manager -> Display Adapters -> Properties -> Details > BIOS device name +``` diff --git a/Laptops/laptop-disable.md b/Laptops/laptop-disable.md new file mode 100644 index 0000000..b10d9f7 --- /dev/null +++ b/Laptops/laptop-disable.md @@ -0,0 +1,78 @@ +# Disabling laptop dGPUs + +So with laptops, we can hide the dGPU from macOS with the little boot-arg called `-wegnoegpu` from WhateverGreen. But one small problem, the dGPU is still pulling power draining your battery slowly. We'll be going over 2 methods for disabling the dGPU in a laptop: + +* [Optimus Method](/Laptops/laptop-disable.md#optimus-method) +* [Bumblebee Method](/Laptops/laptop-disable.md#bumblebee-method) + +## Optimus Method + +How this works is that we call the `.off` method found on Optimus GPUs, this is the expected way to power off a GPU but some may find their dGPU will power back up later on. Mainly seen in Lenovo's, the Optimus method should work for most users: + +To start, grab [SSDT-dGPU-Off.dsl](https://github.com/khronokernel/Getting-Started-With-ACPI/blob/master/extra-files/SSDT-dGPU-Off.dsl.zip) + + +Next we need to get on Windows, and head to the following: + +```text +Device Manager -> Display Adapters -> dGPU -> Properties -> Details > BIOS device name +``` + +This should provided you with an ACPI path for your dGPU, most commonly: + +* Nvidia dGPU: `\_SB.PCI0.PEG0.PEGP` +* AMD dGPU: `\_SB.PCI0.PEGP.DGFX` + +Now with that, we'll need to change the ACPI path in the SSDT. Main sections: + +```text +External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj) // ACPI Path of dGPU +```text + +```text +If (CondRefOf(\_SB.PCI0.PEG0.PEGP._OFF)) { \_SB.PCI0.PEG0.PEGP._OFF() } +``` + +Once adapted to your config, head to the compile section + + +## Bumblebee Method + +With some machines, the simple `.off` call won't keep the card off properly, that's where the Bumblebee method comes in. This SSDT will actually send the dGPU into D3 state being the lowest power state a device can support. Creit to Mameo for the original adaptation + +To start, grab [SSDT-NoHybGfx.dsl](https://github.com/khronokernel/Getting-Started-With-ACPI/blob/master/extra-files/SSDT-NoHybGfx.dsl.zip) + +Next we need to get on Windows, and head to the following: + +```text +Device Manager -> Display Adapters -> dGPU -> Properties -> Details > BIOS device name +``` + +This should provided you with an ACPI path for your dGPU, most commonly: + +* Nvidia dGPU: `\_SB.PCI0.PEG0.PEGP` +* AMD dGPU: `\_SB.PCI0.PEGP.DGFX` + +Now with that, we'll need to change the ACPI path in the SSDT. Main sections: + +```text +External (_SB_.PCI0.PEG0.PEGP._DSM, MethodObj) // dGPU ACPI Path +External (_SB_.PCI0.PEG0.PEGP._PS3, MethodObj) // dGPU ACPI Path +``` + +```text +If ((CondRefOf (\_SB.PCI0.PEG0.PEGP._DSM) && CondRefOf (\_SB.PCI0.PEG0.PEGP._PS3))) + { + // Card Off Request + \_SB.PCI0.PEG0.PEGP._DSM (ToUUID ("a486d8f8-0bda-471b-a72b-6042a6b5bee0"), 0x0100, 0x1A, Buffer (0x04) + { + 0x01, 0x00, 0x00, 0x03 + }) + // Card Off + \_SB.PCI0.PEG0.PEGP._PS3 () + } +``` + +Once adapted to your config, head to the compile section + +## [Now you're ready to compile the SSDT!](/Manual/compile.md) \ No newline at end of file diff --git a/Universal/awac.md b/Universal/awac.md index 99460bd..89be7c4 100644 --- a/Universal/awac.md +++ b/Universal/awac.md @@ -31,11 +31,11 @@ To determine whether you need [SSDT-AWAC](https://github.com/acidanthera/OpenCor * open your decompiled DSDT and search for `Device (AWAC)` * If **nothing shows up** then no need to continue and **no need for this SSDT** as you have no AWAC. **Otherwise, continue on!** -* If you get a result then you have an `AWAC` system clock present, then continue with the **next search for `STAS ==`**: +* If you get a result then you have an `AWAC` system clock present, then continue with the **next search for `STAS`**: ![](https://i.imgur.com/uuUF857.png) -As you can see we found the `STAS ==` in our DSDT, this means we're able to force enable our Legacy RTC. In this case, [SSDT-AWAC](https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/AcpiSamples/SSDT-AWAC.dsl) will be used As-Is with no modifications required. Just need to compile. Note that `STAS` may be found in AWAC first instead of RTC like in our example, this is normal. +As you can see we found the `STAS` in our DSDT, this means we're able to force enable our Legacy RTC. In this case, [SSDT-AWAC](https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/AcpiSamples/SSDT-AWAC.dsl) will be used As-Is with no modifications required. Just need to compile. Note that `STAS` may be found in AWAC first instead of RTC like in our example, this is normal. For systems where **no `STAS`** shows up **but** you do have `AWAC`, you can use [SSDT-RTC0](https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/AcpiSamples/SSDT-RTC0.dsl) though you will need to check the naming of LPC in your DSDT diff --git a/extra-files/SSDT-GPI0.dsl b/extra-files/SSDT-GPI0.dsl index 777ea05..d5a0c72 100644 --- a/extra-files/SSDT-GPI0.dsl +++ b/extra-files/SSDT-GPI0.dsl @@ -9,5 +9,8 @@ DefinitionBlock("", "SSDT", 2, "Slav", "GPI0", 0) { GPEN = One } + Else + { + } } } \ No newline at end of file diff --git a/extra-files/SSDT-GPI0.dsl.zip b/extra-files/SSDT-GPI0.dsl.zip index 48a534ee8b1925ffd9b3d801e1ccd1bd96bc950c..ed1f57c4d37dedb24495f74d12f2b3b72d48a7bb 100644 GIT binary patch delta 540 zcmeBSpTb@r;LXe;!oUH9FLIg!7@$Cak%57iL4hGS*d;{QJ;2jIFQqsqG=!IdJ=MM~ zE)9r5bZG@Q10%~d(E!qFbm^7N&)--!m-Jy)0U^WUE)j zM2#iW!ld>FsA(HI*(n@b6norQU9{dJd#`U(AM>MHn->E6*Q_uJuh`pbZntJhz|Vcs zUjE^i*nb^1Di&|xZ#FfNoy7FPFqJbwB!ee@T3K^3Nt@8QyxkA}O@ney@_^ zg{rsW0p9E!@;XYOOcrO<q+>X$^Re8{?_ zzg~8)zusz3b^Z8&jfYMdZ`}9AA#l#kR~EZJhlktOODy`f!E^0}b-%oqmDbAK=V@e) z?P?VIvyJJpnARzqEjP++R=&S>Zq85Z`_t=s|DD)j|K)K{@6yYEfevBk=nP=H?*eob zHxtNVj7%cTi1;e!gu8n3c_uZuGl9;X#4IBZic)0l62K^hfhCQ?ldYK*;95XFOJi1G K+Y7XYfdK#nVZ%oN delta 535 zcmbQj-osuW;LXe;!oUH96XrDrFhIe3AkE95zz`hl5~AxK;Axx8R0|U?q1_oCjTkb;!B6mJ(%gqc52$td2yQLNDqqvJx=yFJMvXbdn z=9l%`H!d*0WBcx|?9v0Vw>_pFs6YApweG?%EB>yu^;xp}LXd>+o3(X;+a#pl?hVuk zox1H-cKY*UCub$tFrBH~^|DmTPx;-!DACG0*)j{wo8)d@UVV(qIm~sN+`%C2;Jn|8 zWft!D4@}=t63&`p9^q`Pu)g7q)< z5l6h+dZ6P$K1K@pv#NrLHxU!QDeIJ&-i z-aUbzCw`n+?|a@jciW@;Ki19MeQ$rdv0nY6pN9SaWq>YW=U~{(6XpsGTW%(h%NUtN zm=W>Bg>d%d>r85JcLLoznS)tI5geCD`XzvI2?I+SxfmHH8!*bjb%A`B$E?7%6=)L! F0{~Xp!`1)* diff --git a/extra-files/SSDT-GPU-DISABLE.dsl.zip b/extra-files/SSDT-GPU-DISABLE.dsl.zip index dd5659fd397572dd63ab91a2ae45f322bddebaa8..bf551dc4e48c1843d653fef73c31e415b782af7d 100644 GIT binary patch delta 88 zcmeyx@rz@EHTyNYwm2Z(==7Ko%(k*`o2hYh0OY>qe)?j9~U$*Vf58Oh>r&N^*OdXPT6kuVtG2o2idQH2JvQ YITogpl00O5BaP5=M^ diff --git a/extra-files/SSDT-GPU-SPOOF.dsl b/extra-files/SSDT-GPU-SPOOF.dsl index 0a8e0f9..4b5f1da 100644 --- a/extra-files/SSDT-GPU-SPOOF.dsl +++ b/extra-files/SSDT-GPU-SPOOF.dsl @@ -35,7 +35,6 @@ DefinitionBlock ("", "SSDT", 2, "Slav", "AMDGPU", 0x00001000) } Else { - Return (Zero) } } } diff --git a/extra-files/SSDT-GPU-SPOOF.dsl.zip b/extra-files/SSDT-GPU-SPOOF.dsl.zip index 10e923010b310bcfb07156cb0d03e36d903f4f68..db05ee6201abe506196d9804fe81fb61b5393c5f 100644 GIT binary patch delta 1480 zcmZvcdo&XY9LHy4GAXUD*$rnN%QMzxM)#5lHAKvz&@jxr=20GbjgeyG4rv$}X7?u7 zb2)ij?=X2cQgr9g6{+21iXQIeo=&$v?)P_o=XZYRe1E^cKIdCHX{ER$t}oj9Qw!S@GS@5$S!duZa`?f~t=x;Z zu~sC=~7T?gEuBw(om&3;H&$% z3Do{KkFFHXD-XDGcb=|B!oO$8vuyADe8Sj?rl8HtJ=CQ2V791u3Nez(LwQ4F^tvyk*j9ZR7 zjF*+i(3VEFtEacGELW|Ii^}6Mu{)+L{frssw}xgx+fBoOZF%49J4To6Bc9+@Kb%Zr z-N|Y6P1~Z^fvqm%Ti6}$)H#AW?DoRd=jxLmv7n;(n~@}EvVjua$5trhYi=~^W1RvW znJ*Y!4M^RmS(`!+IjMxokJjP| z;JAl7u~Xq(OtHt~CxxUSLCjrDO{!?yz%!dH$B$BMRGgmDD~qK{6TJmywjS4+Svp%F z?_=sb8mk>rP46krwVccGbiROs1xnMUBw$kWynP@yAK&MGJyCGcS1H@;;F39?vV?fUMjiI|j;u4?LzfS3TIF~Ds4L?{9W({>g==YX(g_?!egm(|| zbdneE*ZjARHQF`Y&OB$gQ-4>dij6hvu=tJi8fB51iG(5t84CoI$t@?Ih9#p2GXaZ;()=3@~aq-OZN#at$n?~Ro@O!|NF_C z4X69z(#p!*{Ef?-Pt-~R?qE;H<6WT+u7x0)x;X34k;FLnN56PCFIL1_qKuiu&yE)lj z&hd63E;U{*DTYH(9@|PIKdnclJ)yjxD=gj8SmN`W_@9QK)AS0sy{{OOc}6MilW>06 z@$4+%^et>*8W!efhjSrDWfHK#Srk`dbPItL?UWLnO~DdfLI_zD5=854QD2%31eC7f zlq{2lgd^^u--SmZ*i(*FQA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Ixa?k!5!dl@A{b zKW*jd0u=f$%TH}IduekhQ$y6->(?uA8PlF-*)dB2xdXNxGmT}1I0!II`%XKSz_NY9 zu*5B0K?9Cep55>#VQ9B#WfBTz-Y*Sj{YMfD3IR2{>~VKZu!o{s=G5(V4JqA+5eA^Hh)`Q byI`lyfI$o;$ky*yYa|_m>A~z_Yx92qADYv) diff --git a/extra-files/SSDT-NoHybGfx.dsl b/extra-files/SSDT-NoHybGfx.dsl new file mode 100644 index 0000000..2bedcb0 --- /dev/null +++ b/extra-files/SSDT-NoHybGfx.dsl @@ -0,0 +1,50 @@ +/* +* Disable discrete graphics (c) Bumblebee-Project +* >> https://github.com/Bumblebee-Project/Bumblebee/wiki/ACPI-for-Developers#acpi-and-the-nvidia-card +* --- +* Important: Change all ACPI paths accordingly. +* Credit to Maemo for original idea and midi1996 for the SSDT +*/ +DefinitionBlock ("", "SSDT", 2, "MAEMO", "NoHybGfx", 0x00000000) +{ + External (_SB_.PCI0.PEG0.PEGP._DSM, MethodObj) // dGPU ACPI Path + External (_SB_.PCI0.PEG0.PEGP._PS3, MethodObj) // dGPU ACPI Path + + Device (NHG1) + { + Name (_HID, "NHG10000") // _HID: Hardware ID + Method (_STA, 0, NotSerialized) // _STA: Status + { + If (_OSI ("Darwin")) + { + Return (0x0F) + } + Else + { + Return (Zero) + } + } + + Method (_INI, 0, NotSerialized) // _INI: Initialize + { + If (_OSI ("Darwin")) + { + // If conditional methods reference creation successful + If ((CondRefOf (\_SB.PCI0.PEG0.PEGP._DSM) && CondRefOf (\_SB.PCI0.PEG0.PEGP._PS3))) + { + // Card Off Request + \_SB.PCI0.PEG0.PEGP._DSM (ToUUID ("a486d8f8-0bda-471b-a72b-6042a6b5bee0"), 0x0100, 0x1A, Buffer (0x04) + { + 0x01, 0x00, 0x00, 0x03 + }) + // Card Off + \_SB.PCI0.PEG0.PEGP._PS3 () + } + } + Else + { + } + } + } +} + diff --git a/extra-files/SSDT-NoHybGfx.dsl.zip b/extra-files/SSDT-NoHybGfx.dsl.zip new file mode 100644 index 0000000000000000000000000000000000000000..c9c7cd4fb7d63cc6900c2a47653eb96fd4369c79 GIT binary patch literal 1199 zcmWIWW@Zs#-~htToTdNorziN=7_9(%CP*@qx}Gtz|krhE{uz25FrwzS~-N>a!)&c_V{>4Nt6e8{8*` zY&`M&W^nVL-(1NH9la%rV>}krC`_HvJttiu>50S51jo*(=g;S!@>!|Kap(1|g~7#! zf;%rbJ=^Q!R-SP6wR?bh*e|)ur8Slk{=Ioh?*0!ADwkA$-uP3g>}@!&2V1|?)RP%! zo9?Z7_hh06988J? z6(c5J+>jbRt8}58T8-nhn(Dy=Ocr;8 ziB=A(6>9Sg>pIn<#hK2QM($zTr)u^{mBof!VdOuraC-n^67SkF&b5%homKF&Fdlx7|mb?g-FUNw(N zL~Vt^a`t7s&yI1pO1egfc+SjyIO9s#{DgG|GcWyRFU%Hq&9$&-=>OBv^i6*1`*r`8 zHroYqF7tF+{68{jVfnAOt2x$WR~A3sX<~BE?)8!MlakqOhUsrFhn@KGvhak}*>8sL zTjF2Fw_C)#Rr`3eCfen4+{_D0v|er5-u)!w0+1z}+PdsPq?xu3*Uw;Z- zNFKO#Ec);7sy*=yUp>1&NC$YcbJ%}>eXNOzfdQ0^1F$A=5nzIq0VeSHcwa|n|KJFH zy?Fd-{RJ?+qowua1kvR5grtNIzCK|e_`^B^8kiN*C zAQo|4PNB~s_z;VzctXMiuXE?Gdh2MM@Vt83Q%6rz*U#6}Q^zxukE3msE%OmM9-coO zr8_%MS~?tz{FYm&z`A{YgohJPs`bx}9zRxH|J&-@nLA79YjtO_z7@!O>>SS>F9x>) zGatxP0p5&EBFu;!jT{u991R0Y8bK`leg@@nG(V#ok8Cw4JYir-<3nKhQxduX-mJjb QV_;wc!jnMy0yBsQ0OI1$rT_o{ literal 0 HcmV?d00001 diff --git a/extra-files/SSDT-dGPU-Off.dsl b/extra-files/SSDT-dGPU-Off.dsl new file mode 100644 index 0000000..a9e953b --- /dev/null +++ b/extra-files/SSDT-dGPU-Off.dsl @@ -0,0 +1,35 @@ +/* Based off of Rebaman's work: +* https://github.com/RehabMan/OS-X-Clover-Laptop-Config/blob/master/hotpatch/SSDT-DDGPU.dsl +*/ +DefinitionBlock("", "SSDT", 2, "Slav", "dGPU-Off", 0) +{ +External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj) // ACPI Path of dGPU + + Device(RMD1) + { + Name(_HID, "RMD10000") // _HID: Hardware ID + Method (_STA, 0, NotSerialized) // _STA: Status + { + If (_OSI ("Darwin")) + { + Return (0x0F) + } + Else + { + Return (Zero) + } + } + + Method(_INI) + { + If (_OSI ("Darwin")) + { + // disable discrete graphics (Nvidia/Radeon) if it is present + If (CondRefOf(\_SB.PCI0.PEG0.PEGP._OFF)) { \_SB.PCI0.PEG0.PEGP._OFF() } + } + Else + { + } + } + } +} \ No newline at end of file diff --git a/extra-files/SSDT-dGPU-Off.dsl.zip b/extra-files/SSDT-dGPU-Off.dsl.zip new file mode 100644 index 0000000000000000000000000000000000000000..f5b4c82526367930c71fa3e1a70c66d266325230 GIT binary patch literal 1146 zcmWIWW@Zs#-~d9k+@=5qD5zj&U=ULMfgwkC8l#mBiyt%@`uej2^ zXLI*HU9I|V1MjwZ}V!u&!@=D-7nDk>a@m|iA`FdC^X)=X^c;x;hw zP<{UVm8zJ?lO?a7s)$XWBDQ?l5|wF7wAfjk&jv6GMe*=xag^>{soLpa+8Oro=03f7 zsw;OcJi5|VvGe88gs*iDN|PE7%5+yPD4Ks{$(1=j_LMx{BV)Yz%A-%0VuXVyFZvU+ z_=?TsLvQ|sEO=)5Ew@l%a@YK;Gn-y4X_|B9kq~n;t4x5np;PU_6AfGz_D?_D_-Ip| zd|7^C-tk@Ay>q|rR9?GjYQOxMIfaF