[Guide] How to Unlock DVMT Pre-Allocated on Laptops



EliteMacx86

Administrator
Staff member
Setting DVMT to 64 is required and it can avoid several graphics issue. This requirement is not only for laptops but for desktops too.
But a majority of manufacturers don't give option to change the DVMT. DVMT can be set from EFI shell method but can be trouble for encrypted BIOS. The only workaround is to patch the framebuffer to match your BIOS settings. Commonly the 32MB DVMT is set on Broadwell/Skylake and Kaby Lake.

If you're using Intel HD Graphics (Supported Graphics), OS X/macOS needs more than 32MB DVMT otherwise there can be a Graphics kernel panic.
Also, if you're having a QHD/4K or UHD Laptop, you need to set the DVMT to 64 MB or even more such as 96 or 128MB.

Available Methods
There are only few methods by which DVMT-prealloc can be set or matched to your Laptop BIOS Settings. The methods are listed below
  • BIOS Option
  • Framebuffer
  • EFI Shell
  • Flashing a Unlocked BIOS
BIOS Option
This is a very easy method. But the major disadvantage is this option is not available by most of the laptop manufacturers. Only some manufacturers allow such as ASUS. The DVMT can be set from the Advanced Tab>Graphics Configuration>DVMT Pre-Allocated to 64M.

Framebuffer
This method is the easiest method and works for the most of the time. The advantage of this method is it can be applied to all the manufacturers, without flashing and unlocking the BIOS. Even if the BIOS is locked, this method will work.
The patch for the StolenMemory is present in the config.plist from RehabMan. You can just follow the laptop installation guide and get it done.

Note :
  • For patch, to bypass the StolenMemory, you must use a valid ig-platform-id to match the framebuffer.
EFI Shell
This method is bit difficult and doesn't fits to all the laptops. Laptops such as HP, Lenovo has often locked/encrypted BIOS and the DVMT cannot be unlocked.

Warning:
  • This method can also brick your Laptop. Use at your own risk.
Downloads
EFI Shell
UEFITool
Universal IFR Extractor
Phoenix Tool

Extracting the BIOS
The very first step is to extract the BIOS. The BIOS must be in a valid format such as .ROM, .BIN or .fd. The direct BIOS file will not work. For AMI BIOS, you can use AMI BIOS Utility. The other way is to use Universal BIOS Toolkit. With some manufacturers and laptop models, you can also use the .EXE BIOS file and then extract it directly. For some BIOSes, it's packed and compressed in a different format.

Extracting the Module from the BIOS file
The next step is to get the data from the extracted BIOS file. To get the data, open your BIOS file using UEFITool you downloaded above.
Find the module labeled with Setup
Expand the module, and right click on PE32 image section and then click on Extract Body.
A binary file will be saved on your Desktop.

Extracting the Settings from the Module
Once you've the module, you can proceed with the next step.
Open Universal IFR Extractor, you downloaded above.
Browse your Module and click on Extract.
A text version of the same module will be saved with the same name on your Desktop.
Open the text file and look for "DVMT".
Find the variables for the DVMT Pre-Allocated memory and the related values.
In this case, DVMT pre-allocated memory's variable is 0x1C3. The value of 96MB is 0x3. Record these two values.

Prepare a Bootable USB with UEFIShell
Use a USB Flash Drive
Format it as FAT32, MBR
Extract the EFIShell you downloaded above. You'll find a folder named BOOT.
Rename your USB to "EFI"
Create a folder on your USB and rename it to "EFI"
Copy the BOOT folder to your USB.

Note:
  • With some laptops, it will not recognize it. You'll need to copy the BOOT folder to the root of your USB Flash Drive.
Changing the DVMT
Restart your Laptop
Boot to boot menu and boot using your USB Flash Drive. Make sure you boot from the EFI prefix followed by your USB Flash Drive.
Now, you need to use the setup_var command to change the DVMT settings.
Syntax:
Code:
setup_var address value
Once you're in EFIShell, type the commands below.
In this case, the command is setup_var 0x1C3 0x3.

Note:
  • Change the value of memory variable and the memory of DVMT.
Once you get this done, you'll get a success message. If not, your BIOS is locked or encrypted and this method cannot be used.

Restart and boot it using the OS X/macOS USB Installer, you should have bypassed the assertion/kernel panic due to less DVMT size.

A Quick Note
The above method may not work on a Laptop with Insyde or H20 BIOS. As you won't be able to find the "Setup" module. To over come this, you'll need to use another method, but the medicine is same.


Once you've the BIOS file, follow the steps below.

1. Extract Phoenix Tool you downloaded above.
2. Open the folder, and you'll find PhoenixTool.exe.
3. Open the Phoenix Tool, this will open up a new window as shown below.
Under the Original BIOS, browse the path to your extracted BIOS.
4. Select the BIOS file you extracted, and click on “Open”
5. The tool will open the BIOS file.
Once the tool reads the BIOS, it will give a pop-up message, just click on “OK” and it will finish running.
6. Click on the “Structure” button as below.

With the above method, we used "Setup" variable but in the Insyde and H2O BIOS, you'll need to use "DXE Core" file.

Identifying the DXE Core
The next step is to identify the BIOS ROM file with the variable that we need to change. After clicking the “Structure” button in the Phoenix Tool, a new window will open up as shown below.
Expand the modules and look for the line described as “DXE Core"
2. Collapse the DXE Core button and select the “PE32+ image section”.
3. Select the “Decompress Extracted Modules” check box and then click “Extract
4. For few minutes, it will seem like nothing is going or the process has stopped but you need not to worry.
It will create a new folder called “DUMP” in the folder where you saved your extracted BIOS file.
Once the process finishes, you will be directed back to the PhoenixTool main menu window. You can close this window by clicking the close button.

Identifying the BIOS ROM file
The location where you saved your BIOS, you can find a folder named “DUMP”. Inside this folder there will be several files all ending with .ROM extension. Except one ROM, all the other ROM files are of no use.
Identify the largest file with the name starting with FE3542FE. For my example this was named “FE3542FE-C1D3-4EF8-657C-8048606FF670_1513.ROM” and was about 555KB big yours will be different but starts with the same FE3542FE name.
Copy the identified ROM and place it to another location.

Once you get the ROM file, you can follow the above steps, from Universal IFR Extractor step.

Flashing a Unlocked BIOS
This method is quite risky and will not work without use of special tools and knowledge. A little wrong step can lead to damage your Laptop and you need to get your laptop to some technician and deal with it.

You can find a unlocked BIOS for your laptop here. Please note that the unlocked BIOS might not be available for your laptop. But you can request it.


Credits:
Austere.J
Kinutsk
 


Top