"Locating the GPU":
https://clayfreeman.github.io/gpu-passthrough/#locating-the-... : for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done;
iommu.sh gist:
https://gist.github.com/Roliga/d81418b0a55ca7682227d57af2778...iommu_groups.sh:
https://github.com/drewmullen/pci-passthrough-ryzen/blob/mas... : lspci -nns "${d##*/}"
"PCI passthrough via OVMF > 2. Setting up IOMMU > 2.2 Ensuring that the groups are valid": https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#En... :> An IOMMU group is the smallest set of physical devices that can be passed to a virtual machine. For instance, in the example above, both the GPU in 06:00.0 and its audio controller in 6:00.1 belong to IOMMU group 13 and can only be passed together. The frontal USB controller, however, has its own group (group 2) which is separate from both the USB expansion controller (group 10) and the rear USB controller (group 4), meaning that any of them could be passed to a virtual machine without affecting the others. "Exporting your ROM": https://github.com/BigAnteater/KVM-GPU-Passthrough?tab=readm... : lspci -vnn
find /sys/devices -name rom
# PATH_TO_ROM=
echo 1 > $PATH_TO_ROM
mkdir -p /var/lib/libvirt/vbios/
cat $PATH_TO_ROM >
/var/lib/libvirt/vbios/gpu.rom
echo 0 > $PATH_TO_ROM
"Attaching the GPU" [with `virsh`] https://clayfreeman.github.io/gpu-passthrough/#attaching-the... : <hostdev mode='subsystem' type='pci' managed='yes'>
<rom file='/path/to/gpu-dump.rom'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</source>
</hostdev>
"Adding your GPU and USB devices to the VM" [with `virt-manager`]:
https://github.com/BigAnteater/KVM-GPU-Passthrough?tab=readm...> 1. Add every PCI device which has to do with your graphics card to the VM. |