When passing through a high-memory PCIe GPU such as an NVIDIA L40S to a Linux virtual machine configured with Legacy BIOS firmware, the 64-bit prefetchable Base Address Register (BAR) fails to map inside the guest operating system.
lspci -vvv against the GPU PCI device shows Region 1 as <unassigned>, while smaller 64-bit regions (Region 3) are forced into the 32-bit address space below 4 GB: [root@localhost ~]# lspci -vvv -s 13:00.0 | grep Region
Region 0: Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at <unassigned> (64-bit, prefetchable)
Region 3: Memory at e4000000 (64-bit, prefetchable) [size=32M]
[root@localhost ~]# dmesg | grep -iE "pci|bar|mmio"
pci_bus 0000:00: Some PCI device resources are unassigned, try booting with pci=realloc
pci_bus 0000:00: resource 8 [mem 0xc0000000-0xfebfffff window]
In Legacy BIOS mode (emulated Intel 440BX chipset), the virtual machine's ACPI Current Resource Settings (_CRS) table restricts default PCIe memory windows to the 32-bit address space below 4 GB (0xc0000000–0xfebfffff).
Because the NVIDIA L40S requires a 64 GB 64-bit prefetchable BAR (Region 1), the allocation cannot fit within the 32-bit PCI memory window. Even when ESXi exposes a 64-bit MMIO window above 4 GB to the virtual machine, a Legacy BIOS Linux guest kernel will not utilize that space unless explicitly instructed to bypass the ACPI _CRS window limit (pci=nocrs) and dynamically reassign unallocated BARs at boot (pci=realloc).
Step 1: Verify ESXi 64-bit MMIO Virtual Machine Settings
Step 2: Add Kernel PCI Reallocation Parameters in the Guest OS
1. Log in to the Linux virtual machine as root.
2. Append pci=realloc and pci=nocrs to all installed kernel boot entries using grubby:
grubby --update-kernel=ALL --args="pci=realloc pci=nocrs"
3. Confirm that the parameters were staged in the default boot entry:
grubby --info=DEFAULT | grep args
4. Reboot the virtual machine to apply the updated kernel command line:
reboot
Step 3: Verify 64-bit GPU Memory Mapping
1. After the virtual machine boots, confirm that pci=realloc pci=nocrs is active in /proc/cmdline:
cat /proc/cmdline
2. Check the GPU PCI memory regions again using lspci:
[root@localhost ~]# lspci -vvv -s 13:00.0 | grep Region
Region 0: Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at 2000000000 (64-bit, prefetchable) [size=64G]
Region 3: Memory at 1800000000 (64-bit, prefetchable) [size=32M]
Region 1 and Region 3 are now mapped above the 4 GB boundary (2000000000 and 1800000000) with [size=64G] allocated.