Skip to content

Share one GPU across VMs (vGPU / SR-IOV)

Unlike whole-card GPU passthrough (1 GPU → 1 VM), SR-IOV vGPU slices a single Intel GPU into several Virtual Functions (VFs), each of which can be passed to a different VM. This is what makes GPU-accelerated VDI practical on a handful of cards.

The console does the node setup for you

You do not SSH into the node to enable SR-IOV, install a kernel, or set boot flags. Tag the cluster as a vGPU cluster and MFCloud performs the whole node-side setup automatically — at Add Host time and via a retry button. The only thing the console can't do for you is toggle BIOS settings.

What gets automated

When a host joins a cluster tagged GPU Mode: vGPU, the console:

Step What it does Done by
OS gate Refuses to onboard a host that isn't Rocky/RHEL/Alma/CentOS/OL 10.2+ (the Xe SR-IOV driver requirement). Add Host
Mainline kernel Installs ELRepo kernel-ml (7.x) and makes it the default boot entry — the Xe SR-IOV fixes land there first. Add Host / retry
pci=realloc Adds it to every installed kernel so a resized GPU BAR can't starve the VFs of MMIO space. Add Host / retry
Enable VFs Writes the card's max VF count to sriov_numvfs. Add Host / retry
Persist VFs Installs a systemd unit so the VFs come back automatically after every reboot — no re-clicking. Add Host / retry
pciutils Installs lspci so the PCI passthrough picker can see the VFs. Add Host

1. Create (or tag) a vGPU cluster

Infrastructure → Clusters → New Cluster (or edit an existing one) and tick GPU Mode → vGPU. All hosts in this cluster must be Rocky 10.2+.

2. Set two BIOS options on the node (the only manual step)

The console cannot reach firmware. On each GPU node, in BIOS, enable:

  • Above 4G Decoding
  • Re-Size BAR Support (Resizable BAR)

Without these, the VFs can't get address space and enabling SR-IOV fails with a memory error. (On AMD platforms this is usually under AMD CBS → NBIO Common Options; the platform-level SR-IOV Support toggle, if present, should also be on.)

3. Add the host

Hosts → Add Host, placing it into the vGPU cluster. Watch the deployment log — you'll see the kernel, pci=realloc, VF-enable, and persistence steps run.

Reboot once for the new kernel

The mainline kernel and pci=realloc only take effect after a reboot. Reboot the node, then click Enable vGPU SR-IOV on Nodes on the cluster page to confirm the VFs came up (they will also auto-persist on every reboot from now on).

4. Retrofit existing hosts

Already onboarded the host before tagging the cluster? Open the cluster and click Enable vGPU SR-IOV on Nodes. It runs the same idempotent steps (kernel, pci=realloc, VF enable + persist) on every active node — safe to re-run.

5. Attach a VF to a VM

In Deploy VM or VM Settings → Hardware Passthrough, the picker now labels the SR-IOV devices:

  • vGPU Virtual Functionthis is what you attach to a guest. Each VF goes to a different VM.
  • Physical Function — do NOT attach — the PF manages the VFs. The picker disables it because attaching the PF to a VM destroys every VF on the card.

As with any passthrough, the VM must be Q35 + UEFI and powered off to change the device set. Windows guests also need the VirtIO/GPU drivers — see Install a Windows VM.

How many VMs can share one card?

The number of VFs is fixed in the GPU's firmware (sriov_totalvfs) — it is not something the kernel, a config flag, or smaller per-VM VRAM can raise. To run more simultaneous vGPU VMs, add more physical GPUs. By default the card's VRAM is split evenly across its VFs.

Troubleshooting

Symptom Cause & fix
Add Host refuses the node ("below vGPU minimum") The host OS is older than 10.2, or isn't an EL10 family. vGPU clusters require Rocky/RHEL/Alma/CentOS/OL 10.2+.
VF-enable step fails with a memory / ENOMEM error Above 4G Decoding and/or Resizable BAR is off in BIOS. Enable both, reboot, then Enable vGPU SR-IOV on Nodes.
VFs are missing after a node reboot The persistence unit should restore them; if not, re-run Enable vGPU SR-IOV on Nodes and confirm the node is on the mainline kernel (uname -r ≥ 7).
Passthrough picker is empty on a known-good node lspci/pciutils missing (older onboarding). Re-run Repair Worker, or just re-Add the host into the vGPU cluster.
All VFs vanished after attaching a GPU to a VM The Physical Function was attached instead of a VF. Power off the VM, detach it, re-run Enable vGPU SR-IOV on Nodes, and attach a ✅ Virtual Function this time.