ipaqmaster / vfio

A script for easy pci and usb passthrough along with disks, iso's and other useful flags for quick tinkering with less of a headache. I use it for VM gaming and other PCI/LiveCD/PXE/VM/RawImage testing given the script's accessibility.
GNU General Public License v3.0
189 stars 11 forks source link

VBIOS for nvidia GPUs #3

Closed alex9099 closed 4 years ago

alex9099 commented 4 years ago

Hi,

My gpu seems to need the VBIOS to be loaded on the VM start, any way to insert it with this script? perhaps something i'm missing

Command on dry run is:

-machine q35,accel=kvm,kernel_irqchip=on -enable-kvm -m 16407844K -cpu host,kvm=off -smp sockets=1,cores=8,threads=2 -drive file=/dev/sdb,id=disk -bios /usr/share/ovmf/x64/OVMF_CODE.fd -cdrom /mnt/hdd/Win10.iso -nographic -vga std
Net : -device virtio-net,netdev=network0 -netdev user,id=network0
USB : 
PCI :  -device vfio-pci,host=0000:09:00.0,id=hostdev0 -device vfio-pci,host=0000:09:00.1,id=hostdev1

Line 127 also complains about a write error: non existent device, not sure if that would be related

I'm on arch linux

ipaqmaster commented 4 years ago

On line 127 it tries to unbind the EFI framebuffer to prevent mmap issues when passing the GPU through. If your setup doesn't use one that's fine.

Unfortunately I haven't implemented a VBIOS flag or function for this script yet. It is on the list of things to do though.

Could you share what you're doing to handle your VBIOS step?

alex9099 commented 4 years ago

I am using libvirtd, Not sure if that would help, but here is the XML https://paste.ubuntu.com/p/Z8fKS4xVph/

The GPU part

<hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>
      </source>
      <rom bar="on" file="/mnt/hdd/bios.rom"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
    </hostdev>

I dumped the vbios using these steps https://01.org/linuxgraphics/documentation/development/how-dump-video-bios

According to arch wiki it should be a matter of -device vfio-pci,host=07:00.0,......,romfile=/path/to/your/gpu/bios.bin(https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#UEFI_(OVMF)_compatibility_in_VBIOS)

ipaqmaster commented 4 years ago

It's true the 1000 series needs VBIOS dumps however I can't add it to the script, at least right now. But I'll keep a tab on this for future in case it's something I can automate in the script (Safely).