Back to Help and Info

GPU Passthrough Commands

This section provides commands for configuring and managing GPU passthrough in Proxmox VE. Learn how to identify GPU devices, configure VFIO and IOMMU, and set up VMs for GPU passthrough.

Device Identification

CommandDescriptionAction
lspci -nn | grep -i nvidiaList NVIDIA PCI devices
lspci -nn | grep -i vgaList all VGA compatible devices
lspci -nn | grep -i amdList AMD PCI devices
lspci -nnk | grep -A3 VGAList VGA devices with kernel drivers
lspci -v -s <PCI_ID>Show detailed info for specific PCI device

VFIO Configuration

CommandDescriptionAction
dmesg | grep -i vfioCheck VFIO module messages
cat /etc/modprobe.d/vfio.confReview VFIO passthrough configuration
ls -la /etc/modprobe.d/List all modprobe configuration files
cat /etc/modulesShow modules loaded at boot time
lsmod | grep vfioCheck if VFIO modules are loaded

IOMMU Configuration

CommandDescriptionAction
cat /etc/default/grubReview GRUB options for IOMMU
update-grubApply GRUB changes
dmesg | grep -i iommuCheck IOMMU messages in kernel log
dmesg | grep -e DMAR -e IOMMUCheck DMAR and IOMMU messages
find /sys/kernel/iommu_groups/ -type l | sort -VList IOMMU groups

System Updates

CommandDescriptionAction
update-initramfs -uApply initramfs changes (VFIO)
update-initramfs -u -k allUpdate initramfs for all kernels
cat /proc/cmdlineShow current kernel boot parameters

VM Configuration

CommandDescriptionAction
qm config <vmid> | grep hostpciShow PCI passthrough config for a VM
qm set <vmid> -hostpci0 <PCI_ID>,pcie=1,x-vga=1Add GPU passthrough to a VM
cat /etc/pve/qemu-server/<vmid>.confView VM configuration file
qm set <vmid> -machine q35Set VM to use Q35 chipset (recommended for passthrough)
qm set <vmid> -bios ovmfSet VM to use UEFI/OVMF (required for GPU passthrough)

GPU Passthrough Tips

  • Replace <PCI_ID> with your GPU's PCI ID (e.g., 01:00.0)
  • Replace <vmid> with your VM's ID
  • For IOMMU to work, you need to enable it in BIOS/UEFI (look for settings like "VT-d", "AMD-Vi", or "IOMMU")
  • Common GRUB parameters for IOMMU:
    • For Intel: intel_iommu=on
    • For AMD: amd_iommu=on
    • Additional options: iommu=pt video=efifb:off video=vesa:off
  • After making changes to GRUB or modprobe configurations, run update-grub and update-initramfs -u, then reboot