Linux Virtualisation for AI Infrastructure

Linux Virtualisation and Virtual Networking for AI Infrastructure

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / PART 02

Linux Virtualisation and Virtual Networking for AI Infrastructure

From KVM and QEMU to GPU passthrough and high-performance virtual networks

Engineering the boundary between physical hardware and the workloads that consume it.

THE VIRTUALISED AI PLATFORMGuest VM AGuest VM BQEMU device model / KVM executionLinux host kernelCPU / RAMNVMeNICGPUGuest Linux · AI servicesGuest Linux · model servingVirtual CPUs · VirtIO · virtual devicesScheduler · memory · bridge / OVS · VFIOComputeStorageNetworkAcceleratorOptional dedicated GPU assignment

Blue paths represent conceptual host-mediated resource access; the gold path represents optional device assignment through VFIO and IOMMU protection, not an unrestricted physical bypass.

Why virtualisation matters for private AI

A physical AI server provides compute, memory, storage and accelerators. A production platform must also decide how these resources are allocated, isolated and recovered. Virtualisation introduces a machine-level abstraction: a guest operating system sees virtual processors, memory and devices while the host controls the underlying resources. This enables independent operating system lifecycles and workload separation, but introduces scheduling, I/O and operational trade-offs.

KVM exposes hardware-assisted virtualisation through the Linux kernel. QEMU provides the virtual machine process and device model, using KVM acceleration when configured. Guest vCPUs are host-scheduled threads; their performance depends on placement, contention and memory locality. A guest is not guaranteed exclusive access to a physical core simply because it has been assigned a vCPU.

VirtIO provides paravirtualised device interfaces that can reduce emulation overhead. Virtual network interfaces can connect to Linux bridges or Open vSwitch through TAP devices, with optional accelerated data paths. Network design still requires explicit addressing, VLAN policy, routing and security boundaries. Virtualisation alone does not establish a complete Zero Trust architecture.

GPU assignment changes the design. VFIO can expose a physical PCIe device to a guest while the IOMMU constrains device DMA to authorised mappings. Device grouping, firmware, driver compatibility, reset behaviour and host topology must be validated. Whole-device passthrough typically dedicates the assigned device to one guest; mediated or partitioned GPU sharing requires supported hardware and software and is a separate architecture.

The nine engineering chapters

01 · Architecture

Host, guest, hypervisor and resource isolation.

02 · KVM and QEMU

Hardware-assisted execution, VM exits and device models.

03 · CPU and memory

vCPU scheduling, NUMA locality and memory allocation.

04 · VirtIO

Queues, virtual disks, network I/O and acceleration.

05 · Linux networking

TAP, bridges, namespaces and packet forwarding.

06 · Open vSwitch

Flow classification, forwarding and network policy.

07 · PCIe and VFIO

IOMMU mappings, isolation groups and SR-IOV.

08 · GPU virtual machines

Device assignment, driver validation and AI workloads.

09 · Production platform

Deployment, monitoring, recovery and troubleshooting.

Engineering outcomes

By the end of this blog, readers should be able to explain a guest instruction journey, trace virtual network traffic, reason about NUMA placement, distinguish emulated and paravirtualised devices, evaluate GPU assignment constraints and design a virtualised AI host with measurable operational requirements. The accompanying simulators provide conceptual experiments before readers attempt changes on real infrastructure.

Original educational architecture illustration. Actual performance and device compatibility depend on the host, firmware, kernel, hypervisor and workload. Validate changes in a non-production environment. Legal and editorial standards.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / PAIES-VIRT-20 V2

Linux Virtualisation Engineering Roadmap

Explore nine engineering chapters, from hypervisor internals to production GPU-accelerated virtual machines. Select a circle to jump directly to its editorial section. Each chapter is followed by its companion interactive lab when installed.

Return to introduction

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 01 · PAIES-VIRT-02 V1

Linux Virtualisation and Hypervisor Architecture

From physical silicon to isolated AI execution environments: understanding the machine boundary before designing the platform.

Architecture atlas — the Linux virtual machine

Guest A
Linux · inference service · virtual CPU
Guest B
Linux · development · virtual CPU
QEMU userspace
Machine model · device emulation · management
Linux kernel + KVM
Guest execution · host scheduling · memory management
Physical platform
CPU virtualisation extensions · RAM · PCIe · NIC · GPU

Conceptual control and resource relationships. Ordinary guest CPU instructions need not pass through QEMU userspace.

01 — The machine abstraction

A virtual machine is not simply an application running inside another application. It exposes a machine interface to a guest operating system: processors, addressable memory, interrupts, timers and devices. The guest kernel manages its own processes while the host retains authority over physical resources. This distinction enables different kernel versions, independently managed operating systems and separate administrative domains on the same server.

For AI infrastructure, this is particularly useful when a model-serving environment requires a specific driver stack or when experimental workloads must be separated from production services. Virtualisation does not create additional physical compute capacity. It changes how capacity is presented, scheduled and governed. A design must therefore start with the actual CPU, memory, accelerator and network constraints.

02 — Type 1 and Type 2 hypervisors

Traditional Type 1 hypervisors execute directly on hardware, whereas Type 2 products rely on a general-purpose host operating system. Linux KVM complicates this simple taxonomy: KVM is a kernel subsystem that uses hardware virtualisation extensions, while QEMU provides the userspace machine model. KVM is commonly classified as Type 1 because guest execution is controlled by the kernel, but the complete Linux platform still includes host userspace services.

The engineering question is not the label alone. Identify which component schedules execution, handles device access, controls memory and exposes management interfaces. A compromised management service can undermine isolation regardless of the hypervisor classification.

03 — CPU privilege and hardware-assisted execution

Intel VT-x and AMD-V provide execution facilities that allow guest operating systems to run privileged code under hypervisor control. On Intel systems, VMX root and non-root operation are distinct from the ordinary x86 privilege rings. A guest kernel can execute at ring 0 in non-root operation without gaining the host kernel’s authority.

Most ordinary instructions can execute directly on the processor. Configured events such as selected privileged operations or certain interrupts can trigger a VM exit, transferring control to the hypervisor. KVM may handle the event in the kernel or return control to QEMU when userspace device emulation is needed. VM entry then resumes guest execution. Frequent exits can introduce overhead, so workload behaviour matters more than a generic virtualisation performance percentage.

04 — Memory translation and isolation

Guest applications use virtual addresses translated by guest page tables into guest physical addresses. Extended Page Tables on Intel or Nested Page Tables on AMD provide a second translation into host physical memory. Hardware translation caches reduce the cost of repeated lookups. Memory backing, allocation and reclamation remain host responsibilities.

Memory overcommit can improve utilisation for ordinary workloads, but large model-serving environments often require predictable resident memory. Host swapping, NUMA-remote allocations and memory pressure can introduce latency variation. Huge pages may reduce translation overhead, but require careful allocation and measurement. CPU memory isolation is also distinct from device DMA isolation, which requires an appropriate IOMMU configuration.

05 — Scheduling and virtual devices

In a typical KVM/QEMU deployment, virtual CPUs are represented by host threads. The Linux scheduler decides when and where they execute. CPU pinning can improve locality and reduce contention, but poorly chosen affinity may concentrate competing workloads on the same cores. A vCPU count is not a guarantee of dedicated physical cores.

QEMU can emulate conventional hardware or expose paravirtualised VirtIO devices. VirtIO uses shared queues and notifications to reduce the overhead associated with emulating legacy devices. Depending on configuration, vhost can move portions of the data path out of QEMU userspace. These optimisations do not eliminate host scheduling, storage or network bottlenecks.

06 — Isolation and the trust boundary

Machine-level isolation provides a separate guest kernel, unlike ordinary containers that share a host kernel. Neither approach guarantees security. Hypervisor vulnerabilities, unsafe device emulation, management credentials and shared hardware side channels must be considered. Apply least privilege to QEMU processes, restrict management sockets, patch the host and use supported mandatory access controls where appropriate.

GPU assignment changes the trust boundary because a device can perform DMA. VFIO and IOMMU protection, isolation groups, device reset behaviour and firmware support must be evaluated before assigning a device to an untrusted guest. Do not disable isolation protections merely to make a passthrough configuration work.

07 — Virtual machine lifecycle

Provisioning begins with a defined machine configuration: CPU model, vCPU count, memory, firmware, storage and network interfaces. The guest boots, initializes its devices and starts services. Production operation adds health checks, resource monitoring and controlled shutdown. Persistent storage and application state must be managed independently of transient VM execution state.

Snapshots are not automatically consistent backups. Application quiescence, external storage dependencies and restore testing determine whether recovery is meaningful. Live migration also depends on compatible CPUs, storage, network connectivity and device support. Directly assigned accelerators may restrict migration; never assume that a GPU-backed VM can migrate like a conventional CPU-only guest.

08 — Designing the AI platform

Choose virtual machines where separate kernels, administrative boundaries or dedicated device assignment are important. Containers can run inside those VMs to package model servers and supporting services. Bare metal remains a valid choice when maximum device flexibility and minimal operational complexity are more important than machine-level separation.

For inference, measure time to first token, inter-token latency, throughput and tail latency under realistic concurrency. Correlate these measurements with host CPU scheduling, memory locality, storage activity and GPU utilisation. A slow guest is not necessarily a slow GPU: contention in the surrounding platform can dominate the request path.

09 — Operational inspection

These read-only commands help establish the host baseline on Linux. Availability depends on installed packages, permissions and whether the machine exposes virtualisation extensions.

lscpu
ls -l /dev/kvm
lsmod | grep -E '^kvm'
free -h
numactl --hardware
virsh list --all
virsh dominfo VM_NAME

Replace VM_NAME with an existing domain name. A missing /dev/kvm may indicate unavailable hardware support, missing modules or restricted access; it does not by itself identify the cause. The virsh commands require a configured libvirt connection. Inspect before changing firmware or host configuration.

Engineering design decisions

Bare metal

Direct hardware access; fewer abstraction layers; separate hosts may be needed for strong workload boundaries.

Virtual machines

Independent guest kernels; flexible resource allocation; device assignment and migration constraints.

Containers

Portable application packaging; shared kernel; can be deployed inside virtual machines.

Knowledge checkpoint: does guest ring 0 mean host ring 0?

No. Hardware virtualisation execution modes and second-stage memory translation constrain the guest independently of its internal privilege level.

Knowledge checkpoint: can every GPU-backed VM migrate live?

No. Device assignment, driver support, hardware compatibility and migration capabilities must be validated.

Original educational editorial. Architecture is conceptual; no production benchmark or isolation guarantee is implied. Legal & Editorial Centre. Companion simulator: PAIES-VIRT-11.

NETWORK INSIGHT / AI INFRASTRUCTURE / INTERACTIVE 01

Inside the KVM execution engine

Follow a virtual CPU from QEMU into KVM and physical hardware. Investigate why ordinary guest instructions execute directly while selected operations cause VM exits.

Virtual machine control plane

Ready to launch a virtual CPU.
Conceptual KVM model. No real hypervisor or performance benchmark is executed.

Live execution architecture

Guest OS / AI workloadGuest virtual CPU and instruction stream
↕
QEMU userspacevCPU thread / device model
VM exit handlerKernel handling or userspace dispatch
↕ KVM_RUN ioctl / return ↕
Linux kernel · KVMvCPU state, VM entry and exit handling
↕ VM entry / VM exit ↕
Physical CPU · VT-x / AMD-VHardware-assisted guest execution
VM entries0
VM exits0
Userspace I/O returns0
vCPU / host CPU ratio0.50×

Engineering event console

Ready. Select a workload and run.

Guided engineering investigations

Choose an investigation to load its configuration.

Engineering interpretation and limitations

KVM exposes a kernel API through /dev/kvm. QEMU creates virtual machines and vCPUs and invokes KVM_RUN from vCPU threads. Guest instructions can execute directly on hardware in guest mode; not every instruction traps. Selected events cause exits, some handled entirely in KVM, others requiring QEMU userspace. Emulated port I/O is one example. HLT may be handled in the kernel with blocking or polling depending on configuration. Host scheduling controls when vCPU threads run; overcommit does not guarantee contention, but simultaneous runnable vCPUs can compete for CPU time. Hardware support is required for KVM acceleration; QEMU software emulation is a separate possible fallback, not modelled here. Counts represent only the illustrated journey, not measured system behaviour.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 02 · PAIES-VIRT-03 V1

KVM, QEMU and Hardware-Assisted Virtualisation

Inside the execution engine: from userspace machine construction to native guest instructions, hardware exits and accelerated AI I/O.

Architecture atlas — guest execution and exit handling

QEMU userspacevCPU thread · device model · guest RAMLinux kernel / KVMexit handling · MMU · interrupt deliveryPhysical CPU — guest executionVMX / SVM · VMCS / VMCB · EPT / NPTKVM_RUNuserspace exitVM entryVM exit

Conceptual execution path. Kernel-handled exits can resume the guest without returning to QEMU.

Control plane

QEMU constructs the machine and manages its lifecycle.

Execution plane

KVM and processor extensions execute guest code.

I/O plane

Emulation, VirtIO, vhost or assigned devices provide connectivity.

ENGINEERING DOSSIER 01

The division of responsibility

KVM is a Linux kernel subsystem that exposes hardware-assisted guest execution through a character device. QEMU is a userspace virtual machine monitor that constructs a machine model, allocates guest RAM, configures virtual processors and supplies device models. The host Linux scheduler still schedules the threads that execute virtual CPUs. This division is important: KVM is not a separate operating system beneath Linux, and QEMU is not necessarily interpreting every guest instruction.

With KVM acceleration enabled, ordinary guest instructions execute on the physical processor. QEMU can also use its Tiny Code Generator for software translation, including cross-architecture emulation, but that is a different execution path. For an AI server, the distinction determines whether the workload can exploit native CPU capabilities efficiently.

ENGINEERING DOSSIER 02

The KVM userspace API

QEMU opens /dev/kvm and checks the API version and supported extensions. KVM_CREATE_VM returns a VM file descriptor; KVM_SET_USER_MEMORY_REGION describes guest physical memory backed by userspace mappings. KVM_CREATE_VCPU creates a vCPU descriptor, and a shared kvm_run mapping communicates execution results between userspace and the kernel.

A vCPU thread invokes KVM_RUN to enter guest execution. When KVM returns an exit requiring userspace assistance, QEMU inspects the exit reason, performs the required work and re-enters the guest. Many hardware exits are handled entirely in the kernel; a hardware VM exit is not necessarily a return to QEMU.

ENGINEERING DOSSIER 03

Hardware execution: VMX and SVM

Intel VT-x uses VMX root and non-root operation and a Virtual Machine Control Structure (VMCS). AMD-V uses Secure Virtual Machine extensions and a Virtual Machine Control Block (VMCB). These structures contain guest state and execution controls used by the processor and hypervisor. Guest kernel privilege is distinct from hypervisor privilege: a guest can execute at its own ring 0 without gaining unrestricted control over the host.

VM entry loads guest execution state. An intercepted operation, configured exception or other exit condition transfers control to the hypervisor. KVM interprets the exit and either resumes the guest or requests assistance from userspace. Interception policies vary with processor capabilities and configuration.

ENGINEERING DOSSIER 04

Memory translation and locality

A guest process uses virtual addresses translated by guest page tables into guest physical addresses. Intel EPT or AMD nested page tables translate those guest physical addresses into host physical memory. Hardware translation caches reduce the cost of repeated translations, but misses and page walks still matter.

Host memory placement is independent of the guest topology unless deliberately coordinated. A guest with vCPUs on one NUMA node and memory or a GPU attached to another can incur remote access costs. Huge pages may reduce translation overhead, but require capacity planning and do not automatically improve every workload.

ENGINEERING DOSSIER 05

Device emulation and accelerated I/O

QEMU presents devices such as virtual PCI controllers and storage adapters. Traditional emulated devices may require register access interception and userspace device processing. VirtIO instead provides a cooperative guest-driver interface with shared descriptor queues. The guest publishes buffers and notifies the backend, which processes requests and reports completions.

For supported devices, vhost moves portions of the datapath out of QEMU userspace into a kernel or userspace backend. Notification suppression and batching can reduce transitions. Device assignment via VFIO follows a different path: a physical device is assigned to a guest under appropriate IOMMU isolation. It is not simply another VirtIO device.

ENGINEERING DOSSIER 06

Interrupts, timers and scheduling

A virtual device completion may cause an interrupt to be delivered to a guest vCPU. KVM can implement interrupt-controller functionality in the kernel; hardware assistance such as posted interrupts may further reduce overhead where supported. Virtual timers must preserve guest timekeeping even when the host deschedules a vCPU.

A vCPU is not a dedicated physical core unless host scheduling and affinity policies make that arrangement. Oversubscription can cause run-queue delays and guest steal time. Inference latency may become unstable even when average CPU utilisation appears modest. Reserve host capacity for emulator threads, I/O workers and interrupt handling.

ENGINEERING DOSSIER 07

Engineering GPU-accelerated guests

A GPU assigned through VFIO can expose its native device interface to the guest driver. DMA isolation relies on IOMMU mappings and platform isolation boundaries. CPU virtualisation extensions and IOMMU support are separate capabilities. Check PCIe topology, IOMMU groups, firmware settings and device reset behaviour before selecting a deployment design.

GPU passthrough does not imply live migration support or safe sharing between tenants. Device ownership, driver compatibility, licensing and vendor-supported virtual GPU modes must be assessed separately. For inference, benchmark model loading, time to first token, decode throughput and tail latency under realistic concurrency.

ENGINEERING DOSSIER 08

Production diagnosis and operational boundaries

Begin by verifying that the host exposes the required CPU extensions and /dev/kvm, then inspect the actual QEMU process configuration. A guest that boots successfully may still be using software emulation. Compare host scheduling pressure, guest steal time, NUMA placement and device throughput before attributing slow inference to KVM itself.

Use a controlled baseline and change one variable at a time. Collect host and guest metrics over the same interval. Treat VM exits as a diagnostic signal, not a universal performance score: exit reasons, frequency and service cost matter more than an isolated counter. Protect access to management sockets and avoid exposing QEMU monitor interfaces to untrusted networks.

Read-only engineering inspection

lscpu
ls -l /dev/kvm
lsmod | grep -E 'kvm|vfio'
ps -eo pid,comm,args | grep '[q]emu-system'
virsh dominfo VM_NAME
virsh vcpuinfo VM_NAME
numactl --hardware
lspci -nnk

Replace VM_NAME with an existing domain. virsh requires libvirt and appropriate access; numactl may need installation. Inspect process arguments locally because they may contain sensitive configuration. These commands do not configure a VM.

Engineering checkpoints

Does every VM exit return to QEMU?

No. KVM can handle many exits within the kernel and resume execution directly.

Does EPT eliminate guest page tables?

No. Guest page tables and second-stage translation serve different address spaces.

Does GPU passthrough eliminate CPU scheduling latency?

No. Guest vCPU scheduling and host resource contention remain relevant.

Further technical reading

Linux KVM API documentation · QEMU system emulation introduction

Original educational editorial. Architecture is conceptual; capabilities depend on hardware, kernel and QEMU versions. See Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 02

Inside QEMU and KVM: the instruction journey

Explore where guest instructions execute, why a VM exits, and when QEMU userspace becomes involved. Compare hardware-assisted execution with software translation.

Guest OS / vCPUGuest instruction streamQEMU userspacevCPU thread / device modelLinux KVMKVM_RUN / exit handlingPhysical CPUGuest execution modeVM exitIntercept / return to hostTCG translatorTranslated host codeHighlighted component = current execution stage
Select a workload and run the journey.
Instructions completed0
VM entries0
VM exits0
Userspace I/O exits0
Illustrative cost units0

Engineering event console

Ready.

Guided investigations

01 — Native arithmetic

Choose KVM and arithmetic. Observe direct guest execution without an instruction-triggered VM exit. A real vCPU may continue executing many instructions before returning to the host.

02 — Intercepted CPUID

Choose CPUID. Observe an exit handled in KVM without a required return to QEMU. Actual intercept behaviour depends on CPU and hypervisor configuration.

03 — Emulated device access

Choose emulated port I/O. Observe KVM returning to QEMU to service the device model, followed by another guest entry. Accelerated devices can follow different paths.

04 — Software translation

Choose TCG and compare the illustrative costs. TCG translates guest code into host code without KVM hardware VM entries or exits.

05 — Diagnose unavailable KVM

Inject a disabled virtualisation or permissions fault. On a real Linux host, inspect firmware settings, /dev/kvm permissions and kernel logs. Select TCG explicitly to explore an alternative backend.

Educational discrete-event model. Cost units are invented for comparison, not measured latency or benchmark results. The model omits asynchronous interrupts, scheduling and many hardware-specific details. A completed arithmetic journey does not imply that KVM_RUN has returned.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 03 · EDITORIAL

Virtual CPUs, NUMA and Memory Management

A virtual machine can have ample CPU and memory on paper yet deliver inconsistent inference latency. The missing variable is often placement: where its execution threads run, where its memory resides and how those resources relate to the GPU and network adapter.

Two NUMA nodes with local memory and PCIe devices, connected by an intersocket fabricGuest VM · vCPU threadsNUMA node 0NUMA node 1CPU coresLocal RAMCPU coresLocal RAMPCIe · GPU 0PCIe · NIC / GPU 1Fabric

Conceptual dual-socket topology. Actual NUMA domains and PCIe attachment depend on platform firmware and hardware.

1. A vCPU is an execution context, not a dedicated core

In a typical KVM virtual machine, QEMU creates host threads for virtual CPUs. Linux schedules those threads onto eligible logical processors, and KVM enters guest execution using hardware virtualisation. The guest scheduler sees its own processors but cannot directly control the host scheduler. Consequently, a runnable guest task can wait because the corresponding host vCPU thread is not scheduled.

CPU overcommit can be economical for bursty services, but simultaneous inference requests, tokenisation and storage processing can expose scheduling contention. Guest steal time is one useful signal where supported; it should be correlated with host run queues and application latency rather than interpreted as a complete measure of contention.

2. CPU pinning and execution isolation

Affinity restricts the host processors on which a thread may run. Libvirt supports vCPU pinning, emulator thread pinning and I/O thread pinning separately. Pinning can reduce migration and improve cache locality, but it does not reserve a physical core by itself. Other workloads may still execute on that core unless host resource policies prevent them.

Simultaneous multithreading siblings share execution resources. A design that allocates two logical CPUs as if they were two independent physical cores may overestimate available compute. Reserve capacity for host housekeeping, interrupts, storage and network processing; do not allocate every logical CPU to the guest simply because the configuration allows it.

3. NUMA: memory has a physical location

Non-uniform memory access describes systems in which memory access cost depends on the processor and memory controller involved. A CPU accessing local memory normally avoids the intersocket path needed for remote memory. Remote accesses can consume fabric bandwidth and introduce additional latency, particularly when several workloads compete for the same resources.

Linux generally allocates anonymous memory on first touch under its applicable memory policy. A thread that initialises a large buffer can therefore influence its physical placement. Binding vCPU threads without considering memory policy may leave the guest executing on one node while its backing pages reside on another.

Local access

CPU and backing memory share a NUMA domain.

Remote access

Requests traverse the host interconnect.

Device locality

PCIe root complex placement influences DMA paths.

4. Virtual NUMA and host memory policy

Virtual NUMA exposes a topology to the guest so that its scheduler and applications can make locality-aware decisions. It does not automatically ensure matching host placement. Configure guest NUMA cells, vCPU affinity and host backing memory policy together. A large guest spanning two host nodes may benefit from a corresponding virtual topology rather than pretending all memory is equally close.

Strict memory binding can prevent remote allocation but can also cause allocation failures when the chosen node lacks capacity. Preferred policies allow fallback. The appropriate policy depends on workload latency requirements, host capacity and the availability strategy.

5. Nested translation and huge pages

Guest virtual addresses translate to guest physical addresses, then hardware-assisted second-stage translation maps those addresses to host physical memory. Intel EPT and AMD NPT reduce the need for software-managed shadow page tables. Translation caches help avoid repeated walks, but large working sets can increase translation pressure.

Huge pages can reduce the number of translations required for a large memory region. Explicit hugetlb pages require suitable reservations and may be difficult to allocate after fragmentation. Transparent huge pages have different allocation and collapse behaviour. Neither is universally faster: measure workload latency, memory utilisation and allocation behaviour before adopting a policy.

6. Memory pressure, ballooning and overcommit

A balloon driver allows a cooperative guest to release pages for host reclamation. This is different from increasing physical RAM. Host swapping, guest swapping and reclaim activity can all disrupt latency-sensitive services. For predictable inference, size host memory for guest allocations, QEMU overhead, host services and staging buffers rather than relying on aggressive overcommit.

GPU VRAM is a separate resource. Guest RAM ballooning cannot directly reclaim model weights or KV cache allocated in a passed-through GPU. GPU memory pressure must be addressed through model placement, precision, context limits, concurrency or serving-engine policies.

7. GPU and network locality

A passed-through PCIe device has a physical attachment to the host. A GPU may be closer to one NUMA domain than another. Aligning guest execution threads, DMA buffers and the device's PCIe locality can reduce avoidable intersocket traffic. This is particularly relevant to host-to-device transfers, tokenisation, data loading and network-to-GPU pipelines.

GPU-to-GPU communication depends on the actual PCIe, NVLink or other supported fabric topology. CPU affinity cannot create a missing peer-to-peer path. Inspect the physical topology and validate the supported driver, IOMMU and virtualisation configuration before assuming direct transfers are available.

8. Production performance investigation

Start with a repeatable baseline: fixed model, precision, prompt length, output length and concurrency. Measure time to first token, inter-token latency, throughput and tail latency. Compare those results with host CPU utilisation, memory locality, GPU utilisation and transfer activity. Change one placement variable at a time and repeat the experiment.

For example, if GPU utilisation is low while CPU threads are saturated, investigate tokenisation and request scheduling before purchasing additional GPUs. If remote memory traffic rises after a placement change, test aligned memory and CPU policies. A topology diagram is a hypothesis, not proof of the bottleneck.

lscpu -e=CPU,CORE,SOCKET,NODE
numactl --hardware
numastat -p <QEMU_PID>
virsh vcpupin <VM_NAME>
virsh numatune <VM_NAME>
virsh domstats <VM_NAME>
nvidia-smi topo -m

Read-only diagnostic examples. Availability depends on installed utilities, permissions and hardware. Replace placeholders before use; run host topology commands on the hypervisor.

Engineering knowledge checkpoints

Why can pinning vCPUs alone fail to improve latency?

Backing memory, emulator threads and devices may remain remote or contended. Affinity is only one part of resource placement.

Does adding guest RAM resolve GPU out-of-memory errors?

Not directly. GPU VRAM capacity and allocation policy must be investigated independently.

Should every AI VM use huge pages?

No. Compare measured performance and allocation constraints with the default configuration.

Continue the engineering journey

Section 3 — Interactive (Widget 13) applies these principles to a simulated placement investigation. The next editorial section examines VirtIO, virtual storage and high-performance I/O.

Further reading: Libvirt domain XML · Linux NUMA memory policy.

Original Network Insight educational editorial. Architecture is illustrative; performance depends on actual hardware and software. Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 03

Virtual CPU & NUMA Engineering Laboratory

Investigate how guest execution and host memory placement affect a virtualised AI workload. The model represents two NUMA nodes, each with eight physical cores and 64 GiB of RAM.

Virtual machine configuration

Host topology & memory journey

Guest virtual machineNUMA NODE 0NUMA NODE 1Green: local memory · Gold: remote memory

Remote access estimate
—
Modelled memory latency
—
Peak CPU demand / capacity
—
Relative throughput index
—

Execution controls

Memory samples: 0

Guided investigations

Select an investigation, then run or single-step the memory journey.

Educational model only: latency assumptions are 90 ns local and 150 ns remote; throughput is a relative heuristic, not a benchmark. CPU affinity represents allowed placement, not actual Linux scheduler behaviour. Huge pages, cache coherence, SMT and GPU locality are not modelled.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 04 · EDITORIAL

VirtIO, Virtual Storage and High-Performance I/O

The performance of an AI virtual machine depends on more than its assigned GPU. The virtual I/O architecture determines how efficiently model weights, datasets and network requests move through the host.

Conceptual VirtIO guest to host storage and network pathsGuest Linux · AI workloadvirtio-blk / virtio-scsiShared virtqueuevirtio-netTX / RX virtqueuesStorage backend · QEMUNetwork backend · vhost-netHost storage · NVMeTAP · bridge · NIC

Conceptual I/O paths; backend choices vary by deployment.

Virtqueue

Shared descriptors and completion notifications.

Storage

Guest block requests reach a host storage backend.

Networking

Virtual NIC queues feed the host network datapath.

01 · The virtual I/O boundary

A guest application issues ordinary Linux system calls. Its filesystem, block layer or network stack translates those calls into requests to a virtual device. Traditional device emulation reproduces the register interface of physical hardware, potentially requiring expensive exits and emulation work. VirtIO instead defines a device interface designed for virtual environments. A guest driver and a compatible backend cooperate through shared memory queues, avoiding much of the overhead of emulating legacy hardware. This is paravirtualised I/O, not direct physical device assignment.

For AI infrastructure the distinction matters: loading model weights, fetching training batches and exchanging inference requests can all contend for host CPU time. A faster GPU cannot compensate for a persistently starved input pipeline. Measure the complete path rather than assuming that a virtual disk or NIC is the bottleneck.

02 · Virtqueues and descriptor ownership

A split virtqueue contains a descriptor table, an available ring and a used ring. Descriptors identify guest buffers and their lengths, direction and optional chains. The driver publishes available descriptors after the appropriate memory ordering operations. The backend consumes them, performs the requested operation and publishes completions. Notifications may be suppressed or batched when negotiated features and queue state permit. Packed virtqueues combine availability and completion information into a different ring layout; they are not simply renamed split rings.

Shared memory does not guarantee zero-copy end to end. Buffer mappings, bounce buffers, encryption, backend implementation and physical device requirements determine where copying occurs. Queue depth controls outstanding work; it does not directly specify throughput. Excessive outstanding work can increase tail latency even when average bandwidth improves.

03 · QEMU, vhost and backend acceleration

QEMU can implement the VirtIO backend in userspace. A vhost-net backend can move much of the network datapath into the host kernel, reducing userspace transitions. With vhost-user, a separate userspace process can implement the backend using negotiated shared memory and event notification mechanisms. The control plane still configures devices and queues; acceleration does not remove the need for lifecycle management, isolation and monitoring.

Multiqueue can distribute processing across CPUs, but additional queues consume resources and may introduce contention. Align guest queues, host processing threads and physical NIC queues with NUMA placement where practical. Benchmark with realistic packet sizes, connection counts and request patterns rather than assuming that every workload benefits from the maximum queue count.

04 · Virtual storage architecture

Virtio-blk presents a block device; virtio-scsi presents a SCSI controller that can manage multiple devices and SCSI operations. A typical request traverses the guest filesystem and block layer, the virtqueue, the backend and the host storage stack before reaching an NVMe device or remote storage service. Raw images, qcow2 images and logical volumes have different operational properties. Copy-on-write images enable useful snapshot workflows but can introduce allocation and metadata overhead.

Durability is a separate engineering requirement from throughput. Guest flushes, host caching, backend settings and physical storage guarantees must agree. Disabling flush semantics merely to improve benchmark numbers risks losing acknowledged writes. Validate recovery with application-consistent backups; a VM snapshot alone is not necessarily a recoverable database backup.

05 · Network I/O and offloads

Virtio-net exposes a virtual NIC to the guest. On a common Linux host, its backend connects to a TAP interface and then to a bridge or Open vSwitch. Traffic may remain within the host or traverse a physical NIC. Checksum offload, segmentation offload and receive aggregation can reduce per-packet processing overhead. Their actual availability depends on feature negotiation and the rest of the datapath.

Packet captures taken before segmentation or checksum completion can show apparently oversized frames or incomplete checksums. Interpret capture location before diagnosing a fault. For distributed AI workloads, ordinary virtual Ethernet does not automatically provide RDMA semantics; specialised virtual or assigned devices and a compatible fabric may be required.

06 · AI model storage and data movement

A cold model start may involve reading weight shards from local NVMe or object storage, parsing model metadata, allocating host memory and transferring weights to accelerator memory. Warm starts can benefit from page cache, but cache pressure and concurrent model loads may change the result. Separate storage read time, deserialisation time and host-to-device transfer time in measurements.

GPU direct storage paths require compatible hardware, drivers, filesystems and deployment configuration. A conventional VirtIO block device does not automatically expose GPUDirect Storage. Choose a validated direct path only when the workload justifies its complexity; ordinary virtual storage remains suitable for many inference deployments.

07 · Performance engineering and isolation

Start with a baseline that records throughput, IOPS, latency percentiles, CPU utilisation and queue depth. Compare identical workload conditions while changing one variable at a time. Dedicated I/O threads, queue placement and storage allocation can help isolate bottlenecks, but their effects depend on the backend. Observe host and guest simultaneously because a guest can report high I/O wait while the host is constrained by a different resource.

Use cgroup limits and storage or network QoS where appropriate to prevent noisy neighbours. Keep backend processes patched and restrict access to shared memory and device sockets. Virtual I/O interfaces are security boundaries, not just performance mechanisms. Direct assignment can reduce some overhead but changes migration, isolation and operational requirements.

08 · Production troubleshooting workflow

When inference startup becomes slow, first distinguish cold model loading from steady-state token generation. Compare guest disk latency with host device latency and inspect backend CPU usage. If host storage is idle but guest latency is high, investigate queue processing, scheduling and image metadata. If both layers are saturated, investigate physical storage capacity and competing workloads.

For network stalls, compare guest interface counters with host TAP, bridge and physical NIC counters. Verify MTU across the complete path and check drops before changing offloads. Document the baseline, the suspected cause, the controlled change and the recovery measurement. This evidence-driven approach is more reliable than applying generic tuning recipes.

Engineering field notes · Read-only diagnostics

lsblk -o NAME,TYPE,SIZE,ROTA,MODEL
lspci -nnk
iostat -xz 1
ip -s link
ethtool -k eth0
virsh domblkstat VM_NAME vda
virsh domifstat VM_NAME vnet0

Run the first five commands in the appropriate guest or host context; the virsh commands are host-side examples for libvirt-managed guests. Replace interface, VM and device names. iostat and ethtool may require installed packages. Stop continuous sampling with Ctrl+C.

Knowledge checkpoints

Does VirtIO guarantee zero-copy?

No. The backend, buffer mappings and physical device requirements determine actual copies.

Why might more queues increase latency?

Additional outstanding work and CPU contention may increase waiting time. Measure tail latency under realistic load.

Does virtio-net automatically provide RDMA?

No. RDMA requires a compatible device interface, software stack and fabric.

Further engineering reading

OASIS VirtIO 1.2 specification · QEMU documentation · Linux kernel documentation

Network Insight · Original educational editorial. Architecture is illustrative, not a live device emulator. Validate configuration and performance on your own infrastructure. Legal & Editorial Centre.

NETWORK INSIGHT / AI INFRASTRUCTURE / SIMULATION 04

Inside the VirtIO I/O path

Follow a descriptor from a guest driver through shared memory to the host backend and back to the guest. Compare storage and networking, investigate queue pressure and diagnose completion failures.

Execution architecture

Ready.

Split virtqueue inspector

Descriptor table occupancy (gold: outstanding; teal: completed but not reclaimed). Each slot represents one simplified request chain.

Indices are shown as 16-bit counters. The model omits indirect descriptors, packed rings and notification suppression.

Engineering event console

Guided investigations

01 — Network fast path. Compare QEMU and vhost using identical batch sizes. Observe which backend handles the request.

02 — Storage read. Select block I/O. Follow the backend read and guest buffer completion. This model uses QEMU for block I/O.

03 — Queue pressure. Select depth 8 and batch 16. Observe backpressure rather than assuming unlimited outstanding requests.

04 — Notification failure. Inject a lost notification. Observe outstanding descriptors with no backend progress.

05 — Completion recovery. Inject a lost completion interrupt, then select polling and restart. Observe the guest reclaim completed descriptors.

Engineering interpretation

VirtIO is a paravirtualised device interface. A guest driver publishes descriptor chains and available entries in shared memory. The backend consumes requests, accesses mapped guest buffers and publishes used entries. A notification or polling mechanism lets the guest observe completion. vhost can move network datapath processing away from QEMU userspace; QEMU still participates in device configuration and lifecycle management.

Model boundaries: This is a deterministic educational simulator, not a live hypervisor or performance benchmark. Timing units are synthetic; real costs depend on batching, offloads, host scheduling, storage and hardware. Not every notification requires a VM exit, and interrupt delivery can be accelerated. The lost-notification fault deliberately assumes no alternative backend polling.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 05 · EDITORIAL

Linux Bridges, TAP Interfaces and Network Namespaces

A virtual machine can have a fully functional Ethernet adapter without owning a physical NIC. Linux supplies the software switching, virtual interfaces and isolated network stacks that connect guest workloads to the outside world. Understanding these boundaries is essential to building and diagnosing private AI platforms.

Virtual machine and namespace connected through a Linux bridge to an uplinkGuest VM · virtio-netGuest network stackNetwork namespaceeth0 · veth peerQEMU / vhost-netHost TAP portHost veth portLinux bridge br-aiMAC learning · VLAN policyPhysical Ethernet uplink

Conceptual Layer 2 topology. The uplink is optional; a bridge can also connect isolated local workloads.

Bridge

Software Ethernet switch with a forwarding database.

TAP

Ethernet frame interface between a virtual machine backend and the host.

Namespace

Independent network stack with its own interfaces and routes.

01 · The host as a virtual Ethernet switch

A Linux bridge joins interfaces into a Layer 2 forwarding domain. It learns source MAC addresses on ingress ports and records them in its forwarding database (FDB). Known unicast frames are directed toward the learned destination port. Unknown unicast and broadcast frames are normally flooded to eligible ports; multicast forwarding can be constrained by snooping. Entries age out, and a topology change may invalidate learned paths.

The bridge itself can also be a host network interface with an IP address. In a conventional bridged uplink configuration, the host IP belongs on the bridge rather than the enslaved physical port. This is different from routing: a bridge does not decrement an IP packet TTL merely by forwarding an Ethernet frame. A routed or NAT-based design instead introduces a Layer 3 boundary.

02 · TAP, TUN and the guest network boundary

TAP exposes Ethernet frames through the Linux TUN/TAP driver. QEMU can connect a virtual NIC to a TAP backend; vhost-net can accelerate portions of the data path in the kernel. A guest transmits through virtio-net queues, and the backend delivers the Ethernet frame to the host TAP interface. The bridge treats that interface as a port. In the reverse direction, frames delivered to TAP reach the guest through its virtual NIC backend.

TUN operates at Layer 3 and carries IP packets rather than Ethernet frames. Neither interface is inherently a tunnel across a remote network. Encapsulation and transport require additional software or kernel facilities. A persistent TAP interface can outlive the process that originally created it, whereas nonpersistent devices normally disappear when their associated file descriptors close.

03 · Network namespaces and veth pairs

A network namespace isolates network devices, IP addresses, routing tables, sockets and relevant firewall state. A physical or virtual interface belongs to one network namespace at a time. A veth pair acts as a virtual Ethernet cable: a frame transmitted into one endpoint arrives at the other. One endpoint can reside in a workload namespace while its peer remains in the host and attaches to a bridge.

Namespaces do not by themselves guarantee strong tenant security. Privileges, shared kernel attack surface, firewall policy and permitted connectivity still matter. A container may use a namespace without a bridge, for example through a routed CNI design. Kubernetes networking implementations vary; some use eBPF routing instead of traditional Linux bridges.

04 · Following an inference request

Consider an inference client in a VM and a model service in a namespace on the same host. The client resolves the service IP to a MAC address using ARP for IPv4 or neighbour discovery for IPv6, assuming both endpoints are on the same subnet. Its virtual NIC emits an Ethernet frame through the TAP backend. The bridge learns the source MAC and forwards or floods the frame according to its FDB and policy. The host veth peer delivers the frame to the service namespace.

The destination stack processes the packet and delivers it to the listening socket if routing, firewall and application state permit. The response follows the reverse logical path. For a remote subnet the client instead resolves its next-hop gateway. For a remote host on the same VLAN the bridge may forward through the physical uplink. The GPU executes the inference computation, but the network path is responsible for delivering the request and response.

05 · VLANs, loops and isolation

A VLAN-aware bridge can enforce per-port VLAN membership and separate forwarding domains. An access-like port can assign a PVID to untagged ingress traffic and transmit untagged frames for the configured VLAN. A trunk-like port can carry multiple tagged VLANs. Both the bridge and upstream switch must agree on membership and tagging. VLAN filtering is not equivalent to application authorization.

Redundant Layer 2 links can create forwarding loops and broadcast storms. Spanning Tree support and topology design must be evaluated before adding redundant links; do not assume STP is enabled. Host bridge filtering can use nftables bridge-family rules. IP-family forwarding rules alone should not be assumed to inspect all bridged frames; bridge netfilter configuration affects that behaviour.

06 · Performance engineering for AI workloads

Virtual networking consumes CPU cycles for queue processing, switching, interrupts and memory movement. Virtio multiqueue can distribute work, but the useful queue count depends on vCPU placement, backend support and workload parallelism. GRO, GSO and checksum offloads may change the packet sizes and checksums visible in captures. A capture showing a large software segment is not proof that an oversized Ethernet frame crossed the physical wire.

Measure throughput, packet drops, retransmissions, queue pressure and tail latency under realistic concurrency. Align vCPU and interrupt placement with NIC and GPU NUMA locality where practical. Verify MTU across the entire path, including any overlay overhead. Ordinary Linux bridging is not a substitute for validating RDMA support, loss management and device-specific requirements in a distributed GPU fabric.

07 · Production troubleshooting methodology

Start at the workload: verify interface state, addresses, routes, neighbour resolution and listening sockets. Move outward to the host TAP or veth port, bridge membership, VLAN configuration and FDB. Then inspect the physical uplink and upstream network. Compare captures at successive boundaries to identify the first point where expected traffic disappears.

A successful ping does not establish that an inference service is healthy. Test the actual service port and application protocol, inspect server logs, and correlate latency with GPU and host metrics. Avoid changing bridge membership or moving management interfaces on a remote production host without an approved rollback and out-of-band access.

08 · Choosing the production topology

A single bridge is useful for a small laboratory, but production designs need explicit management, storage, inference and tenant connectivity requirements. Separate trust zones, document gateway ownership, define permitted flows and monitor resource contention. A routed design can reduce broadcast scope; an overlay can extend logical networks across hosts at the cost of encapsulation and additional control-plane complexity.

The next editorial introduces Open vSwitch, which adds a programmable flow-based datapath and integration with software-defined networking controllers. The fundamentals remain the same: identify ingress and egress interfaces, determine the forwarding decision, and verify policy at every boundary.

Engineering field notes · Read-only diagnostics

Run on an authorised Linux host. Replace example interface and namespace names with actual names. Some commands require elevated privileges; packet capture can expose sensitive traffic.

ip -br link
ip -br addr
ip route show
ip neigh show
ip -d link show type bridge
bridge link show
bridge fdb show
bridge vlan show
ip netns list
ip netns exec ai-ns ip -br addr
ip netns exec ai-ns ip route show
ip -s link show dev br-ai
ethtool -S eth0
ss -lnt

These commands inspect state; they do not create or modify a bridge. Named namespace listings do not necessarily include every container namespace.

Engineering knowledge checkpoints

Why does an unknown destination MAC reach multiple bridge ports?

The bridge floods unknown unicast to eligible ports in the forwarding domain until it learns the destination location. VLAN and port policy can restrict flooding.

Why use TAP rather than TUN for a bridged virtual machine?

TAP carries Ethernet frames, including MAC headers and ARP. TUN carries Layer 3 packets and is not an Ethernet bridge port equivalent.

A namespace can reach its gateway but not the inference service. What next?

Check routing, service port reachability, firewall policy and the service listener. Correlate captures and application logs rather than assuming a bridge fault.

Further reading: Linux bridge documentation · Linux TUN/TAP documentation.

Network Insight · Original educational engineering editorial. Architecture is conceptual, not a live network. Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 05

Linux virtual networking — inside the Ethernet journey

Trace a frame from a KVM guest through a TAP device and a Linux software bridge. Observe source MAC learning, unknown-unicast flooding, VLAN isolation and namespace delivery.

Guest VM Aeth0tap0Host TAPbr0FDB / VLANveth-host ↔ veth-nsNetwork namespacetap1Guest VM Beno1External L2 peer

Ready to transmit a frame.

Frames sent0
Delivered0
Dropped0
Flood events0

Forwarding database (FDB)

MAC addressBridge portVLAN

The bridge learns source MAC addresses, not destination addresses. A reply is required to learn a previously unknown peer.

Engineering event console

Ready.

Guided investigations

  1. Send a frame to the namespace. Inspect the unknown-unicast flood and learned source MAC.
  2. Use Learn destination (reply), then send again. Observe known-unicast forwarding.
  3. Choose VLAN-aware mode and inject a VLAN mismatch. Compare delivery with flat mode.
  4. Inject a blocked bridge port or a down TAP. Locate the exact drop stage.
  5. Select the external peer and trace the physical egress. Explain why bridging does not decrement IP TTL.

Inspect a real Linux host

ip -br link
bridge link
bridge fdb show br br0
bridge vlan show
ip netns list
ip netns exec <namespace> ip -br link
tcpdump -eni tap0

Read-only inspection examples; tcpdump may require privileges. This educational model simplifies port states, VLAN tagging, filtering, ageing and device internals. It does not configure a real host or measure throughput.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 06 · EDITORIAL

Open vSwitch and Software-Defined Networking

A virtual switch becomes an infrastructure control point when forwarding decisions can be programmed independently of physical cabling. Open vSwitch (OVS) connects virtual machines to policy-driven networks, providing a foundation for isolated AI services, overlay fabrics and observable traffic paths.

OVS control and data plane architectureSDN controllerOpenFlow policyOVSDB serverConfiguration stateovs-vswitchdClassifier / datapath controlAI guest AVirtIO / TAPAI guest BVirtIO / TAPDatapath / uplinkKernel or userspace forwarding

Conceptual relationships: blue indicates forwarding connectivity; gold indicates control and configuration. Cached packets do not traverse ovs-vswitchd on every hop.

1. From learning bridge to programmable switch

A conventional Linux bridge learns source MAC addresses and forwards frames using its forwarding database. OVS can provide similar Ethernet behaviour through its NORMAL action, but it can also match packet headers and metadata against explicitly installed rules. This makes the switch a programmable enforcement point rather than merely a software replacement for a physical switch. In an AI platform, a model-serving guest and a retrieval guest can share physical infrastructure without necessarily sharing a broadcast domain or unrestricted connectivity.

Software-defined networking separates the expression of forwarding policy from its execution. A controller may compute rules from workload identity, topology or tenant configuration; the switch applies the resulting matches and actions. OVS does not itself supply a complete identity system or guarantee isolation. The surrounding orchestration system must translate intent into correct rules, maintain them during changes and validate the resulting traffic paths.

2. OVSDB, ovs-vswitchd and the datapath

OVSDB stores configuration objects such as bridges, ports, interfaces, controller endpoints and tunnel parameters. ovsdb-server exposes the database protocol; ovs-vswitchd reads the configuration and manages forwarding. A management tool such as ovs-vsctl changes database state, whereas ovs-ofctl interacts with OpenFlow switches. These interfaces address different layers of the system, so a correctly configured port does not prove that the intended forwarding rule exists.

With the usual Linux system datapath, the kernel executes cached forwarding actions. A cache miss can cause an upcall to ovs-vswitchd, which evaluates the OpenFlow pipeline and installs a suitable datapath flow when possible. Subsequent packets matching that cache entry can be processed without the same userspace classification. Datapath flows may use wildcarded masks and are not a one-to-one copy of the OpenFlow rules. A userspace datapath, including deployments using DPDK, has different execution and polling characteristics.

3. OpenFlow pipelines and policy

OpenFlow rules contain matches, priorities and instructions or actions. A pipeline can classify ingress traffic, assign metadata, enforce policy and select an output. Within a table, the highest-priority matching rule wins; instructions can direct processing to later tables. The precise pipeline depends on the controller and OpenFlow version. A table miss must be deliberately handled, rather than assuming unknown traffic is always flooded.

Consider an inference service on TCP port 8000. A policy might permit requests from an approved application network and reject direct access from an unrelated tenant. Matching the ingress port and destination address alone is insufficient if a guest can spoof source addresses. Anti-spoofing, stateful connection tracking where appropriate, return-path rules and explicit default-deny behaviour all need consideration. OpenFlow metadata is local pipeline state, not a cryptographic identity.

4. VLANs and VXLAN overlays

OVS access ports can associate untagged guest traffic with a VLAN, while trunk ports carry permitted tagged VLANs. VLAN configuration used by NORMAL switching must not be confused with custom OpenFlow pipelines, which may need explicit tag manipulation and enforcement. A misconfigured trunk can create either a connectivity failure or unintended tenant reachability.

VXLAN encapsulates Ethernet frames in UDP/IP and identifies an overlay segment using a 24-bit VNI. Tunnel endpoints require an operational IP underlay, appropriate firewall rules and consistent tunnel configuration. A typical IPv4 VXLAN encapsulation adds about 50 bytes relative to the inner Ethernet frame, excluding optional tags and other headers. Plan the underlay MTU accordingly and verify end-to-end path MTU. VXLAN provides segmentation, not encryption; use suitable transport security where confidentiality is required.

5. AI inference packet journey

A guest application emits a TCP request through its virtio-net device. On a common QEMU configuration, the host TAP interface presents the Ethernet frame to an OVS bridge. The datapath checks for a cached match; on a miss, the userspace classifier evaluates the configured pipeline. A permitted packet may leave through a local guest port or a tunnel endpoint. At the remote host, decapsulation and ingress policy determine whether it reaches the model-serving guest.

The response follows its own forwarding and policy decisions. Asymmetric routing can complicate connection tracking, while missing neighbour resolution or an incorrect VNI can prevent a TCP handshake before any model code runs. Separating transport connectivity from application health prevents a networking incident from being misdiagnosed as a GPU failure.

6. Performance engineering and acceleration

Virtual networking consumes CPU cycles for classification, copying, queue handling and interrupts. VirtIO multiqueue can distribute work across vCPUs, but additional queues do not automatically improve throughput. Queue placement, host CPU contention and NUMA locality influence both throughput and tail latency. Measure packet rates and latency distributions under representative workloads rather than relying on nominal link speed.

OVS-DPDK uses a userspace datapath with poll-mode drivers and can require dedicated cores, huge pages and compatible devices. Hardware offload may move supported flow actions into a capable NIC or SmartNIC, but unsupported matches or actions may fall back to software. SR-IOV and direct device assignment can bypass parts of the virtual switch, changing visibility and policy enforcement. For distributed GPU communication, verify RDMA and RoCE support independently; ordinary OVS Ethernet forwarding does not imply a lossless RDMA fabric.

7. Operational troubleshooting

Start with the intended topology and confirm the guest interface, host TAP port and OVS bridge membership. Next inspect OpenFlow rules and counters, then datapath state. Use a trace to reason about how a hypothetical packet matches the pipeline, and compare that result with actual packet captures and interface counters. A successful trace is not proof that the physical network delivered the packet.

For intermittent inference latency, correlate guest TCP retransmissions, interface drops, host CPU saturation and application request timing. Check tunnel MTU and offload effects before drawing conclusions from captures. Preserve the existing configuration and avoid modifying production flows during diagnosis without a reviewed change plan.

8. Production design principles

Keep management access separate from workload forwarding where feasible. Protect controller and OVSDB connections, restrict administrative access and audit configuration changes. Decide explicitly what happens when the controller is unreachable: fail-mode behaviour and installed rules affect whether traffic continues, stops or falls back to standalone switching. Test that behaviour in a controlled environment.

Treat the virtual switch as part of the production service dependency chain. Document port ownership, VLAN and VNI allocation, policy intent, underlay MTU and rollback procedures. Monitor flow changes, drops and host resource utilisation. Validate isolation using both permitted and prohibited traffic tests. The next editorial section examines PCIe passthrough, VFIO and IOMMU, where direct device access changes the boundary between software switching and hardware forwarding.

Read-only diagnostic field notes

ovs-vsctl show
ovs-vsctl list Interface
ovs-ofctl -O OpenFlow13 dump-flows br-ai
ovs-appctl dpctl/dump-flows
ovs-appctl ofproto/trace br-ai "in_port=1,tcp,nw_src=10.0.0.10,nw_dst=10.0.0.20,tp_dst=8000"
ip -s link
ss -tin

Example bridge, port and addresses are illustrative. Substitute actual values and use the negotiated OpenFlow version. Commands may require administrative privileges; trace results model classification rather than transmit traffic.

Engineering knowledge checkpoints

Why can OVSDB look correct while traffic fails?

Database configuration and forwarding rules are separate. Inspect port state, OpenFlow policy and datapath counters.

Does VXLAN encrypt AI traffic?

No. It encapsulates traffic and identifies overlay segments; encryption requires a separate mechanism.

Why might a cached flow avoid userspace classification?

The datapath can execute previously installed matching actions directly until a miss or invalidation requires new classification.

Further engineering reading

Open vSwitch documentation · RFC 7348 — VXLAN

Original educational editorial. Architecture is conceptual; verify implementation details against your deployed versions. Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 06

Inside Open vSwitch — the programmable packet journey

Investigate how a virtual switch classifies traffic, applies priority-ordered OpenFlow rules and caches forwarding decisions in its datapath. Build an intuition for the distinction between the controller, ovs-vswitchd and the kernel datapath.

Guest TAPIngressKernel datapathFlow cacheovs-vswitchdOpenFlow pipelineExecute actionOutput / dropEgressVirtual portSDN controllerControl plane

Ready — choose a packet and step through the pipeline.

Delivered0
Dropped0
Cache hits0
Upcalls0

OpenFlow table 0 · simplified rules

PriorityMatchAction

Datapath cache

Empty

Engineering event console

Ready.

Guided investigations

  1. Send VM A to VM B twice. Compare the first upcall with the cached second packet.
  2. Send VM A to VM C under tenant isolation. Observe the higher-priority drop rule.
  3. Select permissive policy and repeat. Notice how policy changes invalidate the model cache.
  4. Select missing rules and disconnect the controller. Observe table-miss handling.
  5. Warm the cache, then make ovs-vswitchd unavailable. Compare a cached packet with a new flow.

Production inspection commands

ovs-vsctl show
ovs-ofctl -O OpenFlow13 dump-flows br0
ovs-appctl dpctl/dump-flows
ovs-appctl ofproto/trace br0 in_port=1,dl_dst=02:00:00:00:00:02

Use actual bridge names and port identifiers in your environment. This is a deterministic educational model: exact ingress/destination keys stand in for masked megaflows, tenant membership stands in for VLAN or metadata classification, and policy changes flush the simulated cache immediately. A controller packet-in is modeled without automatic rule installation. Real cache expiry, revalidation, multi-table processing and offload behavior vary.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 07 · EDITORIAL

PCIe Passthrough, VFIO, IOMMU and SR-IOV

Direct device assignment changes the boundary between a virtual machine and physical hardware. Instead of emulating every device operation, the hypervisor can expose a real PCIe function while the IOMMU constrains its access to memory. This is a central design choice for accelerated AI infrastructure.

Conceptual PCIe assignment and DMA translation architectureGuest driverPCIe BARs / DMA descriptorsQEMU + VFIOAssignment and mapping controlIOMMUIOVA → permitted host pagesPhysical PCIe functionGPU / NIC / NVMeHost memoryMapped guest backing pages

Conceptual relationships, not a literal PCIe transaction trace: the device initiates DMA through the IOMMU; QEMU and VFIO establish mappings rather than forwarding every DMA transaction.

01 — PCIe as an infrastructure fabric

PCI Express is a packet-based interconnect linking processors and devices through root complexes, switches and point-to-point links. Each PCI function is identified by a domain, bus, device and function number. Configuration space describes capabilities and Base Address Registers (BARs), which expose device registers or memory apertures. A GPU may expose multiple functions, including an audio function, that must be considered together when assigning hardware.

The guest sees a virtual PCI topology constructed by QEMU. With passthrough, accesses to selected device regions can be mapped directly while configuration operations remain mediated. Link generation and negotiated width constrain theoretical bandwidth, but real throughput also depends on payload sizes, topology, contention and device behaviour. A PCIe x16 slot is not proof of sixteen active lanes. Inspect the negotiated link and upstream topology before diagnosing accelerator performance.

02 — DMA and the IOMMU

Direct memory access allows a device to transfer data without the CPU copying each byte. A driver prepares descriptors and supplies device-visible addresses. The IOMMU translates those addresses into permitted physical memory locations, using translation structures associated with the device or its isolation domain. An invalid mapping can produce an IOMMU fault rather than allowing unrestricted access to host memory.

CPU memory translation and device DMA translation solve different problems. CPU page tables and EPT or NPT translate guest CPU accesses; the IOMMU handles device-originated accesses. In a common assignment model, QEMU establishes mappings from guest-visible DMA addresses to host pages backing guest RAM. With a virtual IOMMU, guest mappings can introduce additional translation and invalidation requirements. Exact behaviour depends on platform and kernel support. IOTLB caching reduces translation overhead, but mapping churn and invalidations can still affect latency.

03 — VFIO and safe device ownership

VFIO provides a userspace interface for controlled device access, interrupts and DMA mapping. A device assigned to a guest is normally detached from its ordinary host driver and bound to an appropriate VFIO driver. QEMU opens the device through the applicable VFIO interface, establishes mappings and exposes the function to the guest. Modern Linux also supports IOMMUFD-based management on compatible configurations; older deployments commonly use VFIO group and container interfaces.

IOMMU groups describe the minimum isolation granularity exposed by the platform. Functions in a group cannot simply be assumed to be independently secure. PCIe Access Control Services and upstream topology influence isolation, and peer-to-peer paths may bypass the intended translation boundary. Do not use ACS override patches or unsafe no-IOMMU modes as substitutes for genuine isolation. Review every function in the group and the platform documentation before assignment.

04 — Interrupts, reset and lifecycle

Modern PCIe devices commonly signal interrupts through MSI or MSI-X. VFIO and KVM can cooperate to deliver notifications to guest vCPUs without requiring every event to travel through a slow userspace path. Interrupt remapping, where supported, helps constrain device-generated interrupt messages. CPU affinity and interrupt placement can influence tail latency under heavy I/O.

A device must also be returned to a known state when a VM stops or restarts. Function Level Reset is useful where supported, but not every device implements a reliable independent reset. Bus resets can affect neighbouring functions. Test repeated guest shutdown and startup, error recovery and host reboot before production use. Ordinary live migration is not automatically available for assigned hardware; device-specific migration support and compatible destinations are required.

05 — SR-IOV: physical and virtual functions

Single Root I/O Virtualisation allows a capable physical function (PF) to expose multiple virtual functions (VFs). The PF manages shared hardware resources and configuration, while VFs appear as separate PCI functions that can be assigned to guests. A network adapter may provide dedicated queues and interrupt resources to each VF, reducing software switching overhead.

SR-IOV is not equivalent to unlimited dedicated hardware. VFs share link capacity, device firmware and internal resources. VLAN, MAC, spoof checking and rate policies depend on the adapter and driver. Traffic may bypass the ordinary host bridge, so security enforcement and observability must be designed explicitly. A GPU supporting a vendor-specific virtualisation solution is not necessarily a generic SR-IOV GPU. Verify the exact device, firmware, driver and licensing combination.

06 — AI accelerator data movement

An assigned GPU can run a native guest driver and expose CUDA capabilities supported by the hardware and software stack. Model weights may be read from storage into host-backed guest memory and transferred to GPU memory using DMA. The IOMMU constrains the mapped memory accessible to the device. Direct assignment reduces device emulation overhead, but does not eliminate all hypervisor scheduling, memory or PCIe costs.

For multi-GPU inference, topology matters as much as device count. GPUs on different root complexes or NUMA nodes may have less efficient communication paths. Peer-to-peer DMA, NVLink and GPUDirect RDMA require compatible hardware, drivers and virtualisation configurations; passthrough alone does not guarantee their availability. Benchmark actual collective communication and end-to-end inference latency instead of assuming bare-metal equivalence.

07 — Production architecture choices

Whole-device passthrough is attractive for a dedicated inference VM with predictable ownership. SR-IOV is useful for sharing capable network devices among multiple guests. Mediated GPU virtualisation or vendor vGPU offerings can provide different sharing and management properties, subject to support and licensing. MIG partitions supported GPUs into hardware-isolated compute and memory instances, but is not itself a general PCIe assignment mechanism.

Choose the mechanism according to isolation requirements, utilisation, operational flexibility and recovery objectives. Keep a management network independent of assigned data-plane devices. Reserve CPU and memory resources near the accelerator, and establish monitoring for PCIe errors, device health, IOMMU faults and application latency. Plan capacity for maintenance and failure rather than relying on transparent migration of a device-bound VM.

08 — Troubleshooting the complete path

Start with inventory and firmware support, then confirm that the host exposes the expected IOMMU groups. Check driver ownership and the VM configuration before investigating guest software. A missing guest device may indicate assignment or enumeration problems; a visible device with failed driver initialisation may indicate reset, firmware or compatibility issues. IOMMU faults suggest a mapping or device behaviour problem and should not be suppressed by disabling isolation.

For poor performance, compare negotiated PCIe width, NUMA placement, CPU scheduling and application workload characteristics. Establish a repeatable baseline with a known model, batch size and context length. Correlate host and guest metrics before changing configuration. Record the kernel, firmware, QEMU, guest driver and device versions so that results can be reproduced and regressions identified.

Engineering decision matrix

VirtIO

Portable virtual devices; software-mediated I/O; useful for management and general workloads.

Whole-device VFIO

Exclusive device ownership; native guest driver; hardware-dependent reset and migration.

SR-IOV VF

Hardware-backed sharing; adapter-specific policy and shared resource constraints.

Read-only host investigation

lspci -nnk
lspci -tv
lspci -vv -s 0000:01:00.0
find /sys/kernel/iommu_groups/ -type l
numactl --hardware
journalctl -k -b | grep -Ei 'iommu|dmar|amd-vi|vfio|aer'
virsh dumpxml VM_NAME

Replace the example PCI address and VM name with actual inventory values. Commands require the relevant utilities and may require elevated read permissions. No binding, reset or firmware changes are performed.

Engineering knowledge checkpoints

Why is EPT not sufficient for device DMA isolation?

EPT governs CPU memory translation. An IOMMU constrains device-originated DMA independently.

Can two functions in one IOMMU group always be assigned to different tenants?

No. The group represents the isolation granularity exposed by the platform; independent isolation cannot be assumed.

Does SR-IOV guarantee full physical link bandwidth to every VF?

No. VFs share physical device resources and link capacity.

Further engineering reading

Linux VFIO documentation · Linux PCI SR-IOV documentation · QEMU documentation

Network Insight · Educational architecture, not a live device assignment engine. Validate hardware, firmware and vendor support before deployment. Legal & Editorial Centre. Continue with Section 7 — Interactive (PAIES-VIRT-17), then Section 8 — Editorial.

NETWORK INSIGHT / ENGINEERING SIMULATOR 07

PCIe passthrough & the DMA journey

Follow a device-originated DMA request through a PCIe requester, an IOMMU domain and host memory. Configure assignment and deliberately break isolation prerequisites.

Execution architecture

01 · Guest driverPrograms device DMA descriptors
02 · Assigned PCIe functionPhysical function / VFIO
03 · PCIe fabricRequester ID + IOVA + operation
04 · IOMMU domainTranslation and permission checks
05 · Host memoryTranslated physical address
06 · CompletionRead completion or modeled write acceptance

Ready — configure and submit a DMA request.

Accepted DMA
0
IOMMU faults
0
Assignment blocked
0

Inspect the protection domain

IOVA pageHost physical pagePermission
0x10000xA000Read / write
0x20000xB000Read only
0x3000NoneDenied

Illustrative 4 KiB mappings. IOVA is a device-visible address, not necessarily a guest virtual address. VFIO establishes controlled access to assigned devices; the IOMMU enforces DMA mappings.

Ready.

Guided engineering investigations

Choose an investigation to load its configuration.

Production inspection

lspci -nnk
find /sys/kernel/iommu_groups/ -type l
ls -l /sys/bus/pci/devices/0000:03:00.0/driver
cat /sys/bus/pci/devices/0000:03:00.0/sriov_totalvfs
cat /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
sudo dmesg | grep -Ei 'DMAR|IOMMU|AMD-Vi|vfio'

Replace the example PCI address with the actual device address. SR-IOV attributes exist only where supported. These inspection commands do not change device assignment.

Engineering model and limitations

Whole-function passthrough assigns a PCIe function to a guest. SR-IOV exposes virtual functions provisioned by a physical function; each VF has its own requester identity. Real isolation depends on topology, ACS, platform firmware, device behavior and kernel configuration. The simulator intentionally refuses unsafe no-IOMMU assignment. It abstracts interrupt remapping, ATS, PASID, device reset, IOTLB behavior and nested translation. PCIe memory writes are posted transactions, so the final write stage represents acceptance in this model, not a PCIe completion TLP.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 08 · EDITORIAL

NVIDIA GPU Passthrough and AI Virtual Machines

A GPU-backed virtual machine combines a guest operating system boundary with direct access to an accelerator. The design challenge is not simply making CUDA work: it is preserving isolation, locality, predictable performance and recoverability throughout the device lifecycle.

GPU assignment and guest compute architectureGuest Linux + CUDAApplication / NVIDIA guest driverQEMU + KVM + VFIODevice assignment controlPCIe / IOMMUDMA mapping and isolationAssigned GPUCompute engines / VRAMHost NUMA memoryPinned guest backing pages

Conceptual relationships: the guest driver submits work to the assigned GPU; VFIO establishes device access and DMA mappings. The hypervisor does not relay every CUDA instruction.

01 · Choosing an accelerator ownership model

Whole-device passthrough dedicates a PCIe function to one guest at a time. The host cannot simultaneously use that function through its ordinary NVIDIA driver. This makes ownership relatively straightforward, but reduces scheduling flexibility. A virtual GPU solution instead exposes supported mediated or partitioned resources, subject to the GPU model, software stack and licensing. MIG partitions compute and memory resources on supported GPUs; MIG alone does not establish a VM assignment mechanism. Container GPU access shares the host kernel and driver and is a different isolation boundary.

Choose the model based on tenant trust, utilization, failure domains and supported lifecycle operations rather than assuming that every GPU supports every form of virtualization. A dedicated inference VM may be appropriate for a predictable service; a shared platform requires explicit resource and security policy.

02 · Host preparation and PCIe topology

Inventory the PCIe functions, NUMA nodes and IOMMU groups before assigning hardware. Enable supported CPU virtualization and IOMMU facilities in firmware and the host kernel. A GPU may expose additional functions, such as audio or USB controllers. Group viability depends on the platform isolation topology; all relevant functions must be safely managed. Do not bypass isolation with an ACS override merely to make assignment possible.

Reserve a separate management path and host display device where needed. Confirm that firmware, PCIe address space and the guest machine configuration accommodate the GPU BARs. Large BARs can require adequate 64-bit MMIO space. Verify reset support before committing to a production deployment.

03 · VFIO and guest driver ownership

The host binds the assigned function to a suitable VFIO driver rather than the normal host GPU driver. QEMU configures the virtual PCIe topology and device assignment through supported interfaces; KVM accelerates guest CPU execution. The IOMMU restricts device DMA to authorized mappings. Modern deployments may use IOMMUFD where supported, while older deployments use the VFIO group/container interface.

Inside the guest, the NVIDIA driver enumerates the GPU and provides CUDA access. The guest driver must support the physical device and the guest operating system. CUDA applications use compatible runtime and driver versions. For full passthrough, the host does not need to run CUDA on the assigned GPU. Virtual GPU products have different host and guest driver compatibility requirements.

04 · From model loading to CUDA execution

An inference server reads model weights from storage, prepares host buffers and transfers tensors to GPU memory. CUDA kernels execute on the GPU compute engines; data transfers may overlap compute when hardware and software permit. The guest driver manages command submission and synchronization. DMA can access mapped guest backing memory through the IOMMU.

GPU VRAM is distinct from guest RAM. A model that fits on disk may not fit in VRAM after accounting for weights, KV cache, runtime workspace and allocator overhead. Quantisation reduces some memory requirements but does not eliminate every buffer. Measure prefill and decode separately; they have different compute and memory behavior.

05 · NUMA locality and performance

On a multi-socket server, a GPU is attached to a particular PCIe root complex. Guest vCPU placement and host memory backing influence the cost of moving data to that GPU. Pinning vCPUs without matching memory placement can leave remote memory traffic unchanged or even worsen it. Reserve resources for emulator and I/O threads, and account for host housekeeping.

Benchmark the same model, precision, context length, concurrency and serving configuration on bare metal and in the VM. Compare throughput, time to first token, inter-token latency and tail latency. PCIe generation and negotiated width, memory bandwidth, CPU scheduling and storage throughput may all become bottlenecks. Passthrough does not guarantee identical performance to bare metal.

06 · Multi-GPU and distributed AI

A guest can receive multiple GPUs when the platform supports their assignment. GPU peer access depends on topology, hardware, driver and IOMMU configuration. NVLink connectivity does not guarantee that all peer-to-peer paths are available inside the guest. Inspect the topology and validate collective communication with representative workloads.

Distributed training and inference can also depend on RDMA-capable NICs. Assigning a NIC or virtual function introduces another device lifecycle and isolation boundary. GPUDirect RDMA and Storage require compatible hardware, drivers and topology; validate the actual supported combination rather than inferring support from the presence of a GPU.

07 · Security, reset and recovery

A passed-through GPU is a powerful DMA-capable device. IOMMU protection, interrupt remapping, firmware maintenance and supported device isolation are essential. Treat guest administrative access as a meaningful trust boundary. Keep hypervisor and management interfaces isolated from workload networks.

A guest reboot does not necessarily restore a GPU to a usable state. Device reset capabilities and driver behavior determine whether reassignment succeeds. Conventional live migration and snapshots cannot be assumed to preserve physical GPU execution state. Plan maintenance around service draining, checkpointing or replica replacement, and validate recovery on the actual hardware.

08 · Production deployment and troubleshooting

Begin with a supported single-GPU VM, confirm PCIe enumeration and driver initialization, then run a small CUDA workload before introducing a serving framework. Record the known-good host firmware, kernel, QEMU, guest driver and CUDA versions. Add monitoring for GPU memory, utilization, temperature, power and reported hardware errors.

If the guest cannot see the GPU, investigate assignment and PCIe enumeration first. If it sees the GPU but CUDA fails, inspect driver initialization and compatibility. If inference is slow, examine CPU locality, GPU memory pressure, negotiated PCIe link and application batching. Separate infrastructure failures from model-serving configuration failures. Reproduce the issue with a minimal workload before changing multiple layers.

Engineering field notes — read-only diagnostics

Run host commands on the hypervisor and guest commands inside the assigned VM. Availability depends on installed utilities and permissions.

Host:
lspci -nnk
find /sys/kernel/iommu_groups/ -type l
numactl --hardware
virsh dumpxml VM_NAME

Guest:
lspci -nnk
nvidia-smi
nvidia-smi topo -m
nvidia-smi -q

Engineering checkpoints

Can the host and guest use the same fully assigned PCIe function?

Not through ordinary simultaneous driver ownership. Supported sharing technologies require a different resource model.

Why can a GPU VM have high tail latency despite low GPU utilisation?

CPU scheduling, remote NUMA memory, storage, request queues and synchronization can delay work before it reaches the GPU.

Does MIG automatically enable GPU live migration?

No. Partitioning and migration are separate capabilities; consult the supported virtualization stack.

Further reading: Linux VFIO documentation · CUDA documentation · NVIDIA virtual GPU documentation.

Original educational editorial. Architecture is conceptual; verify hardware, driver, licensing and platform support before deployment. Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 08

NVIDIA GPU passthrough: from host PCIe to guest CUDA

Configure a dedicated GPU for a KVM virtual machine, validate isolation and follow an inference workload through guest memory, DMA and GPU execution. This is a conceptual simulator; it does not modify your computer.

Deployment and execution journey

Ready to validate.

Completed jobs
0
Failed attempts
0
Estimated model memory
—

Engineering event console

Guided investigations

Production inspection commands

Host: lspci -nnk
Host: find /sys/kernel/iommu_groups/ -type l
Host: virsh dumpxml ai-vm
Guest: lspci -nnk
Guest: nvidia-smi
Guest: nvidia-smi --query-gpu=memory.total,memory.used --format=csv

Verify platform support, firmware settings, PCIe topology, reset capability, all relevant functions and driver compatibility before assigning hardware. Whole-device passthrough is exclusive; mediated vGPU and supported SR-IOV configurations are separate technologies with hardware and software requirements. Never detach a GPU used by your host display without a recovery plan.

Model assumptions: weight memory is parameter count × nominal bytes per weight, plus a fixed illustrative 4 GiB runtime allowance. Actual quantisation metadata, KV cache, activations, batching and runtime overhead vary. Successful simulated execution does not guarantee hardware compatibility.

NETWORK INSIGHT / PRIVATE AI INFRASTRUCTURE / SECTION 09 · EDITORIAL

Building a Production Virtualised AI Infrastructure

From physical resources to a resilient AI service: a reference architecture for engineering, validating and operating GPU-backed Linux virtual machines.

Production reference architecture

Service ingress
Authenticated gateway · admission control · load balancing
AI virtual machines
Guest Linux · CUDA · model serving · workload identity
Virtualisation plane
QEMU · KVM · libvirt · CPU and memory placement
Data paths
VirtIO storage · TAP / OVS networking · VFIO device assignment
Physical infrastructure
NUMA CPUs · RAM · NVMe · NICs · IOMMU · GPUs

Cross-layer management and telemetry are independent of the illustrated service path. GPU DMA does not traverse the emulated VirtIO device path.

01 · Design the service before the cluster

A production platform begins with a workload contract: model size and precision, context distribution, concurrent requests, latency objectives, data classification and recovery requirements. A development VM that serves one model is not automatically a production service. Establish a baseline with representative prompts and measure time to first token, inter-token latency, request throughput and error rates. Separate prefill from decode when interpreting GPU utilisation.

Choose the smallest architecture that satisfies the contract. A single host can be a useful development platform but cannot survive host failure. A multi-host deployment needs independent failure domains, spare accelerator capacity and a tested method for recreating guest workloads. Document the assumptions and revisit them as demand changes.

02 · Physical host and NUMA architecture

Inventory CPU sockets, memory channels, PCIe root complexes, GPU placement, NICs and NVMe devices. A GPU assigned to a guest is still attached to a physical PCIe hierarchy. Place the guest vCPUs and memory near its assigned GPU where practical, and account for network and storage locality as well. Reserve CPU and memory for the host, emulator threads and I/O processing.

Pinning every vCPU without considering sibling threads, interrupts or host housekeeping can make performance worse. Huge pages may reduce translation overhead, but require capacity planning and can constrain placement. Establish explicit resource reservations for latency-sensitive guests and benchmark before introducing oversubscription.

03 · KVM and QEMU lifecycle

Use a supported Linux distribution, KVM, QEMU and a management layer such as libvirt. Keep guest definitions, firmware configuration, network policies and storage mappings in version-controlled infrastructure definitions without embedding credentials. Validate CPU feature compatibility and guest firmware before deployment.

A VM template should contain a reproducible operating system baseline, not a copied production identity. Provision unique credentials, machine identities and network settings. Apply host and guest updates through separate maintenance procedures. A passed-through GPU can restrict live migration; use service-level failover or cold restart unless the complete device and software stack explicitly supports migration.

04 · Network architecture and isolation

Separate management, tenant application, storage and accelerator fabric traffic according to the threat model and performance requirements. A Linux bridge or Open vSwitch can connect guest TAP interfaces to physical uplinks. OVS can apply flow policies and overlay encapsulation; VLANs and VXLANs provide segmentation but are not substitutes for authentication or encryption.

Design MTU consistently across guest, virtual switch, tunnel and underlay. Reserve capacity for storage and model distribution so bulk transfers do not overwhelm inference traffic. SR-IOV can reduce software forwarding overhead but may bypass host-switch visibility and policy enforcement. Verify where filtering, telemetry and rate control actually occur.

05 · Storage and model distribution

Use VirtIO-backed block or SCSI devices for guest operating systems and appropriate shared or local storage for model artifacts. Separate durable application state from replaceable model caches. Store model versions, hashes and provenance alongside deployment manifests. Measure cold model loading independently from steady-state inference.

A fast NVMe drive does not guarantee fast end-to-end loading: filesystem, virtual queues, CPU copies and network throughput may dominate. Direct device assignment trades management flexibility for a more direct data path. Verify backup consistency, restore procedures and storage failure behavior rather than assuming a VM snapshot protects every attached device.

06 · Accelerator allocation and model serving

Assign a supported GPU function through VFIO only after checking IOMMU group isolation, firmware and reset behavior. Install compatible guest drivers and validate CUDA with a minimal workload before introducing a model server. Full passthrough, mediated vGPU and MIG-based configurations have different isolation, scheduling and licensing properties.

Budget device memory for weights, KV cache, runtime allocations and fragmentation. For example, 8 billion parameters at two bytes each require about 16 GB of raw weight storage before overhead. Quantisation may reduce weight memory but does not automatically reduce every other allocation. Measure actual memory use under representative context lengths and concurrency. Keep admission limits and queue backpressure explicit.

07 · Security and operational governance

Treat the hypervisor as a privileged trust boundary. Restrict management access, require authenticated administrative sessions and protect VM images and configuration repositories. Use supported IOMMU isolation; do not rely on unsafe ACS overrides to manufacture device isolation. Apply guest-level workload identity, least privilege and tenant-specific authorization independently of network segmentation.

Model-serving APIs need authentication, request limits and appropriate audit records. Retrieval and agent services must enforce authorization at the data and tool boundaries, not merely in prompts. Avoid collecting sensitive prompts or credentials in logs. Define retention, access controls and incident response procedures for telemetry.

08 · Observability and incident response

Correlate service latency with guest CPU steal time, host scheduling, NUMA allocation, virtual NIC drops, storage queue latency and GPU memory pressure. A healthy GPU does not prove a healthy request path. Track request identifiers across gateway and serving layers, and use histograms for latency rather than averages alone.

When tail latency rises, compare against a known-good workload and isolate the first failing layer. Check host resource contention before changing model parameters. If a guest loses GPU access, distinguish PCIe enumeration, driver initialization and application allocation failures. Preserve diagnostic evidence before rebooting; follow a documented escalation and rollback procedure.

09 · Availability and production acceptance

Deploy in stages: validate hardware, create the host baseline, establish network and storage, provision a guest, validate the accelerator, deploy a model and finally exercise the complete service. Each stage needs an acceptance test and a rollback boundary. Use controlled load tests and verify tenant isolation before opening access.

Define recovery time and recovery point objectives for each stateful component. Maintain spare capacity and route traffic away from unhealthy instances. Test restoration from backups and host failure, including the time required to reload model weights. A production platform is ready when its operators can demonstrate predictable service behavior and recovery, not simply when the first inference request succeeds.

Engineering field notes — read-only diagnostics

Run on the appropriate host or guest; commands require installed tools and permissions. Replace VM_NAME with the actual domain name.

Host:
virsh list --all
virsh domstats VM_NAME
virsh dumpxml VM_NAME
numactl --hardware
lspci -nnk
ovs-vsctl show
ip -s link

Guest:
lscpu
free -h
lsblk
nvidia-smi
nvidia-smi topo -m

Production acceptance gates

Compute

Guest CPU and memory placement validated

Network

Tenant isolation and MTU verified

Storage

Model integrity and restore tested

GPU

Driver and representative workload validated

Service

Latency and throughput objectives met

Recovery

Host failure and service restoration exercised

Engineering checkpoints

Can a GPU passthrough VM always live migrate?

No. Device state migration requires explicit support across hardware, drivers and hypervisor. Design service failover independently.

Does low GPU utilisation prove spare service capacity?

No. CPU contention, request queues, memory bandwidth and I/O may be limiting throughput.

Does a VLAN guarantee tenant authorization?

No. Network segmentation must be complemented by authenticated identities and application-level access controls.

Further reading: Linux KVM documentation · libvirt · Open vSwitch · NVIDIA documentation.

Original educational editorial. Reference architecture is conceptual; validate platform compatibility, security and performance before production deployment. Legal & Editorial Centre.

NETWORK INSIGHT / ENGINEERING SIMULATOR 09 / CAPSTONE

Private AI infrastructure deployment command centre

Build a virtualised inference service and diagnose failures across compute, memory, storage, networking and GPU assignment. This educational model does not execute host commands or measure real hardware.

Deployment configuration

End-to-end deployment journey

Ready.

Engineering event console

Capstone investigations

Read-only production inspection commands

lscpu
numactl --hardware
virsh vcpupin ai-vm
virsh domblklist ai-vm
ip -br link
bridge vlan show
ovs-vsctl show
lspci -nnk
find /sys/kernel/iommu_groups/ -type l
# Inside the guest:
nvidia-smi
lsblk
ip route

Commands require the relevant tools and permissions. Replace ai-vm with your actual domain name. A successful simulation is not proof of production readiness.

Model assumptions: host guest-memory budget 128 GiB; GPU estimate = weights + 15% overhead + 2 GiB. Real KV cache, runtime buffers, NUMA topology, driver compatibility and device reset behaviour vary. No actual inference or security validation is performed.

☕
Support Network Insight
Help support the development of interactive networking labs, BGP simulations, and educational content.
Support the Project
Matt Conran
Tags: No tags

Comments are closed.