tips:gpu

This is an old revision of the document!


GPU

  • Install ovfm

Edit /etc/libvirt/qemu.conf

Uncomment:

nvram = [ “/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd” ]

/etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
update-initramfs -u

Create VM and customize configuration before start:

  • In the “Overview” section, set your firmware to “UEFI”
  • In the “Processor” section write CPU model to “host-passthrough”
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...


<features>
	<hyperv>
		...
		<vendor_id state='on' value='123456789ab'/>
		...
	</hyperv>
	...
	<kvm>
	<hidden state='on'/>
	</kvm>
</features>

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <rom file='/opt/Palit.GTX750Ti.2048.140702.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </hostdev>

...
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-vga=on'/>
  </qemu:commandline>
</domain>


  • tips/gpu.1479850304.txt.gz
  • Last modified: 2016/11/22 22:31
  • by scipio