Introduction
GPU passthrough (PCI passthrough) lets you assign a physical GPU directly to a VM, giving it near-native performance. This is essential for machine learning workloads, video transcoding, gaming VMs, and GPU-accelerated applications. Proxmox supports this via IOMMU/VT-d.
Requirements
- CPU: Intel VT-d or AMD-Vi (IOMMU support in BIOS)
- Motherboard: IOMMU enabled in BIOS
- GPU: Secondary GPU (can't pass through the GPU used for Proxmox display)
- Linux kernel 5.x+ (Proxmox 7+ uses kernel 5.15)
Step 1: Enable IOMMU in GRUB
BASH
# Edit GRUB config
nano /etc/default/grub
# For Intel CPU:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"
# For AMD CPU:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
# Update GRUB
update-grub
# Reboot
rebootStep 2: Verify IOMMU is Working
BASH
# Should show IOMMU enabled
dmesg | grep -e IOMMU -e iommu
# List IOMMU groups (GPU must be in its own group)
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
doneIf your GPU shares an IOMMU group with other devices, you'll need the ACS Override Patch (or a different slot/motherboard).
Step 3: Load VFIO Modules
BASH
# Add modules
echo "vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd" >> /etc/modules
# Blacklist GPU drivers (so host doesn't grab the GPU)
echo "blacklist nouveau
blacklist nvidia
blacklist radeon
blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf
# Apply
update-initramfs -u -k all
rebootStep 4: Find GPU PCI IDs
BASH
# Find your GPU
lspci -nn | grep -E "VGA|Audio" | grep -i "nvidia|amd|radeon"
# Example output:
# 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation RTX 3090 [10de:2204]
# 01:00.1 Audio device [0403]: NVIDIA Corporation GA102 HD Audio [10de:1aef]Note the IDs: 10de:2204 and 10de:1aef
Step 5: Bind GPU to VFIO
BASH
# Create VFIO conf
echo "options vfio-pci ids=10de:2204,10de:1aef" > /etc/modprobe.d/vfio.conf
# Update initramfs
update-initramfs -u
rebootStep 6: Verify GPU is Bound to VFIO
BASH
lspci -k | grep -A3 "01:00"
# Should show:
# Kernel driver in use: vfio-pci
# NOT: nvidia or nouveauStep 7: Configure VM for GPU Passthrough
In Proxmox UI → VM → Hardware → Add → PCI Device:
- Select your GPU (01:00.0)
- Check: All Functions (includes audio)
- Check: ROM-Bar
- Check: PCI-Express
- Primary GPU: Yes (if no other display adapter)
Or via CLI:
BASH
# Add to VM config
echo "hostpci0: 01:00,pcie=1,rombar=1,x-vga=1" >> /etc/pve/qemu-server/VM_ID.conf
# Complete VM config example
nano /etc/pve/qemu-server/200.confINI
name: gpu-vm
memory: 32768
sockets: 1
cores: 16
cpu: host
machine: q35
bios: ovmf # Required for UEFI + GPU
efidisk0: local-zfs:vm-200-disk-0,efitype=4m
scsi0: local-zfs:vm-200-disk-1,size=200G
net0: virtio=AA:BB:CC:DD:EE:FF,bridge=vmbr0
hostpci0: 01:00,pcie=1,rombar=1,x-vga=1 # GPU
args: -cpu host,hidden=1,hv_vendor_id=NvidiaHack # Hide VM from NVIDIA driverNVIDIA Driver Notes
NVIDIA drivers detect if they're running in a VM (error 43 in Windows). To fix:
BASH
# Add to VM config
args: -cpu host,hidden=1,hv_vendor_id=NvidiaFTWVerifying in the VM
After booting the Windows/Linux VM:
BASH
# Linux: verify GPU is visible
nvidia-smi # Should show GPU name and memory
# Run GPU benchmark
glxgears
nvidia-smi dmon -s u # Monitor GPU utilizationTroubleshooting
BASH
# GPU not appearing in VM
dmesg | grep vfio # Check VFIO bound properly
dmesg | grep "IOMMU group"
# NVIDIA error 43 in Windows
# Add hv_vendor_id to args in VM config
# VM won't start with GPU
# Check IOMMU group — no other devices should share the group
# or use ACS override
# Performance not native
# Ensure CPU type is "host" not "kvm64"
# Enable hugepages for the VM