Hardware Setup:
- Motherboard: ASUS Z97-K (Intel 9-Series)
- CPU: Intel Core i7-4790
- GPU: NVIDIA Tesla P40 (24GB GP102)
- OS: Windows Server 2019
- Flasher: CH341A Hardware Programmer
The Problem: I bought a 24GB Tesla P40 for local AI inference, but encountered the dreaded “Code 12: This device cannot find enough free resources” in Windows. Enabling “Above 4G Decoding” in the native ASUS BIOS did nothing, and the 24GB BAR was completely missing from Linux lspci.
The Z97 PciHostBridge has a hardcoded 16GB MMIO limit. When the P40 requests a single contiguous 32GB block (powers of 2), the BIOS mathematically cannot map it and drops the request during POST. Simply injecting rebar.ffs is not enough; the legacy 32-bit limits must be removed using UEFIPatch.
However, standard UEFIPatch files cause a fatal hard-freeze at the ASUS boot logo on the Z97 chipset because the buggy PciBus tries to map the USB controller into the massive new 64-bit space, which immediately crashes the board.
Required Tools & Downloads
- UEFITool (v0.28.0): Releases · LongSoft/UEFITool · GitHub (Note: You must use the older v0.28.0. Do not use the newer “NE” versions as they are read-only and cannot insert modules).
- UEFIPatch: same link as above (Available on the same LongSoft releases page).
- ReBarUEFI (
rebar.ffs& standardpatches.txt): Releases · xCuri0/ReBarUEFI · GitHub
Here is the exact step-by-step to fix the USB crash, expand the MMIO to 512GB, and successfully map the 24GB VRAM.
Step 1: Inject ReBarUEFI
Before patching, you need to insert the ReBar module into your BIOS file.
- Open a clean Z97-K BIOS backup in UEFITool (v0.28.0).
- Navigate to the bottom of the DXE volume, right-click the last module → Insert after…
- Inject
rebar.ffsand save the new.binfile.
Step 2: The Custom Z97 patches.txt
The default ReBarUEFI patches.txt provides a USB blacklist fix, but it is hardcoded for Intel 8-Series boards (Device ID 9C31). You must modify this for the Intel 9-Series (Device ID 8CB1) or your system will freeze during PCIe enumeration.
Open patches.txt and ensure you use this exact block. Notice the hex replacement in the USB patch uses B18C to target the Z97 XHCI controller:
# PciBus | Remove <16GB BAR size limit (Sandy/Ivy Bridge/Haswell/Broadwell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:B8FFFFFFFF030000004C3B:B8FFFFFFFFFFFFFF004C3B
# PciBus | Don't downgrade 64-bit BARs to 32-bit (Haswell/Broadwell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:833E067506C70604000000833E077506C70605000000:66906690669066906690669066906690669066906690
# NvramSmi NVRAM whitelist unlock (by @vit9696)
842A454A-75E5-408B-8B1C-36420E4E3F21 10 P:9801000072:0000000072
# PciHostBridge | Remove 4GB limit for PciRootBridgeIo.Mem
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:493B4C24C0771B:66906690669090
# PciBus | Add Intel 9 Series XHCI Controller to 64-bit blacklist (Custom Z97 Fix)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:DE10D301FFFF00000B00000014:8680B18CFFFF00000B00000010
# NBPEI | Correct EFI_HOB_TYPE_CPU SizeOfMemorySpace from 36-bit to 39-bit (512GB) (Haswell/Broadwell)
79AA6086-035A-4AD9-A89A-A6D5AA27F0E2 10 P:8B45FCC64008248B45FCC6400910:8B45FCC64008278B45FCC6400910
# PciHostBridge | Replace 32/48GB - 63GB MMIO region with complete use of 512GB physical address space (Haswell/Broadwell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:BB00000000080000004823C1483BC3763C48BB000000000C000000....................................................................................................................................................................................................488B05........:BE000000007F0000004823C14889C34829DEEB6966906690669090....................................................................................................................................................................................................488B05........
Step 3: Patch the Modified BIOS
Drag the .bin file you just saved from UEFITool directly onto UEFIPatch.exe utilizing the custom patches.txt above. Verify via command prompt that the patches were successfully applied. This .patched file is your final image.
Step 4: Hardware Flashing & Avoiding Black Screens
Because patching the DXE volume alters the checksums, standard BIOS flashback utilities will reject it. You must flash the chip directly using a CH341A programmer.
After flashing, you must configure the BIOS before installing the GPU to avoid headless black screens:
- Leave the PCIe slot empty and boot using the iGPU to clear the mandatory CMOS Checksum Error halt.
- Enter BIOS → Enable Above 4G Decoding → Disable CSM.
- CRITICAL: Navigate to System Agent Configuration. Set Primary Display to iGPU AND explicitly enable iGPU Multi-Monitor. If you do not enable Multi-Monitor, plugging the P40 into the main slot will forcefully disable your display output.
- Save, shut down, install the Tesla P40, and boot into Windows.
Final Notes & Warnings
- DO NOT run ReBarState.exe: The Tesla P40 is a Pascal architecture card. Forcing a Resizable BAR state on it in Windows could cause immediate driver crashes. The BIOS modification is strictly to give the motherboard the vocabulary to execute standard Above 4G Decoding for the 32GB BAR request. Just the bios update should give you all that you need.
- This should enable the usage of modern GPUs for other purposes like Gaming too.
GPU-Z now correctly reports the full 24576 MB of memory size, and local LLM inference engines (like llama.cpp) can now map and utilize the entire VRAM pool seamlessly in TCC mode.
I have the file but I am unable to upload as a new user. Let me see if I can upload to the offer section.
Edit by Fernando: Thread moved into the „BIOS Modding Guides“ Category and title shortened/customized






