> This page is for Optimizing VM Configuration for Performant AI Inference on Hopper HGX.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/ai-enterprise/planning-resource/llms.txt.

## ATS and ACS configuration

To achieve maximum GPUDirect RDMA performance in a VM, PCIe Address Translation Services (ATS) must be enabled on the NIC, and PCIe Access Control Services (ACS) settings on PCIe switches and root ports must be configured to allow ATS to work.

### Enabling ATS on NVIDIA NICs

To enable ATS, first make sure the Mellanox Support Tool Kit (MST) is running with `sudo mst start`, then use the following commands, one per NIC, to check and/or set the ATS status:

To check the current state:

```bash
# mlxconfig -d /dev/mst/mt4129_pciconf0 q | grep ATS_ENABLED
        ATS_ENABLED                                 False(0)
```

In the example above, the first NIC (pciconf0) has ATS disabled, which is the default setting.
Each NIC should be checked individually.

To enable it on a single NIC, use the following command:

```bash
# mlxconfig -d /dev/mst/mt4123_pciconf0 set ATS_ENABLED=true
```

After running the command above for all NICs, a host reboot is necessary. Keep in mind that if the NIC is already in passthrough mode, rebooting the VM alone will not suffice to complete this change; the host must be rebooted in order to fully reinitialise the networking card.

When ATS is enabled on the NIC, the Address Translation Service capability should show `Enable+` in `lspci` output:

```bash
1a:00.0 Infiniband controller: Mellanox Technologies MT2910 Family [ConnectX-7]
        Subsystem: Mellanox Technologies MT2910 Family [ConnectX-7]
...
        Capabilities: [480 v1] Address Translation Service (ATS)
                ATSCap: Invalidate Queue Depth: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
        Kernel driver in use: mlx5_core
        Kernel modules: mlx5_core
```

Alternately, check the status on all NVIDIA NICs in the system using the following command:

```bash
sudo lspci -d 15b3: -vvv | grep ATSCtl
```

```bash
user@hgx1:~$ sudo lspci -d 15b3: -vvv | grep ATSCtl
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
                ATSCtl: Enable+, Smallest Translation Unit: 00
```

### Configuring ACS

The following ACS settings should be configured on PCIe root ports and switch downstream ports to allow use of ATS by NICs:

* SrcValid (Source Validation) - enabled
* TransBlk (Translation Blocking) - disabled
* ReqRedir (P2P Request Redirection) - enabled
* CmpltRedir (P2P Completion Redirection) - enabled
* UpstreamFwd (Upstream Forwarding) - enabled
* EgressCtrl (Egress Control) - disabled
* DirectTrans (Direct Translated P2P) - enabled

These settings are exposed in the ACS Capability:

```bash
sudo lspci -vvv | less
```

```bash
...
17:00.0 PCI bridge: Broadcom / LSI PEX890xx PCIe Gen 5 Switch (rev b0) (prog-if 00 [Normal decode])
...
        Capabilities: [170 v1] Access Control Services
        ACSCap: SrcValid+ TransBlk+ ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans+
        ACSCtl: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans-
        Capabilities: [1f0 v1] Advanced Error Reporting
...
```

These ACS settings are applied on the virtualization host, not in guest VMs. The following script should be run each time the system is powered on or rebooted, as these settings are not retained across resets / reboots:

```bash
#!/bin/bash
#
# Copyright (c) 2020, NVIDIA Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
#
# Enable P2P specific ACS bits on every device that supports it

PLATFORM=$(dmidecode --string system-product-name)
logger "PLATFORM=${PLATFORM}"

# must be root to access extended PCI config space
if [ "$EUID" -ne 0 ]; then
echo "ERROR: $0 must be run as root"
exit 1
fi

for BDF in `lspci -d "*:*:*" | awk '{print $1}'`; do

    # skip if it doesn't support ACS
    setpci -v -s ${BDF} ECAP_ACS+0x6.w > /dev/null 2>&1
    if [ $? -ne 0 ]; then
        # echo "${BDF} does not support ACS, skipping"
        continue
    fi

    logger "Enabling ACS on `lspci -s ${BDF}`"q
    setpci -v -s ${BDF} ECAP_ACS+0x6.w
    setpci -v -s ${BDF} ECAP_ACS+0x6.w=0x5D
    setpci -v -s ${BDF} ECAP_ACS+0x6.w
    if [ $? -ne 0 ]; then
        logger "Error enabling ACS on ${BDF}"
        continue
    fi
    NEW_VAL=`setpci -v -s ${BDF} ECAP_ACS+0x6.w | awk '{print $NF}'`
    if [ "${NEW_VAL}" != "0x5D" ]; then
        logger "Failed to Enable ACS on ${BDF}"
        continue
    fi
done
exit 0
```

## Example physical topology map for HGX H200 8-GPU platform

Output from `lstopo -sv` command run on the vGPU host:

```bash
Machine (2015GB total)
Package L#0
    NUMANode L#0 (P#0 1007GB)
    L3 L#0 (105MB)
    L2 L#0 (2048KB) + L1d L#0 (48KB) + L1i L#0 (32KB) + Core L#0 + PU L#0 (P#0)
    L2 L#1 (2048KB) + L1d L#1 (48KB) + L1i L#1 (32KB) + Core L#1 + PU L#1 (P#2)
    L2 L#2 (2048KB) + L1d L#2 (48KB) + L1i L#2 (32KB) + Core L#2 + PU L#2 (P#4)
    L2 L#3 (2048KB) + L1d L#3 (48KB) + L1i L#3 (32KB) + Core L#3 + PU L#3 (P#6)
    L2 L#4 (2048KB) + L1d L#4 (48KB) + L1i L#4 (32KB) + Core L#4 + PU L#4 (P#8)
    L2 L#5 (2048KB) + L1d L#5 (48KB) + L1i L#5 (32KB) + Core L#5 + PU L#5 (P#10)
    L2 L#6 (2048KB) + L1d L#6 (48KB) + L1i L#6 (32KB) + Core L#6 + PU L#6 (P#12)
    L2 L#7 (2048KB) + L1d L#7 (48KB) + L1i L#7 (32KB) + Core L#7 + PU L#7 (P#14)
    L2 L#8 (2048KB) + L1d L#8 (48KB) + L1i L#8 (32KB) + Core L#8 + PU L#8 (P#16)
    L2 L#9 (2048KB) + L1d L#9 (48KB) + L1i L#9 (32KB) + Core L#9 + PU L#9 (P#18)
    L2 L#10 (2048KB) + L1d L#10 (48KB) + L1i L#10 (32KB) + Core L#10 + PU L#10 (P#20)
    L2 L#11 (2048KB) + L1d L#11 (48KB) + L1i L#11 (32KB) + Core L#11 + PU L#11 (P#22)
    L2 L#12 (2048KB) + L1d L#12 (48KB) + L1i L#12 (32KB) + Core L#12 + PU L#12 (P#24)
    L2 L#13 (2048KB) + L1d L#13 (48KB) + L1i L#13 (32KB) + Core L#13 + PU L#13 (P#26)
    L2 L#14 (2048KB) + L1d L#14 (48KB) + L1i L#14 (32KB) + Core L#14 + PU L#14 (P#28)
    L2 L#15 (2048KB) + L1d L#15 (48KB) + L1i L#15 (32KB) + Core L#15 + PU L#15 (P#30)
    L2 L#16 (2048KB) + L1d L#16 (48KB) + L1i L#16 (32KB) + Core L#16 + PU L#16 (P#32)
    L2 L#17 (2048KB) + L1d L#17 (48KB) + L1i L#17 (32KB) + Core L#17 + PU L#17 (P#34)
    L2 L#18 (2048KB) + L1d L#18 (48KB) + L1i L#18 (32KB) + Core L#18 + PU L#18 (P#36)
    L2 L#19 (2048KB) + L1d L#19 (48KB) + L1i L#19 (32KB) + Core L#19 + PU L#19 (P#38)
    L2 L#20 (2048KB) + L1d L#20 (48KB) + L1i L#20 (32KB) + Core L#20 + PU L#20 (P#40)
    L2 L#21 (2048KB) + L1d L#21 (48KB) + L1i L#21 (32KB) + Core L#21 + PU L#21 (P#42)
    L2 L#22 (2048KB) + L1d L#22 (48KB) + L1i L#22 (32KB) + Core L#22 + PU L#22 (P#44)
    L2 L#23 (2048KB) + L1d L#23 (48KB) + L1i L#23 (32KB) + Core L#23 + PU L#23 (P#46)
    L2 L#24 (2048KB) + L1d L#24 (48KB) + L1i L#24 (32KB) + Core L#24 + PU L#24 (P#48)
    L2 L#25 (2048KB) + L1d L#25 (48KB) + L1i L#25 (32KB) + Core L#25 + PU L#25 (P#50)
    L2 L#26 (2048KB) + L1d L#26 (48KB) + L1i L#26 (32KB) + Core L#26 + PU L#26 (P#52)
    L2 L#27 (2048KB) + L1d L#27 (48KB) + L1i L#27 (32KB) + Core L#27 + PU L#27 (P#54)
    L2 L#28 (2048KB) + L1d L#28 (48KB) + L1i L#28 (32KB) + Core L#28 + PU L#28 (P#56)
    L2 L#29 (2048KB) + L1d L#29 (48KB) + L1i L#29 (32KB) + Core L#29 + PU L#29 (P#58)
    L2 L#30 (2048KB) + L1d L#30 (48KB) + L1i L#30 (32KB) + Core L#30 + PU L#30 (P#60)
    L2 L#31 (2048KB) + L1d L#31 (48KB) + L1i L#31 (32KB) + Core L#31 + PU L#31 (P#62)
    L2 L#32 (2048KB) + L1d L#32 (48KB) + L1i L#32 (32KB) + Core L#32 + PU L#32 (P#64)
    L2 L#33 (2048KB) + L1d L#33 (48KB) + L1i L#33 (32KB) + Core L#33 + PU L#33 (P#66)
    L2 L#34 (2048KB) + L1d L#34 (48KB) + L1i L#34 (32KB) + Core L#34 + PU L#34 (P#68)
    L2 L#35 (2048KB) + L1d L#35 (48KB) + L1i L#35 (32KB) + Core L#35 + PU L#35 (P#70)
    L2 L#36 (2048KB) + L1d L#36 (48KB) + L1i L#36 (32KB) + Core L#36 + PU L#36 (P#72)
    L2 L#37 (2048KB) + L1d L#37 (48KB) + L1i L#37 (32KB) + Core L#37 + PU L#37 (P#74)
    L2 L#38 (2048KB) + L1d L#38 (48KB) + L1i L#38 (32KB) + Core L#38 + PU L#38 (P#76)
    L2 L#39 (2048KB) + L1d L#39 (48KB) + L1i L#39 (32KB) + Core L#39 + PU L#39 (P#78)
    L2 L#40 (2048KB) + L1d L#40 (48KB) + L1i L#40 (32KB) + Core L#40 + PU L#40 (P#80)
    L2 L#41 (2048KB) + L1d L#41 (48KB) + L1i L#41 (32KB) + Core L#41 + PU L#41 (P#82)
    L2 L#42 (2048KB) + L1d L#42 (48KB) + L1i L#42 (32KB) + Core L#42 + PU L#42 (P#84)
    L2 L#43 (2048KB) + L1d L#43 (48KB) + L1i L#43 (32KB) + Core L#43 + PU L#43 (P#86)
    L2 L#44 (2048KB) + L1d L#44 (48KB) + L1i L#44 (32KB) + Core L#44 + PU L#44 (P#88)
    L2 L#45 (2048KB) + L1d L#45 (48KB) + L1i L#45 (32KB) + Core L#45 + PU L#45 (P#90)
    L2 L#46 (2048KB) + L1d L#46 (48KB) + L1i L#46 (32KB) + Core L#46 + PU L#46 (P#92)
    L2 L#47 (2048KB) + L1d L#47 (48KB) + L1i L#47 (32KB) + Core L#47 + PU L#47 (P#94)
    HostBridge
    PCIBridge
        PCI 01:00.0 (NVMExp)
        Block(Disk) "nvme0c0n1"
    PCIBridge
        PCI 02:00.0 (Ethernet)
        Net "eno8303"
        PCI 02:00.1 (Ethernet)
        Net "eno8403"
    PCIBridge
        PCIBridge
        PCI 04:00.0 (VGA)
    PCI 00:18.0 (SATA)
    PCI 00:19.0 (SATA)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI 18:00.0 (NVMExp)
            Block(Disk) "nvme1n1"
        PCIBridge
            PCI 19:00.0 (3D)
        PCIBridge
            PCI 1a:00.0 (InfiniBand)
            OpenFabrics "mlx5_0"
        PCIBridge
            PCI 1c:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI 3a:00.0 (NVMExp)
            Block(Disk) "nvme2n1"
        PCIBridge
            PCI 3b:00.0 (3D)
        PCIBridge
            PCI 3c:00.0 (InfiniBand)
            OpenFabrics "mlx5_1"
        PCIBridge
            PCI 3d:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI 4c:00.0 (3D)
        PCIBridge
            PCI 4d:00.0 (InfiniBand)
            OpenFabrics "mlx5_2"
        PCIBridge
            PCI 4e:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI 5d:00.0 (3D)
        PCIBridge
            PCI 5e:00.0 (InfiniBand)
            OpenFabrics "mlx5_3"
        PCIBridge
            PCI 5f:00.0 (SAS)
Package L#1
    NUMANode L#1 (P#1 1008GB)
    L3 L#1 (105MB)
    L2 L#48 (2048KB) + L1d L#48 (48KB) + L1i L#48 (32KB) + Core L#48 + PU L#48 (P#1)
    L2 L#49 (2048KB) + L1d L#49 (48KB) + L1i L#49 (32KB) + Core L#49 + PU L#49 (P#3)
    L2 L#50 (2048KB) + L1d L#50 (48KB) + L1i L#50 (32KB) + Core L#50 + PU L#50 (P#5)
    L2 L#51 (2048KB) + L1d L#51 (48KB) + L1i L#51 (32KB) + Core L#51 + PU L#51 (P#7)
    L2 L#52 (2048KB) + L1d L#52 (48KB) + L1i L#52 (32KB) + Core L#52 + PU L#52 (P#9)
    L2 L#53 (2048KB) + L1d L#53 (48KB) + L1i L#53 (32KB) + Core L#53 + PU L#53 (P#11)
    L2 L#54 (2048KB) + L1d L#54 (48KB) + L1i L#54 (32KB) + Core L#54 + PU L#54 (P#13)
    L2 L#55 (2048KB) + L1d L#55 (48KB) + L1i L#55 (32KB) + Core L#55 + PU L#55 (P#15)
    L2 L#56 (2048KB) + L1d L#56 (48KB) + L1i L#56 (32KB) + Core L#56 + PU L#56 (P#17)
    L2 L#57 (2048KB) + L1d L#57 (48KB) + L1i L#57 (32KB) + Core L#57 + PU L#57 (P#19)
    L2 L#58 (2048KB) + L1d L#58 (48KB) + L1i L#58 (32KB) + Core L#58 + PU L#58 (P#21)
    L2 L#59 (2048KB) + L1d L#59 (48KB) + L1i L#59 (32KB) + Core L#59 + PU L#59 (P#23)
    L2 L#60 (2048KB) + L1d L#60 (48KB) + L1i L#60 (32KB) + Core L#60 + PU L#60 (P#25)
    L2 L#61 (2048KB) + L1d L#61 (48KB) + L1i L#61 (32KB) + Core L#61 + PU L#61 (P#27)
    L2 L#62 (2048KB) + L1d L#62 (48KB) + L1i L#62 (32KB) + Core L#62 + PU L#62 (P#29)
    L2 L#63 (2048KB) + L1d L#63 (48KB) + L1i L#63 (32KB) + Core L#63 + PU L#63 (P#31)
    L2 L#64 (2048KB) + L1d L#64 (48KB) + L1i L#64 (32KB) + Core L#64 + PU L#64 (P#33)
    L2 L#65 (2048KB) + L1d L#65 (48KB) + L1i L#65 (32KB) + Core L#65 + PU L#65 (P#35)
    L2 L#66 (2048KB) + L1d L#66 (48KB) + L1i L#66 (32KB) + Core L#66 + PU L#66 (P#37)
    L2 L#67 (2048KB) + L1d L#67 (48KB) + L1i L#67 (32KB) + Core L#67 + PU L#67 (P#39)
    L2 L#68 (2048KB) + L1d L#68 (48KB) + L1i L#68 (32KB) + Core L#68 + PU L#68 (P#41)
    L2 L#69 (2048KB) + L1d L#69 (48KB) + L1i L#69 (32KB) + Core L#69 + PU L#69 (P#43)
    L2 L#70 (2048KB) + L1d L#70 (48KB) + L1i L#70 (32KB) + Core L#70 + PU L#70 (P#45)
    L2 L#71 (2048KB) + L1d L#71 (48KB) + L1i L#71 (32KB) + Core L#71 + PU L#71 (P#47)
    L2 L#72 (2048KB) + L1d L#72 (48KB) + L1i L#72 (32KB) + Core L#72 + PU L#72 (P#49)
    L2 L#73 (2048KB) + L1d L#73 (48KB) + L1i L#73 (32KB) + Core L#73 + PU L#73 (P#51)
    L2 L#74 (2048KB) + L1d L#74 (48KB) + L1i L#74 (32KB) + Core L#74 + PU L#74 (P#53)
    L2 L#75 (2048KB) + L1d L#75 (48KB) + L1i L#75 (32KB) + Core L#75 + PU L#75 (P#55)
    L2 L#76 (2048KB) + L1d L#76 (48KB) + L1i L#76 (32KB) + Core L#76 + PU L#76 (P#57)
    L2 L#77 (2048KB) + L1d L#77 (48KB) + L1i L#77 (32KB) + Core L#77 + PU L#77 (P#59)
    L2 L#78 (2048KB) + L1d L#78 (48KB) + L1i L#78 (32KB) + Core L#78 + PU L#78 (P#61)
    L2 L#79 (2048KB) + L1d L#79 (48KB) + L1i L#79 (32KB) + Core L#79 + PU L#79 (P#63)
    L2 L#80 (2048KB) + L1d L#80 (48KB) + L1i L#80 (32KB) + Core L#80 + PU L#80 (P#65)
    L2 L#81 (2048KB) + L1d L#81 (48KB) + L1i L#81 (32KB) + Core L#81 + PU L#81 (P#67)
    L2 L#82 (2048KB) + L1d L#82 (48KB) + L1i L#82 (32KB) + Core L#82 + PU L#82 (P#69)
    L2 L#83 (2048KB) + L1d L#83 (48KB) + L1i L#83 (32KB) + Core L#83 + PU L#83 (P#71)
    L2 L#84 (2048KB) + L1d L#84 (48KB) + L1i L#84 (32KB) + Core L#84 + PU L#84 (P#73)
    L2 L#85 (2048KB) + L1d L#85 (48KB) + L1i L#85 (32KB) + Core L#85 + PU L#85 (P#75)
    L2 L#86 (2048KB) + L1d L#86 (48KB) + L1i L#86 (32KB) + Core L#86 + PU L#86 (P#77)
    L2 L#87 (2048KB) + L1d L#87 (48KB) + L1i L#87 (32KB) + Core L#87 + PU L#87 (P#79)
    L2 L#88 (2048KB) + L1d L#88 (48KB) + L1i L#88 (32KB) + Core L#88 + PU L#88 (P#81)
    L2 L#89 (2048KB) + L1d L#89 (48KB) + L1i L#89 (32KB) + Core L#89 + PU L#89 (P#83)
    L2 L#90 (2048KB) + L1d L#90 (48KB) + L1i L#90 (32KB) + Core L#90 + PU L#90 (P#85)
    L2 L#91 (2048KB) + L1d L#91 (48KB) + L1i L#91 (32KB) + Core L#91 + PU L#91 (P#87)
    L2 L#92 (2048KB) + L1d L#92 (48KB) + L1i L#92 (32KB) + Core L#92 + PU L#92 (P#89)
    L2 L#93 (2048KB) + L1d L#93 (48KB) + L1i L#93 (32KB) + Core L#93 + PU L#93 (P#91)
    L2 L#94 (2048KB) + L1d L#94 (48KB) + L1i L#94 (32KB) + Core L#94 + PU L#94 (P#93)
    L2 L#95 (2048KB) + L1d L#95 (48KB) + L1i L#95 (32KB) + Core L#95 + PU L#95 (P#95)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI 9b:00.0 (3D)
        PCIBridge
            PCI 9c:00.0 (InfiniBand)
            OpenFabrics "mlx5_4"
        PCIBridge
            PCI 9e:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI bb:00.0 (3D)
        PCIBridge
            PCI bc:00.0 (InfiniBand)
            OpenFabrics "mlx5_5"
        PCIBridge
            PCI bd:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI cb:00.0 (3D)
        PCIBridge
            PCI cc:00.0 (InfiniBand)
            OpenFabrics "mlx5_6"
        PCIBridge
            PCI cd:00.0 (SAS)
    HostBridge
    PCIBridge
        PCIBridge
        PCIBridge
            PCI db:00.0 (3D)
        PCIBridge
            PCI dc:00.0 (InfiniBand)
            OpenFabrics "mlx5_7"
        PCIBridge
            PCI dd:00.0 (SAS)
```

## Example libvirt domain XML for HGX H200 8-GPU platform

Reference: [libvirt: Domain XML format](https://libvirt.org/formatdomain.html)

This sample XML created on Ubuntu 22.04 is for the VM configured on the following physical topology, with the PCIe devices highlighted in green boxes passed through to the VM.

![](/ai-enterprise/planning-resource/_fern-files/_img/e58ab61251fc66987de6eb54464aaad1869be50aeaa8216fcf0060080701271d.webp)

The VM is configured with 88 vCPUs arranged in two sockets, each with 44 cores. Each socket implements a single NUMA node with approximately 1TB of RAM. The virtual PCIe hierarchy is equivalent to the physical topology, with 4 PCIe switches on CPU socket 0 and 5 PCIe switches on CPU socket 1.

```xml
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>ubuntu-vm-numa0</name>
<uuid>ea260ed6-8344-49fc-952c-ec6c3de1364e</uuid>
<metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
    <libosinfo:os id="http://ubuntu.com/ubuntu/22.04"/>
    </libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>1887436800</memory>
<currentMemory unit='KiB'>1887436800</currentMemory>
<vcpu placement='static'>88</vcpu>
<cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='6'/>
    <vcpupin vcpu='2' cpuset='8'/>
    <vcpupin vcpu='3' cpuset='10'/>
    <vcpupin vcpu='4' cpuset='12'/>
    <vcpupin vcpu='5' cpuset='14'/>
    <vcpupin vcpu='6' cpuset='16'/>
    <vcpupin vcpu='7' cpuset='18'/>
    <vcpupin vcpu='8' cpuset='20'/>
    <vcpupin vcpu='9' cpuset='22'/>
    <vcpupin vcpu='10' cpuset='24'/>
    <vcpupin vcpu='11' cpuset='26'/>
    <vcpupin vcpu='12' cpuset='28'/>
    <vcpupin vcpu='13' cpuset='30'/>
    <vcpupin vcpu='14' cpuset='32'/>
    <vcpupin vcpu='15' cpuset='34'/>
    <vcpupin vcpu='16' cpuset='36'/>
    <vcpupin vcpu='17' cpuset='38'/>
    <vcpupin vcpu='18' cpuset='40'/>
    <vcpupin vcpu='19' cpuset='42'/>
    <vcpupin vcpu='20' cpuset='44'/>
    <vcpupin vcpu='21' cpuset='46'/>
    <vcpupin vcpu='22' cpuset='48'/>
    <vcpupin vcpu='23' cpuset='50'/>
    <vcpupin vcpu='24' cpuset='52'/>
    <vcpupin vcpu='25' cpuset='54'/>
    <vcpupin vcpu='26' cpuset='56'/>
    <vcpupin vcpu='27' cpuset='58'/>
    <vcpupin vcpu='28' cpuset='60'/>
    <vcpupin vcpu='29' cpuset='62'/>
    <vcpupin vcpu='30' cpuset='64'/>
    <vcpupin vcpu='31' cpuset='66'/>
    <vcpupin vcpu='32' cpuset='68'/>
    <vcpupin vcpu='33' cpuset='70'/>
    <vcpupin vcpu='34' cpuset='72'/>
    <vcpupin vcpu='35' cpuset='74'/>
    <vcpupin vcpu='36' cpuset='76'/>
    <vcpupin vcpu='37' cpuset='78'/>
    <vcpupin vcpu='38' cpuset='80'/>
    <vcpupin vcpu='39' cpuset='82'/>
    <vcpupin vcpu='40' cpuset='84'/>
    <vcpupin vcpu='41' cpuset='86'/>
    <vcpupin vcpu='42' cpuset='88'/>
    <vcpupin vcpu='43' cpuset='90'/>
    <vcpupin vcpu='44' cpuset='5'/>
    <vcpupin vcpu='45' cpuset='7'/>
    <vcpupin vcpu='46' cpuset='9'/>
    <vcpupin vcpu='47' cpuset='11'/>
    <vcpupin vcpu='48' cpuset='13'/>
    <vcpupin vcpu='49' cpuset='15'/>
    <vcpupin vcpu='50' cpuset='17'/>
    <vcpupin vcpu='51' cpuset='19'/>
    <vcpupin vcpu='52' cpuset='21'/>
    <vcpupin vcpu='53' cpuset='23'/>
    <vcpupin vcpu='54' cpuset='25'/>
    <vcpupin vcpu='55' cpuset='27'/>
    <vcpupin vcpu='56' cpuset='29'/>
    <vcpupin vcpu='57' cpuset='31'/>
    <vcpupin vcpu='58' cpuset='33'/>
    <vcpupin vcpu='59' cpuset='35'/>
    <vcpupin vcpu='60' cpuset='37'/>
    <vcpupin vcpu='61' cpuset='39'/>
    <vcpupin vcpu='62' cpuset='41'/>
    <vcpupin vcpu='63' cpuset='43'/>
    <vcpupin vcpu='64' cpuset='45'/>
    <vcpupin vcpu='65' cpuset='47'/>
    <vcpupin vcpu='66' cpuset='49'/>
    <vcpupin vcpu='67' cpuset='51'/>
    <vcpupin vcpu='68' cpuset='53'/>
    <vcpupin vcpu='69' cpuset='55'/>
    <vcpupin vcpu='70' cpuset='57'/>
    <vcpupin vcpu='71' cpuset='59'/>
    <vcpupin vcpu='72' cpuset='61'/>
    <vcpupin vcpu='73' cpuset='63'/>
    <vcpupin vcpu='74' cpuset='65'/>
    <vcpupin vcpu='75' cpuset='67'/>
    <vcpupin vcpu='76' cpuset='69'/>
    <vcpupin vcpu='77' cpuset='71'/>
    <vcpupin vcpu='78' cpuset='73'/>
    <vcpupin vcpu='79' cpuset='75'/>
    <vcpupin vcpu='80' cpuset='77'/>
    <vcpupin vcpu='81' cpuset='79'/>
    <vcpupin vcpu='82' cpuset='81'/>
    <vcpupin vcpu='83' cpuset='83'/>
    <vcpupin vcpu='84' cpuset='85'/>
    <vcpupin vcpu='85' cpuset='87'/>
    <vcpupin vcpu='86' cpuset='89'/>
    <vcpupin vcpu='87' cpuset='91'/>
</cputune>
<resource>
    <partition>/machine</partition>
</resource>
<os>
    <type arch='x86_64' machine='pc-q35-6.2'>hvm</type>
    <loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE_4M.ms.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/ubuntu-vm-numa0_VARS.fd</nvram>
    <boot dev='hd'/>
    <smbios mode='host'/>
</os>
<features>
    <acpi/>
    <apic/>
</features>
<cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='2' dies='1' cores='44' threads='1'/>
    <numa>
    <cell id='0' cpus='0-43' memory='943718400' unit='KiB'/>
    <cell id='1' cpus='44-87' memory='943718400' unit='KiB'/>
    </numa>
</cpu>
<numatune>
    <memory mode='strict' nodeset='0-1'/>
</numatune>
<clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
</pm>
<devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
    <driver name='qemu' type='qcow2' discard='unmap'/>
    <source file='/var/lib/libvirt/images/ubuntu-vm-numa0.qcow2'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
    <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='1' port='0x10'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='2' port='0x11'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='3' port='0x12'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='4' port='0x13'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='5' port='0x14'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='6' port='0x15'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='7' port='0x16'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='pci' index='8' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='8' port='0x17'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/>
    </controller>
    <controller type='pci' index='9' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='9' port='0x18'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='10' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='10' port='0x19'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
    </controller>
    <controller type='pci' index='11' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='11' port='0x1a'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
    </controller>
    <controller type='pci' index='12' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='12' port='0x1b'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/>
    </controller>
    <controller type='pci' index='13' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='13' port='0x1c'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/>
    </controller>
    <controller type='pci' index='14' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='14' port='0x1d'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/>
    </controller>

    <!-- PCI expander bus NUMA node 0 -->
    <controller type='pci' index='15' model='pcie-expander-bus'>
    <target busNr='0x20'>
        <node>0</node>
    </target>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x6'/>
    </controller>

    <!-- PCI expander bus NUMA node 1 -->
    <controller type='pci' index='16' model='pcie-expander-bus'>
    <target busNr='0x40'>
        <node>1</node>
    </target>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x7'/>
    </controller>

    <!-- 4 root ports on bus 15 (index of upstream expander bus) NUMA node 0 -->

    <controller type='pci' index='17' model='pcie-root-port'>
    <address type='pci' bus='15' slot='0x00' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='18' model='pcie-root-port'>
    <address type='pci' bus='15' slot='0x00' function='0x1'/>
    </controller>
    <controller type='pci' index='19' model='pcie-root-port'>
    <address type='pci' bus='15' slot='0x00' function='0x2'/>
    </controller>
    <controller type='pci' index='20' model='pcie-root-port'>
    <address type='pci' bus='15' slot='0x00' function='0x3'/>
    </controller>

    <!-- 4 port PCIe switch on bus 17 (index of upstream root port) / func 0 -->
    <controller type='pci' index='21' model='pcie-switch-upstream-port'>
    <address type='pci' bus='17' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='22' model='pcie-switch-downstream-port'>
    <address type='pci' bus='21' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='23' model='pcie-switch-downstream-port'>
    <address type='pci' bus='21' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='24' model='pcie-switch-downstream-port'>
    <address type='pci' bus='21' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='25' model='pcie-switch-downstream-port'>
    <address type='pci' bus='21' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 18 (index of upstream root port) / func 1 -->
    <controller type='pci' index='26' model='pcie-switch-upstream-port'>
    <address type='pci' bus='18' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='27' model='pcie-switch-downstream-port'>
    <address type='pci' bus='26' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='28' model='pcie-switch-downstream-port'>
    <address type='pci' bus='26' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='29' model='pcie-switch-downstream-port'>
    <address type='pci' bus='26' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='30' model='pcie-switch-downstream-port'>
    <address type='pci' bus='26' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 19 (index of upstream root port) / func 2 -->
    <controller type='pci' index='31' model='pcie-switch-upstream-port'>
    <address type='pci' bus='19' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='32' model='pcie-switch-downstream-port'>
    <address type='pci' bus='31' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='33' model='pcie-switch-downstream-port'>
    <address type='pci' bus='31' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='34' model='pcie-switch-downstream-port'>
    <address type='pci' bus='31' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='35' model='pcie-switch-downstream-port'>
    <address type='pci' bus='31' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 20 (index of upstream root port) / func 3 -->
    <controller type='pci' index='36' model='pcie-switch-upstream-port'>
    <address type='pci' bus='20' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='37' model='pcie-switch-downstream-port'>
    <address type='pci' bus='36' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='38' model='pcie-switch-downstream-port'>
    <address type='pci' bus='36' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='39' model='pcie-switch-downstream-port'>
    <address type='pci' bus='36' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='40' model='pcie-switch-downstream-port'>
    <address type='pci' bus='36' slot='0x03' function='0x0'/>
    </controller>

    <!-- 5 root ports on bus 16 (index of upstream expander bus) NUMA node 1 -->

    <controller type='pci' index='41' model='pcie-root-port'>
    <address type='pci' bus='16' slot='0x00' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='42' model='pcie-root-port'>
    <address type='pci' bus='16' slot='0x00' function='0x1'/>
    </controller>
    <controller type='pci' index='43' model='pcie-root-port'>
    <address type='pci' bus='16' slot='0x00' function='0x2'/>
    </controller>
    <controller type='pci' index='44' model='pcie-root-port'>
    <address type='pci' bus='16' slot='0x00' function='0x3'/>
    </controller>
    <controller type='pci' index='45' model='pcie-root-port'>
    <address type='pci' bus='16' slot='0x00' function='0x4'/>
    </controller>

    <!-- 4 port PCIe switch on bus 41 (index of upstream root port) / func 0 -->
    <controller type='pci' index='46' model='pcie-switch-upstream-port'>
    <address type='pci' bus='41' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='47' model='pcie-switch-downstream-port'>
    <address type='pci' bus='46' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='48' model='pcie-switch-downstream-port'>
    <address type='pci' bus='46' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='49' model='pcie-switch-downstream-port'>
    <address type='pci' bus='46' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='50' model='pcie-switch-downstream-port'>
    <address type='pci' bus='46' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 42 (index of upstream root port) / func 1 -->
    <controller type='pci' index='51' model='pcie-switch-upstream-port'>
    <address type='pci' bus='42' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='52' model='pcie-switch-downstream-port'>
    <address type='pci' bus='51' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='53' model='pcie-switch-downstream-port'>
    <address type='pci' bus='51' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='54' model='pcie-switch-downstream-port'>
    <address type='pci' bus='51' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='55' model='pcie-switch-downstream-port'>
    <address type='pci' bus='51' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 43 (index of upstream root port) / func 2 -->
    <controller type='pci' index='56' model='pcie-switch-upstream-port'>
    <address type='pci' bus='43' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='57' model='pcie-switch-downstream-port'>
    <address type='pci' bus='56' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='58' model='pcie-switch-downstream-port'>
    <address type='pci' bus='56' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='59' model='pcie-switch-downstream-port'>
    <address type='pci' bus='56' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='60' model='pcie-switch-downstream-port'>
    <address type='pci' bus='56' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 44 (index of upstream root port) / func 3 -->
    <controller type='pci' index='61' model='pcie-switch-upstream-port'>
    <address type='pci' bus='44' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='62' model='pcie-switch-downstream-port'>
    <address type='pci' bus='61' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='63' model='pcie-switch-downstream-port'>
    <address type='pci' bus='61' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='64' model='pcie-switch-downstream-port'>
    <address type='pci' bus='61' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='65' model='pcie-switch-downstream-port'>
    <address type='pci' bus='61' slot='0x03' function='0x0'/>
    </controller>

    <!-- 4 port PCIe switch on bus 45 (index of upstream root port) / func 4 -->
    <controller type='pci' index='66' model='pcie-switch-upstream-port'>
    <address type='pci' bus='45' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='67' model='pcie-switch-downstream-port'>
    <address type='pci' bus='66' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='68' model='pcie-switch-downstream-port'>
    <address type='pci' bus='66' slot='0x01' function='0x0'/>
    </controller>
    <controller type='pci' index='69' model='pcie-switch-downstream-port'>
    <address type='pci' bus='66' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='70' model='pcie-switch-downstream-port'>
    <address type='pci' bus='66' slot='0x03' function='0x0'/>
    </controller>

    <controller type='sata' index='0'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </controller>
    <interface type='bridge'>
    <mac address='52:54:00:e2:a3:d9'/>
    <source bridge='br0'/>
    <model type='virtio'/>
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
    <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
    </target>
    </serial>
    <console type='pty'>
    <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
    <target type='virtio' name='org.qemu.guest_agent.0'/>
    <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
    <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='usb'>
    <address type='usb' bus='0' port='2'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
    <listen type='address'/>
    <image compression='off'/>
    </graphics>
    <audio id='1' type='spice'/>
    <video>
    <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

    <!-- GPUs, NICs, NVMe on socket 0 -->

    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x18' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='22' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x19' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='23' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x1a' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='24' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x3b' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='27' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x3c' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='28' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x4c' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='32' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x4d' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='33' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x5d' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='37' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x5e' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='38' slot='0x00' function='0x0'/>
    </hostdev>

    <!-- GPUs, NICs on socket 1 -->

    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x9b' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='52' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x9c' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='53' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0xbb' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='57' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0xbc' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='58' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0xcb' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='62' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0xcc' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='63' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0xdb' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='67' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0xdc' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='68' slot='0x00' function='0x0'/>
    </hostdev>

    <!-- NVswitches socket 1 -->

    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x83' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='47' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x84' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='48' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x85' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='49' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
        <address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='50' slot='0x00' function='0x0'/>
    </hostdev>

    <memballoon model='virtio'>
    <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </memballoon>
    <rng model='virtio'>
    <backend model='random'>/dev/urandom</backend>
    <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </rng>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'/>
<qemu:commandline>
    <qemu:arg value='-fw_cfg'/>
    <qemu:arg value='opt/ovmf/X-PciMmio64Mb,string=4718592'/>
</qemu:commandline>
</domain>
```

## NCCL

[NCCL](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/overview.html) (NVIDIA Collective Communication Library) is a communication layer widely used in distributed AI/ML training. It provides efficient, multi-GPU and multi-node collective operations (like all-reduce, all-gather, reduce-broadcast) that form the basis for training algorithms for large-scale deep learning models. NCCL offers a [library of routines](https://developer.nvidia.com/nccl) optimized for GPU-to-GPU communication and abstracts complexity from AI frameworks (e.g. TensorFlow, PyTorch). These routines take advantage of the underlying topology to minimize latency and maximize bandwidth utilization \[2].

Topological awareness is a prerequisite for running NCCL. If the hypervisor obscures the physical hardware topology within a VM, NCCL will create suboptimal communication paths. This can introduce additional overhead and reduce overall effective bandwidth. For multi-node HGX server systems designed to handle distributed training or foundation model training workloads, sub-optimal NCCL performance directly translates to wasted GPU cycles, longer training durations, and reduced overall efficiency.

It is imperative that the VM NUMA and PCIe hierarchy mirrors the underlying physical topology so that NCCL can detect and utilize the correct GPU, NIC, and NUMA relationships. This ensures that the overall performance of NCCL-based applications in a virtualized environment approaches bare metal.