Skip to content

Instantly share code, notes, and snippets.

@cupcakearmy
Created June 23, 2019 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cupcakearmy/dfd0fbbefa2f60517d523c48d84fc37d to your computer and use it in GitHub Desktop.
Save cupcakearmy/dfd0fbbefa2f60517d523c48d84fc37d to your computer and use it in GitHub Desktop.
Qemu GPU Guide
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Prerequisites
# DL
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
# Enable IOMMU
vim /etc/default/grub
intel_iommu=on
grub-mkconfig -o /boot/grub/grub.cfg
reboot
# Check IOMMU
dmesg | grep -i -e DMAR -e IOMMU
# Check Groups
#!/bin/bash
shopt -s nullglob
for g in /sys/kernel/iommu_groups/*; do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done;
#10de:1b06,10de:10ef
# vfio-pci
vim /etc/modprobe.d/vfio.conf
options vfio-pci ids=10de:1b06,10de:10ef
vim /etc/mkinitcpio.conf
MODULES=(... vfio_pci vfio vfio_iommu_type1 vfio_virqfd ...)
HOOKS=(... modconf ...)
mkinitcpio -p linux419
reboot
# Check
dmesg | grep -i vfio
lspci -nnk
# Install
pacman -Syu qemu libvirt ovmf virt-manager ebtables dnsmasq
vim /etc/libvirt/qemu.conf
nvram = [
"/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd"
]
systemctl enable --now libvirtd.service
systemctl enable --now virtlogd.socket
virshpatcher --error43 --host-passthrough --vendor-id ab1234567890 <vm name>
add <ioapic driver='kvm'/> to the <features> node with virsh edit <vm name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment