Jump to content

KVM + XBMCBuntu + GPU Passthrough = WIN


johnodon

Recommended Posts

I am currently streaming one of the highest birtrate scenes in Avatar (~32Mbit bdrip MKV) to two separate XBMCBuntu VMs.  Each VM has a dedicated Radeon HD6450, only 1 CPU (1 socket/1 core) and only 1GB of RAM.

 

Both are playing without a single hiccup and each is utilizing only ~20% CPU and ~20% memory (both flux within a few %).  Best part...I'm still dealing with NFS as I have not yet fully figured out 9p sharing.

 

THIS IS FRIGGIN AWESOME!  I will never look back at ESXi again!

 

(sorry for the bad pic!)

 

Mwkh8uI.jpg?1

Link to comment

 

Goddammit, I'm jealous.

 

Show off :)

 

Can we have a peek at your xml pls?

 

<domain type='kvm' id='9' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>HTPCFAMRM</name>
  <uuid>c43b7542-b40b-495f-90ab-aaa4eec68e8a</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='native'/>
      <source file='/mnt/cache/VMs/HTPCFAMRM.qcow2'/>
      <backingStore/>
      <target dev='vdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Images/xbmcbuntu-13.0~gotham_amd64.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb0'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb0'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:94:00:d0:c0:dc'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </interface>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x20a0'/>
        <product id='0x0001'/>
        <address bus='6' device='2'/>
      </source>
      <alias name='hostdev0'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=83:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=83:00.1,bus=pcie.0'/>
  </qemu:commandline>
</domain>

Link to comment

 

I just got mine working too  :D

 

I tried XBMC in Win8 but it stuttered alot and I kept losing sound (from the VM in general, just XBMC). I'm sure I could have messed around with it but this was so easy I don't think i'll bother going back

 

Thanks for the template johnodon

 

It's funny...if it wasn't for Microsoft, I pretty much wouldn't have a tech career.  Nowadays, I LOATHE Windows (especially as an HTPC).  Compared to anything linux, it is such a friggin pig!  There is no way in hell I would ever try to run XBMC on WIN7/WIN8 with 1 CPU and 1GB of RAM.  :D

 

John

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...