Created
December 17, 2015 11:40
-
-
Save anonymous/700c83313d943f3bd6a7 to your computer and use it in GitHub Desktop.
My partially broken OVMF GPU passthrough notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmdline: | |
hugepages=2048 | |
intel_iommu=on,igfx_off,pt | |
rd-driver-pre=vfio-pci | |
vfio-pci.ids=10de:1380,10de:0fbc,1002:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,1002:ffffffff:ffffffff:ffffffff:00040300:ffffffff,10de:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,10de:ffffffff:ffffffff:ffffffff:00040300:ffffffff | |
vfio-pci.disable_vga=1 (OVMF way, optional) | |
#i915.enable_hd_vgaarb=1 (Legacy way) | |
#kvm_intel.emulate_invalid_guest_state=0 (optional) | |
#kvm.ignore_msrs=1 (optional) | |
add these modules to initramfs (/etc/initramfs-tools/modules on debian): | |
vfio | |
vfio_iommu_type1 | |
vfio_pci | |
vfio_virqfd | |
ensure early vfio-pci binding: ... | |
script example: | |
#!/bin/bash | |
VDIR=/mnt/hdd/virt | |
MON=/tmp/qemu-monitor | |
cd $VDIR | |
mkfifo $MON.in $MON.out | |
sudo qemu-system-x86_64 -nodefaults -nodefconfig \ | |
-monitor pipe:$MON \ | |
-enable-kvm -m 2048 -cpu host,kvm=off \ | |
-smp 4,sockets=1,cores=4,threads=1 \ | |
-drive if=pflash,format=raw,readonly,file=ovmf_code_x64.bin \ | |
-drive if=pflash,format=raw,file=ovmf_vars_x64.bin \ | |
-drive file=install.iso,if=none,id=drive-cd-0,format=raw \ | |
-device ide-cd,drive=drive-cd-0,unit=0,bus=ide.1 \ | |
-drive | |
if=ide,id=drive-hd-0,file=drive.img,format=raw,cache=none,aio=native \ | |
-device vfio-pci,host=01:00.0 -device vfio-pci,host=01:00.1 \ | |
-vga none -nographic | |
rm -f $MON.in $MON.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment