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
Command
Description
Action
lspci -nn | grep -i nvidia
List NVIDIA PCI devices
lspci -nn | grep -i vga
List all VGA compatible devices
lspci -nn | grep -i amd
List AMD PCI devices
lspci -nnk | grep -A3 VGA
List VGA devices with kernel drivers
lspci -v -s <PCI_ID>
Show detailed info for specific PCI device
VFIO Configuration
Command
Description
Action
dmesg | grep -i vfio
Check VFIO module messages
cat /etc/modprobe.d/vfio.conf
Review VFIO passthrough configuration
ls -la /etc/modprobe.d/
List all modprobe configuration files
cat /etc/modules
Show modules loaded at boot time
lsmod | grep vfio
Check if VFIO modules are loaded
IOMMU Configuration
Command
Description
Action
cat /etc/default/grub
Review GRUB options for IOMMU
update-grub
Apply GRUB changes
dmesg | grep -i iommu
Check IOMMU messages in kernel log
dmesg | grep -e DMAR -e IOMMU
Check DMAR and IOMMU messages
find /sys/kernel/iommu_groups/ -type l | sort -V
List IOMMU groups
System Updates
Command
Description
Action
update-initramfs -u
Apply initramfs changes (VFIO)
update-initramfs -u -k all
Update initramfs for all kernels
cat /proc/cmdline
Show current kernel boot parameters
VM Configuration
Command
Description
Action
qm config <vmid> | grep hostpci
Show PCI passthrough config for a VM
qm set <vmid> -hostpci0 <PCI_ID>,pcie=1,x-vga=1
Add GPU passthrough to a VM
cat /etc/pve/qemu-server/<vmid>.conf
View VM configuration file
qm set <vmid> -machine q35
Set VM to use Q35 chipset (recommended for passthrough)
qm set <vmid> -bios ovmf
Set 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")