Skip to content

PCI Express VM Passthrough

Is about PCIe passthrough In VM like Proxmox or TrueNAS

Notes

  • Disable ASPM to start with
  • Connect a display or an dummy plug to the video card

Useful commands

  • dmesg -w too show hardware initialization errors
  • lspci to list PCIe devices
    • -k to show driver in use
    • lspci -nnv | grep VGA to show list of display adapter

Display IOMMU groups

#!/bin/bash
shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
    echo "IOMMU Group ${g##*/}:"
    for d in $g/devices/*; do
        echo -e "\t$(lspci -nns ${d##*/})"
    done;
done;

Dump vBIOS

lspci -nnv #to get the PCI address
cd /sys/bus/pci/devices/0000:01:00.0/
echo 1 > rom
cat rom > /tmp/image.rom
echo 0 > rom

Notes: - If you have an "input/output error", check if UEFI CSM is enabled (Legacy mode)

Blacklist modules

  • with GRUB, add the required options