Unable to pass GPU through to linux guest


Recommended Posts

I am trying to passthrough a GPU to my linux guest. I am using Ubuntu 16.04 and my two GPUs are  SAPPHIRE Radeon HD 6450 and SAPPHIRE R9 270. They have both produced similar results when testing one at a time. I am able to get output to display on my monitors and am able to see the Ubuntu splash screen, however the VM then boots to a black screen with a blinking cursor in the top left corner. I can type text and hit enter however nothing happens.

 

At this same time I am able to SSH to the VM and login and run commands. This may be more of a guest driver issue but am looking for any suggestions. According to this page https://help.ubuntu.com/community/RadeonDriver both of my GPUs should be supported by this version of Ubuntu.

 

Attached is my XML and IOMMU device group

 

<domain type='kvm'>
  <name>Kubuntu</name>
  <uuid>32c5e6ed-5f9a-9a04-4b00-a1c17fbcd494</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Ubuntu" icon="ubuntu.png" os="ubuntu"/>
  </metadata>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>3</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='5'/>
    <vcpupin vcpu='1' cpuset='6'/>
    <vcpupin vcpu='2' cpuset='7'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-q35-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/32c5e6ed-5f9a-9a04-4b00-a1c17fbcd494_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='3' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/disks/Samsung_SSD_850_EVO_250GB_S21NNSAFC96549K/Kubuntu/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:06:cf:b5'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <source mode='connect'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

/sys/kernel/iommu_groups/16/devices/0000:01:00.0
/sys/kernel/iommu_groups/16/devices/0000:01:00.1
/sys/kernel/iommu_groups/17/devices/0000:02:00.0
/sys/kernel/iommu_groups/17/devices/0000:02:00.1
/sys/kernel/iommu_groups/18/devices/0000:03:00.0
/sys/kernel/iommu_groups/19/devices/0000:05:00.0
/sys/kernel/iommu_groups/20/devices/0000:06:00.0
/sys/kernel/iommu_groups/21/devices/0000:08:00.0
/sys/kernel/iommu_groups/22/devices/0000:09:00.0
/sys/kernel/iommu_groups/23/devices/0000:0a:00.0

 

00:1f.2 SATA controller [0106]: Intel Corporation 9 Series Chipset Family SATA Controller [AHCI Mode] [8086:8c82]
00:1f.3 SMBus [0c05]: Intel Corporation 9 Series Chipset Family SMBus Controller [8086:8ca2]
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Curacao PRO [Radeon R7 370 / R9 270/370 OEM] [1002:6811]
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] [1002:aab0]
02:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM] [1002:6779]
02:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Caicos HDMI Audio [Radeon HD 6400 Series] [1002:aa98]
03:00.0 USB controller [0c03]: VIA Technologies, Inc. VL805 USB 3.0 Host Controller [1106:3483] (rev 01)
05:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller [1969:e091] (rev 10)
06:00.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev 41)
08:00.0 SATA controller [0106]: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller [1b4b:9172] (rev 12)
09:00.0 Ethernet controller [0200]: Intel Corporation 82574L Gigabit Network Connection [8086:10d3]
0a:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)

Link to comment

Here are my Xorg logs

 

cat "/var/log/Xorg.0.log"
[    11.515] (--) Log file renamed from "/var/log/Xorg.pid-2492.log" to "/var/log/Xorg.0.log"
[    11.516]
X.Org X Server 1.18.3
Release Date: 2016-04-04
[    11.516] X Protocol Version 11, Revision 0
[    11.516] Build Operating System: Linux 3.13.0-86-generic x86_64 Ubuntu
[    11.516] Current Operating System: Linux afoard-Dkestop-Kubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64
[    11.516] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-31-generic.efi.signed root=UUID=7b64f5a0-2846-4b4b-9c16-b415822cf4ec ro quiet splash vt.handoff=7
[    11.516] Build Date: 18 May 2016  01:07:07AM
[    11.516] xorg-server 2:1.18.3-1ubuntu2.2 (For technical support please see http://www.ubuntu.com/support)
[    11.516] Current version of pixman: 0.33.6
[    11.516]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[    11.516] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    11.516] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Jul 19 16:44:36 2016
[    11.516] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    11.516] (==) No Layout section.  Using the first Screen section.
[    11.516] (==) No screen section available. Using defaults.
[    11.516] (**) |-->Screen "Default Screen Section" (0)
[    11.516] (**) |   |-->Monitor "<default monitor>"
[    11.516] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[    11.516] (==) Automatically adding devices
[    11.516] (==) Automatically enabling devices
[    11.516] (==) Automatically adding GPU devices
[    11.516] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    11.516] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    11.516]    Entry deleted from font path.
[    11.516] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    11.516]    Entry deleted from font path.
[    11.516] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    11.516]    Entry deleted from font path.
[    11.516] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    11.516]    Entry deleted from font path.
[    11.517] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    11.517]    Entry deleted from font path.
[    11.517] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        /usr/share/fonts/X11/Type1,
        built-ins
[    11.517] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"
[    11.517] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[    11.517] (II) Loader magic: 0x55fbc5ed1da0
[    11.517] (II) Module ABI versions:
[    11.517]    X.Org ANSI C Emulation: 0.4
[    11.517]    X.Org Video Driver: 20.0
[    11.517]    X.Org XInput driver : 22.1
[    11.517]    X.Org Server Extension : 9.0
[    11.517] (++) using VT number 7

[    11.517] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    11.517] (II) xfree86: Adding drm device (/dev/dri/card0)
[    11.520] (--) PCI:*(0:2:4:0) 1002:6779:174b:e164 rev 0, Mem @ 0xc0000000/268435456, 0xd0000000/131072, I/O @ 0x0000c000/256, BIOS @ 0x?????/131072
[    11.520] (II) LoadModule: "glx"
[    11.520] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    11.521] (II) Module glx: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.3, module version = 1.0.0
[    11.521]    ABI class: X.Org Server Extension, version 9.0
[    11.521] (==) AIGLX enabled
[    11.521] (==) Matched ati as autoconfigured driver 0
[    11.521] (==) Matched ati as autoconfigured driver 1
[    11.521] (==) Matched modesetting as autoconfigured driver 2
[    11.521] (==) Matched fbdev as autoconfigured driver 3
[    11.521] (==) Matched vesa as autoconfigured driver 4
[    11.521] (==) Assigned the driver to the xf86ConfigLayout
[    11.521] (II) LoadModule: "ati"
[    11.521] (II) Loading /usr/lib/xorg/modules/drivers/ati_drv.so
[    11.521] (II) Module ati: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.3, module version = 7.7.0
[    11.521]    Module class: X.Org Video Driver
[    11.521]    ABI class: X.Org Video Driver, version 20.0
[    11.521] (II) LoadModule: "radeon"
[    11.521] (II) Loading /usr/lib/xorg/modules/drivers/radeon_drv.so
[    11.521] (II) Module radeon: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.3, module version = 7.7.0
[    11.521]    Module class: X.Org Video Driver
[    11.521]    ABI class: X.Org Video Driver, version 20.0
[    11.521] (II) LoadModule: "modesetting"
[    11.521] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    11.521] (II) Module modesetting: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.3, module version = 1.18.3
[    11.521]    Module class: X.Org Video Driver
[    11.521]    ABI class: X.Org Video Driver, version 20.0
[    11.521] (II) LoadModule: "fbdev"
[    11.521] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    11.521] (II) Module fbdev: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.1, module version = 0.4.4
[    11.521]    Module class: X.Org Video Driver
[    11.521]    ABI class: X.Org Video Driver, version 20.0
[    11.521] (II) LoadModule: "vesa"
[    11.521] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[    11.521] (II) Module vesa: vendor="X.Org Foundation"
[    11.521]    compiled for 1.18.1, module version = 2.3.4
[    11.521]    Module class: X.Org Video Driver
[    11.521]    ABI class: X.Org Video Driver, version 20.0
[    11.521] (II) RADEON: Driver for ATI Radeon chipsets:
[    11.523] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    11.523] (II) FBDEV: driver for framebuffer: fbdev
[    11.523] (II) VESA: driver for VESA chipsets: vesa
[    11.523] (II) [KMS] Kernel modesetting enabled.
[    11.523] (WW) Falling back to old probe method for modesetting
[    11.523] (WW) Falling back to old probe method for fbdev
[    11.523] (II) Loading sub module "fbdevhw"
[    11.523] (II) LoadModule: "fbdevhw"
[    11.523] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    11.524] (II) Module fbdevhw: vendor="X.Org Foundation"
[    11.524]    compiled for 1.18.3, module version = 0.0.2
[    11.524]    ABI class: X.Org Video Driver, version 20.0
[    11.524] (WW) Falling back to old probe method for vesa
[    11.524] (EE) No devices detected.
[    11.524] (==) Matched ati as autoconfigured driver 0
[    11.524] (==) Matched ati as autoconfigured driver 1
[    11.524] (==) Matched modesetting as autoconfigured driver 2
[    11.524] (==) Matched fbdev as autoconfigured driver 3
[    11.524] (==) Matched vesa as autoconfigured driver 4
[    11.524] (==) Assigned the driver to the xf86ConfigLayout
[    11.524] (II) LoadModule: "ati"
[    11.524] (II) Loading /usr/lib/xorg/modules/drivers/ati_drv.so
[    11.524] (II) Module ati: vendor="X.Org Foundation"
[    11.524]    compiled for 1.18.3, module version = 7.7.0
[    11.524]    Module class: X.Org Video Driver
[    11.524]    ABI class: X.Org Video Driver, version 20.0
[    11.524] (II) LoadModule: "modesetting"
[    11.524] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    11.524] (II) Module modesetting: vendor="X.Org Foundation"
[    11.524]    compiled for 1.18.3, module version = 1.18.3
[    11.524]    Module class: X.Org Video Driver
[    11.524]    ABI class: X.Org Video Driver, version 20.0
[    11.524] (II) UnloadModule: "modesetting"
[    11.524] (II) Unloading modesetting
[    11.524] (II) Failed to load module "modesetting" (already loaded, 22011)
[    11.524] (II) LoadModule: "fbdev"
[    11.524] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    11.524] (II) Module fbdev: vendor="X.Org Foundation"
[    11.524]    compiled for 1.18.1, module version = 0.4.4
[    11.524]    Module class: X.Org Video Driver
[    11.524]    ABI class: X.Org Video Driver, version 20.0
[    11.524] (II) UnloadModule: "fbdev"
[    11.524] (II) Unloading fbdev
[    11.524] (II) Failed to load module "fbdev" (already loaded, 22011)
[    11.524] (II) LoadModule: "vesa"
[    11.524] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[    11.524] (II) Module vesa: vendor="X.Org Foundation"
[    11.524]    compiled for 1.18.1, module version = 2.3.4
[    11.524]    Module class: X.Org Video Driver
[    11.524]    ABI class: X.Org Video Driver, version 20.0
[    11.524] (II) UnloadModule: "vesa"
[    11.524] (II) Unloading vesa
[    11.524] (II) Failed to load module "vesa" (already loaded, 22011)
[    11.526] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    11.526] (II) FBDEV: driver for framebuffer: fbdev
[    11.526] (II) VESA: driver for VESA chipsets: vesa
[    11.526] (WW) xf86OpenConsole: setpgid failed: Operation not permitted
[    11.526] (WW) xf86OpenConsole: setsid failed: Operation not permitted
[    11.526] (WW) Falling back to old probe method for modesetting
[    11.526] (WW) Falling back to old probe method for fbdev
[    11.526] (II) Loading sub module "fbdevhw"
[    11.526] (II) LoadModule: "fbdevhw"
[    11.526] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    11.526] (II) Module fbdevhw: vendor="X.Org Foundation"
[    11.526]    compiled for 1.18.3, module version = 0.0.2
[    11.526]    ABI class: X.Org Video Driver, version 20.0
[    11.526] (WW) Falling back to old probe method for vesa
[    11.526] (EE) No devices detected.
[    11.526] (EE)
Fatal server error:
[    11.526] (EE) no screens found(EE)
[    11.526] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
for help.
[    11.526] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    11.526] (EE)

 

 

Link to comment
  • 1 month later...

Hi,

i'm not an specialist but i am using and Radeon HD 6450 by XFX with Linux Mint 18 (that's based on ubuntu 16.04) and was able to passthrough by selecting Bios type SeaBios, assigning the Radeon card and choosing to install Mint in "Compatibility Mode".  That did the trick for me.

In fact i am not yet using the appropriate driver for that card (i was told that the old proprietary driver flgx was removed from ubuntu 16.04 and a newer driver is on the works) but the generic one that was installed is sufficient for me at the moment.

 

If someone knows a better way, please let us know.

 

Hope it helps.

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.