steelbrain / razer-blade-17-pro-2020-hackintosh

Hackintosh configuration for macOS Catalina to run on a Razer Blade 17 Pro 2020
20 stars 1 forks source link

iGPU Acceleration #3

Closed steelbrain closed 3 years ago

steelbrain commented 4 years ago

So far the debugging has led me to an error in kernel logs which says dpcd-max-link-rate is 0. Overriding it through WhateverGreen gives off weird screen glitches followed by a panic, makes me feel like I'm on the right track.

WhateverGreen recently fixed a division by zero panic, it's possible there's another that's not yet fixed

shiecldk commented 3 years ago

I am interested in this laptop. Have you tried to set DVMT to 64mb? https://github.com/stonevil/Razer_Blade_Advanced_early_2019_Hackintosh

Also, can you change the WiFi card to Broadcom?

steelbrain commented 3 years ago

@astro-lee-k The bios is locked tight this time, I’ve held a Razer Blade 15 2019. You could flash a custom bios in it, with this one you can’t.

So I used a hardware programmer to bump up the dvmt pre alloc size but it made no difference when compared to the WhateverGreen patches applied in the config in this repository.

Furthermore, you don’t need to switch out Intel wifi anymore, community Intel wifi kexts are pretty stable

shiecldk commented 3 years ago

@steelbrain Gotcha. It's unfortunate to know they have locked the bios. Have you tried the method to change hidden bios settings in here: https://www.tonymacx86.com/threads/success-gigabyte-designare-z390-thunderbolt-3-i7-9700k-amd-rx-580.267551/page-432

You can ctrl/command+F DVMT to find the bios options.

shiecldk commented 3 years ago

I saw some functions is and will not be supported by the intel drivers, like airdrop, etc. Also, it seems some motherboards lock CNVI slot for using ngff WiFi cards. Not sure if this is also the case for this laptop.

steelbrain commented 3 years ago

Have you tried the method to change hidden bios settings in here

I have :) I reflashed it with a hardware programmer should tell you that I tried every available option.

it seems some motherboards lock CNVI slot for using ngff WiFi cards

That's not the case for this laptop, you can change it, but I personally have not done that.

I agree with your comment about Airdrop, I just hope it'll get better soon. Also since this issue is for iGPU acceleration and we're dereailing off-topic, I've created this issue for discussion: https://github.com/steelbrain/razer-blade-17-pro-2020-hackintosh/issues/4

4rtz1z commented 3 years ago

use this under DeviceProperties, maybe you'll get GPU, i used this under RBP17 2019 it works under Catalina, but no for Big Sur

<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
            <dict>
                <key>AAPL,ig-platform-id</key>
                <data>
                AACbPg==
                </data>
                <key>disable-external-gpu</key>
                <integer>1</integer>
                <key>disable-hdmi-patches</key>
                <integer>1</integer>
                <key>enable-cfl-backlight-fix</key>
                <integer>1</integer>
                <key>enable-hdmi20</key>
                <integer>1</integer>
                <key>framebuffer-fbmem</key>
                <data>
                AACQAA==
                </data>
                <key>framebuffer-patch-enable</key>
                <integer>1</integer>
                <key>framebuffer-stolenmem</key>
                <data>
                AAAwAQ==
                </data>
                <key>igfxfw</key>
                <data>
                AgAAAA==
                </data>
            </dict>
steelbrain commented 3 years ago

@4rtz1z Thanks for sharing. Could you upload your EFI config somewhere? I wanna see which SMBIOS you're using, and what's the display resolution on your machine (along with what ACPI patches you chose to use)

I tried the above DeviceProperties with SMBIOS MacbookPro16,1-4 but always got stuck here:

(The black bar at the bottom is because of the weird aspect ratio of the screen, and happens even in windows when latest Intel Drivers aren't installed so it's unrelated)

IMG_2398

4rtz1z commented 3 years ago

here's mine, im using mbp16,1 https://we.tl/t-x7qiYe61xG

4rtz1z commented 3 years ago

So how is it ? @steelbrain

steelbrain commented 3 years ago

Current state of investigation:

The screen doesn't work because of dvmt memory stuff, WEG patching is not enough because the panel is 4k so a patched up 32mb framebuffer is no good. The BIOS is signed, so you cannot modify and write it from Windows/Linux etc so I used a hardware programmer (namely CH341A).

Turns out Razer has gone a step further, even if you use a hardware programmer, it resets its bios on boot.

So we need someone who has a better understanding of BIOS than I do, is able to remove that encryption crap, and modify the dvmt values.

If someone wants to inspect the bios locally, you can download this archive from Razer (https://rzr.to/AI1ON) and extract with some zip tool. There are two firmwares in there, one (smaller size) is for Intel ME engine, the other one is for the laptop BIOS.

steelbrain commented 3 years ago

Update: Finally found a fix for the bios / dvmt issue (still involves using a hardware programmer)

I've confirmed hardware accelerated graphics! Will update this with more info soon!

4rtz1z commented 3 years ago

That's good news that you could use my 2019 config on yours, Hopefully we could work together for big sur tho, almost hopeless for gpu acceleration

shiecldk commented 3 years ago

@steelbrain I actually just get the 2020 15 inch 4k advanced model (2080 Super). It would be interested to know how you get the DVMT sorted out.

steelbrain commented 3 years ago

@astro-lee-k Is the bios locked tight on that model as well? If so, you should order a ch341a programmer with SOIC8 test clip to go with it. I'll be writing a detailed guide in the next day or two

shiecldk commented 3 years ago

@steelbrain Yes, I think it's locked in the same way. I cannot use setup_var, setup_var2, setup_var_3 to change bios settings. I do have ch341a programmer already. Do you just use AMIBCP to change the DVMT settings?

steelbrain commented 3 years ago

Do you just use AMIBCP to change the DVMT settings?

The bios from this year's models does not open in AMIBCP. I tried many versions of AMIBCP but they all throw the warning of how language name cannot exceed 0xx bytes.

What you want is to download UEFI Tool (but not the new one, the new one opens bios in read-only mode), so download it from https://github.com/LongSoft/UEFITool/releases/tag/0.27.0 then download Universal IFR Extractor (https://github.com/donovan6000/Universal-IFR-Extractor)

afterwards you open the BIOS in UEFI Tool and search for "dvmt", it'll point you to a setup blob. Extract that body and save it, then extract it with IFR Extractor. Now open the body blob in a hex editor, I use the online https://hexed.it one

The purpose is to unhide the “DVMT Pre Alloc” Settings, there are two parts to it:

So lookup DVMT in IFR text, see if it’s surrounded in a Suppress If (if so, apply step 2 here), then scroll up to find the parent “FORM”. In my case it was “Graphics Configuration”. The DVMT settings did not have an if/else statement on itself in my case, so I just skip to the parent form. The form “Graphics Configuration” has a form ID of “0x2753” but the hex is 01-86-53-27-BD-06. You’ll see that the order of 0x2753 is 53-27 in shown hex, nothing to worry about. Now search for “53 27” (yes with the space, ‘cause that’s what IFR extractor outputs). You’ll now arrive at a “System Agent Configuration” Form (if you scroll up and see). If you see a Suppress-If surrounding Graphics Configuration, apply second step here. Then lookup the form ID of System Agent Configuration, for me it was “0x2752” with hex of 01-86-52-27-1A-05. Now I look up “52 27” and arrive at the “Chipset” parent Form, that’s where there is a Suppress-If for me. That’s also where you apply the second part.

In the extracted IFR, you’ll see a lot of “Suppress If” and then on a new line, you’ll see a “Variable X equals Y”. For example for statement, “Variable 0xD98 equals 0x1, the hex would be 12-06-98-0D-01-00”. On the left, there will be a bar of hex in the IFR, that’s the address you can use to jump to in the hex editor.

Now you want to look for a menu item that you DO see in the menu, that are not hidden, as-in, the if statement, whatever it is for that, is true. So you want to copy the entire hex for the variable-check from a menu item that is shown, and paste it at the address of the variable check you want to replace.

After these changes are done, save the edited file from the hex editor, go to UEFI tool again, right click the Setup blob you extracted and select “Replace body”, then save the updated bios. The bios modding is now complete.

Nextup download ASProgrammer from somewhere, clip the CH341A to the BIOS chip and press detect chip, for me I got three choices and it was the second WINBOND something chip. First you want to read from the chip, and save that somewhere as backup. Then you want to open the modded bios, and click the little down arrow next to the “WRITE TO IC” button, that should open up a menu that shows a “Erase, Program, Verify”. Select that! Please note that if you do not erase before you flash, the flasher will just skip over the zeros instead of overwriting them.

Another thing to note here is that on my Razer Blade Pro 17 2020, if I disconnected the battery and flashed the bios, the bios would revert to original on boot, so you need to keep the battery plugged in (and the laptop shut down) when you program it.

In case you manage to mess up the bios and want a virgin one, go to Razer support, and download any of the “Razer Updater” bios utilities, extract them with peazip or winzip or whatever and you’ll find a vanilla bios in there.

After that, just boot into bios and increase the DVMT pre alloc mem. Godspeed!

steelbrain commented 3 years ago

Closing as this is fixed, and new config of mine has been published to repo

steelbrain commented 3 years ago

Update: AMIBCP version 5.02.0031 can modify the BIOS without the language name error. So you do not have to use the UEFITool editing method.

RodFer01 commented 2 years ago

Update: AMIBCP version 5.02.0031 can modify the BIOS without the language name error. So you do not have to use the UEFITool editing method.

Steelbrain, I tried to use this version, but I got a error "18 error : secure flash rom verify fail". Please, do you get the same error? Do you know any workaround here? Thank you, Rodrigo

dustincumin commented 2 years ago

It was too HARD for me. God help.

IgnitePro commented 1 year ago

Do you just use AMIBCP to change the DVMT settings?

The bios from this year's models does not open in AMIBCP. I tried many versions of AMIBCP but they all throw the warning of how language name cannot exceed 0xx bytes.

What you want is to download UEFI Tool (but not the new one, the new one opens bios in read-only mode), so download it from https://github.com/LongSoft/UEFITool/releases/tag/0.27.0 then download Universal IFR Extractor (https://github.com/donovan6000/Universal-IFR-Extractor)

afterwards you open the BIOS in UEFI Tool and search for "dvmt", it'll point you to a setup blob. Extract that body and save it, then extract it with IFR Extractor. Now open the body blob in a hex editor, I use the online https://hexed.it one

The purpose is to unhide the “DVMT Pre Alloc” Settings, there are two parts to it:

  • Finding WHERE the form is hidden

So lookup DVMT in IFR text, see if it’s surrounded in a Suppress If (if so, apply step 2 here), then scroll up to find the parent “FORM”. In my case it was “Graphics Configuration”. The DVMT settings did not have an if/else statement on itself in my case, so I just skip to the parent form. The form “Graphics Configuration” has a form ID of “0x2753” but the hex is 01-86-53-27-BD-06. You’ll see that the order of 0x2753 is 53-27 in shown hex, nothing to worry about. Now search for “53 27” (yes with the space, ‘cause that’s what IFR extractor outputs). You’ll now arrive at a “System Agent Configuration” Form (if you scroll up and see). If you see a Suppress-If surrounding Graphics Configuration, apply second step here. Then lookup the form ID of System Agent Configuration, for me it was “0x2752” with hex of 01-86-52-27-1A-05. Now I look up “52 27” and arrive at the “Chipset” parent Form, that’s where there is a Suppress-If for me. That’s also where you apply the second part.

  • Changing the if/else statement that hides it to be true

In the extracted IFR, you’ll see a lot of “Suppress If” and then on a new line, you’ll see a “Variable X equals Y”. For example for statement, “Variable 0xD98 equals 0x1, the hex would be 12-06-98-0D-01-00”. On the left, there will be a bar of hex in the IFR, that’s the address you can use to jump to in the hex editor.

Now you want to look for a menu item that you DO see in the menu, that are not hidden, as-in, the if statement, whatever it is for that, is true. So you want to copy the entire hex for the variable-check from a menu item that is shown, and paste it at the address of the variable check you want to replace.

After these changes are done, save the edited file from the hex editor, go to UEFI tool again, right click the Setup blob you extracted and select “Replace body”, then save the updated bios. The bios modding is now complete.

Nextup download ASProgrammer from somewhere, clip the CH341A to the BIOS chip and press detect chip, for me I got three choices and it was the second WINBOND something chip. First you want to read from the chip, and save that somewhere as backup. Then you want to open the modded bios, and click the little down arrow next to the “WRITE TO IC” button, that should open up a menu that shows a “Erase, Program, Verify”. Select that! Please note that if you do not erase before you flash, the flasher will just skip over the zeros instead of overwriting them.

Another thing to note here is that on my Razer Blade Pro 17 2020, if I disconnected the battery and flashed the bios, the bios would revert to original on boot, so you need to keep the battery plugged in (and the laptop shut down) when you program it.

In case you manage to mess up the bios and want a virgin one, go to Razer support, and download any of the “Razer Updater” bios utilities, extract them with peazip or winzip or whatever and you’ll find a vanilla bios in there.

After that, just boot into bios and increase the DVMT pre alloc mem. Godspeed!

Hello there, I am working on a very similar Laptop, Razer Blade 15 Advance 2020, (Model RZ09-0330) and have a quick question The BIOS modded is .rom, (mine is 12mb) and the software flashing AsProgrammer using .bin (1Mb), When I flash using CH341A device, clip-in the BIOS Chip, GD25Q80B, I run into the message, and failed the flashing step

failed flashing

Can you pls help me point it out what need to be done?

I also tried to use few other things, as using AMIBCP version 5.02.0031 to modified the changes, or even using UEFI Tool as you mention and extra the body with IFR Extractor and seeing all the info of my BIOS chip has similar name and variable value as yours. Or if you could some how help me to mod mine, I will upload them all files you need

Many thanks in advance.

steelbrain commented 1 year ago

@IgnitePro Have you tried just dumping the original bios from the chip and then modifying and reflashing it? Also, have you double checked the chip identification in ASProgrammer to see it's correct?

IgnitePro commented 1 year ago

Hey @steelbrain, Thanks for getting back to me so quick, I was out of town last weekend for FatherDay, didnt have my laptop with me. I am uploading the BIOS dump on this link, 16Mb upzip from BIOS image on Razer Website https://drive.google.com/drive/folders/1oXFGYOIWeM3lVuqXx2m16H4frLp0nwBs?usp=sharing And here is the pic of the chip itself,

BIOS Chip

AsProgrammer detect the chip is 25Q80B, and I save the BIOS image, as OEM.bin on the same Google drive link (1Mb)

So what I have tried is using AMIBCP_5.02.0034 to modify the BIOS dump (the 16Mb one), saved it and overwrite the original but when I try to re-flash it by running Razer Updater.exe on windows, its said the BIOS is already up to date and wouldn't do anything, Second try I did is using UEFI tool, find the Chip as you mention on the post, and extract the body, change the HEX code and replace it back the body on the UEFI, but still no go with Razer Updater.exe,

I feel like I miss out something,

Then I come across this post, https://www.reddit.com/r/razer/comments/pnpdpp/wanna_fix_what_razer_cant_cpu_unlock/ https://starkeblog.com/firmware/uefi/ru.efi/bios/2020/08/01/modifying-bios-using-ru-efi.html

Wonder should I try this,

Let me know what your advice. If you think its better to use AsProgrammer, and if you have some spare time to help me edit the OEM.bin to unlock the Chipset of the BIOS, it would be much appreciated it, Again, many thanks in advance.

steelbrain commented 1 year ago

@IgnitePro Let's move this into a discussion I've created for us https://github.com/steelbrain/razer-blade-17-pro-2020-hackintosh/discussions/10