NVIDIA L40S 64-bit GPU Memory Region Shows as <unassigned> in a Linux Virtual Machine Using Legacy BIOS on ESXi
search cancel

NVIDIA L40S 64-bit GPU Memory Region Shows as <unassigned> in a Linux Virtual Machine Using Legacy BIOS on ESXi

book

Article ID: 463575

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

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.

  • Running 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]

  • Inspecting the guest kernel ring buffer (dmesg) reports unassigned PCI device resources and recommends booting with pci=realloc:

[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]

  • This behavior occurs even when the required 64-bit Memory Mapped I/O (MMIO) advanced parameters (pciPassthru.use64bitMMIO = TRUE and pciPassthru.64bitMMIOSizeGB = 128) are already configured on the virtual machine.

Cause

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).

Resolution

Step 1: Verify ESXi 64-bit MMIO Virtual Machine Settings

  1. In the vSphere Client or ESXi Host Client, verify that the virtual machine has the following parameters configured under Edit Settings > VM Options > Advanced > Edit Configuration:
    • pciPassthru.use64bitMMIO = TRUE
    • pciPassthru.64bitMMIOSizeGB = 128 (Note: Because the NVIDIA L40S requires 64 GB for Region 1 plus 32 MB for Region 3, the combined allocation exceeds 64 GB and requires 128 GB).
  2. If you newly added or modified either parameter, perform a full Power Off followed by Power On of the virtual machine from vCenter/ESXi (a guest OS reboot alone does not reload .vmx hardware 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.