Ubuntu 14.04 server GPU passthrough and disabling default graphics....


Recommended Posts

I'm looking to build a kodi VM based from a script that runs on a 14.04 server installation.

 

I have had a success in passing the graphics card and audio on the graphics card through to the KVM VM and they both appear in lspci within the VM itself.

 

However when I run the script it complains i'm using a virtual graphics card and bombs out.

 

How do I disable the virtual graphics card completely ?

Link to comment

What i've done thus far, currently I don't have the VM up and running but to pass through i used the following.

 

lspci -k output on unraid command line...

 

07:00.0 VGA compatible controller: AMD/ATI [Advanced Micro Devices, Inc.] Caicos [Radeon HD 6450]
Subsystem: Hightech Information System Ltd. Device 2311
Kernel driver in use: vfio-pci
07:00.1 Audio device: AMD/ATI [Advanced Micro Devices, Inc.] Caicos HDMI Audio [Radeon HD 6400 Series]
Subsystem: Hightech Information System Ltd. Device aa98
Kernel driver in use: vfio-pci

 

after putting

#bindpci
/usr/local/sbin/vfio-bind 0000:07:00.0 0000:07:00.1

in go file

 

 

and I put the following inbetween </devices> and </domain>

 

<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=07:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
      <qemu:arg value='-device'/>
      <qemu:arg value='vfio-pci,host=07:00.1,bus=pcie.0'/>/>
   </qemu:commandline>

 

 

 

Link to comment

I'm looking to build a kodi VM based from a script that runs on a 14.04 server installation.

 

I have had a success in passing the graphics card and audio on the graphics card through to the KVM VM and they both appear in lspci within the VM itself.

 

However when I run the script it complains i'm using a virtual graphics card and bombs out.

 

How do I disable the virtual graphics card completely ?

 

Can you share your complete XML for the VM?

 

There should be a section in there for <graphics> and <video>.  You can remove those sections completely.

Link to comment

I'm looking to build a kodi VM based from a script that runs on a 14.04 server installation.

 

I have had a success in passing the graphics card and audio on the graphics card through to the KVM VM and they both appear in lspci within the VM itself.

 

However when I run the script it complains i'm using a virtual graphics card and bombs out.

 

How do I disable the virtual graphics card completely ?

 

Can you share your complete XML for the VM?

 

There should be a section in there for <graphics> and <video>.  You can remove those sections completely.

 

I used the default "other" xml , force stopped the vm before installation, then added in the passthrough stuff, changed the boot back to cd and restarted the VM

Link to comment

Give me a little while to re-setup the VM.

 

Yeah so the default VM that gets created from the plugin right now will add a section for <graphics> and <video> which specifies a virtual graphics adapter.  These will ALWAYS take the primary display role over any physical GPUs you pass through.  Sometimes you can get away with it, but most of the time you can't.  If you don't remove those two sections from the XML, it won't work.

 

That said, I wouldn't waste too much time on this.  We are VERY close to releasing another beta with a new VM manager that will make setting this up a breeze.

Link to comment

I took those sections out and now it won't start, lol.

 

 

here's the xml, was i over zealous on pruning and took out too much ?

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>KODI-Unraid</name>
  <uuid>de04a7b1-bf86-1dd5-d114-d9e8cec83e8d</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/user/VMS-Dockers/VMS/KODI-Unraid/KODI-Unraid.qcow2'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO-STORE/14.04 mini.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='d6:93:a6:75:de:cf'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <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=07:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=07:00.1,bus=pcie.0'/>
  </qemu:commandline>
</domain>

Link to comment

Quick feedback as I'm packing up to leave:

 

Your XML looks good but you need to change your disk path from referring to /mnt/user to the actual disk the VM image is on.  This will definitely help.  If you're using a cache device for your VMS-Dockers share, just change this:

 

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/user/VMS-Dockers/VMS/KODI-Unraid/KODI-Unraid.qcow2'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

 

TO THIS:

 

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/cache/VMS-Dockers/VMS/KODI-Unraid/KODI-Unraid.qcow2'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

 

If that doesn't work, drop to command line, type virsh start KODI-Unraid and reply back here with the error message it gives you.

 

Link to comment

Found your problem.  Its in your qemu arguments at the end of your xml. Find where it says bus=pcie and change it to bus=pci

 

Edit:  I'll make it easier for you.  Just replace the <qemu:commandline> section with what I have modified for you below:

 

  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pci.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=07:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=07:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>

Link to comment

I went back to this again and now have it running, got some hardware issues to sort regarding getting usb remote control reciever to living room from server , audio tweaking with sync playback etc and colour balance is slightly different to other computer.

 

no biggies though.

 

So one thing that's definitely worth checking out is the Synergy Project:  http://synergy-project.org/

 

This lets you use a M&K from any machine with any other machine (doesn't matter what OS either).  Its actually pretty slick.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.