You are not logged in.

#751 2013-11-14 18:49:10

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

You need to lower your vcpu count or my script will break, thats why you're seeing all those error

Ex: change VCPUS=8 to VCPUS=6

Last edited by nbhs (2013-11-14 19:02:54)

Offline

#752 2013-11-14 19:05:43

Norcoen
Member
From: Norway
Registered: 2013-11-02
Posts: 23

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Norcoen wrote:

//edit:
ah, now I see that vendor:device IDs are the same again, like the problem I had with the sata-controller.
Is it possible to be more specific, on which device I want to pass?
virt-manager defines it in this xml structure:

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x1532'/>
        <product id='0x0016'/>
        <address bus='3' device='15'/>
      </source>
    </hostdev>

//edit2:
I found this: http://www.linux-kvm.org/page/USB_Host_ … d_to_Guest
I tried changing the startscript from

USB_DEVICES="host:046d:c226 host:046d:c227 host:1532:0016"

to:

USB_DEVICES="usb-host,hostbus=3,hostaddr=10 usb-host,hostbus=3,hostaddr=11 usb-host,hostbus=3,hostaddr=13"

but that did not work either.

I changed the above things and I lowered the count to 4.
[do I have to set VCPUS="7" to use all 8 cores (4+4 HT)?]

Now this is my output:

$ sudo ./startWin7.sh
cset: --> activating shielding:
cset: moving 368 tasks from root into system cpuset...
[==================================================]%
cset: "system" cpuset of CPUSPEC(4-7) with 368 tasks running
cset: "user" cpuset of CPUSPEC(0-3) with 0 tasks running
$QEMU $BIOS $CPU $MEMORY $QEMU_ARGS $DEV $USB_DEV $NET $SND $STORAGE $EXTRA_ARGS
QEMU 1.6.50 monitor - type 'help' for more information
(qemu) cset: --> shielding following pidspec: 7983 
cset: done
pid 7983's current affinity list: 0-3
pid 7983's new affinity list: 0
cset: --> shielding following pidspec: 7984 
cset: done
pid 7984's current affinity list: 0-3
pid 7984's new affinity list: 1
cset: --> shielding following pidspec: 8029 
cset: done
pid 8029's current affinity list: 0-3
pid 8029's new affinity list: 2
qemu: could not add USB device 'usb-host,hostbus=3,hostaddr=10'
cset: --> shielding following pidspec: 8070 
cset: **> skipped 1 task, not in origination set "system"
cset: --> hint: perhaps use --force if sure of command
cset: **> tasks do not match all criteria, none moved
taskset: failed to get pid 8070's affinity: Kein passender Prozess gefunden
cset: --> deactivating/reseting shielding
cset: moving 0 tasks from "/user" user set to root set...
cset: moving 368 tasks from "/system" system set to root set...
[==================================================]%
cset: deleting "/user" and "/system" sets
cset: done
All Done!!

Offline

#753 2013-11-14 19:19:48

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hi guys!

I`m able to pass through GTX 680 no problems, and able to shutdown / restart VM as many times as I want. I get qemu bios on the card ouptut.
I`m still far away from full featured windows inside linux, but this is awesome stuff.

Thanks a lot, especially nbhs and aw!

PS. Did a quick installation of Windows 7, install went fine but I got a blue screen after reboot. I guess there will be one or two hiccups still smile

PPS: Must be a ahci / ide controller mismatch. I`m getting it w/o passed through VGA ( dont have the time to see the code ) I`ll try more tomorrow.

Last edited by ilya80 (2013-11-14 20:05:09)

Offline

#754 2013-11-14 19:23:14

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Norcoen wrote:
Norcoen wrote:

//edit:
ah, now I see that vendor:device IDs are the same again, like the problem I had with the sata-controller.
Is it possible to be more specific, on which device I want to pass?
virt-manager defines it in this xml structure:

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x1532'/>
        <product id='0x0016'/>
        <address bus='3' device='15'/>
      </source>
    </hostdev>

//edit2:
I found this: http://www.linux-kvm.org/page/USB_Host_ … d_to_Guest
I tried changing the startscript from

USB_DEVICES="host:046d:c226 host:046d:c227 host:1532:0016"

to:

USB_DEVICES="usb-host,hostbus=3,hostaddr=10 usb-host,hostbus=3,hostaddr=11 usb-host,hostbus=3,hostaddr=13"

but that did not work either.

I changed the above things and I lowered the count to 4.
[do I have to set VCPUS="7" to use all 8 cores (4+4 HT)?]

Now this is my output:

$ sudo ./startWin7.sh
cset: --> activating shielding:
cset: moving 368 tasks from root into system cpuset...
[==================================================]%
cset: "system" cpuset of CPUSPEC(4-7) with 368 tasks running
cset: "user" cpuset of CPUSPEC(0-3) with 0 tasks running
$QEMU $BIOS $CPU $MEMORY $QEMU_ARGS $DEV $USB_DEV $NET $SND $STORAGE $EXTRA_ARGS
QEMU 1.6.50 monitor - type 'help' for more information
(qemu) cset: --> shielding following pidspec: 7983 
cset: done
pid 7983's current affinity list: 0-3
pid 7983's new affinity list: 0
cset: --> shielding following pidspec: 7984 
cset: done
pid 7984's current affinity list: 0-3
pid 7984's new affinity list: 1
cset: --> shielding following pidspec: 8029 
cset: done
pid 8029's current affinity list: 0-3
pid 8029's new affinity list: 2
qemu: could not add USB device 'usb-host,hostbus=3,hostaddr=10'
cset: --> shielding following pidspec: 8070 
cset: **> skipped 1 task, not in origination set "system"
cset: --> hint: perhaps use --force if sure of command
cset: **> tasks do not match all criteria, none moved
taskset: failed to get pid 8070's affinity: Kein passender Prozess gefunden
cset: --> deactivating/reseting shielding
cset: moving 0 tasks from "/user" user set to root set...
cset: moving 368 tasks from "/system" system set to root set...
[==================================================]%
cset: deleting "/user" and "/system" sets
cset: done
All Done!!

Try using the commandline instead of my script,  perhaps you built qemu without usb support?

Last edited by nbhs (2013-11-14 19:23:36)

Offline

#755 2013-11-14 20:30:40

Norcoen
Member
From: Norway
Registered: 2013-11-02
Posts: 23

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I'm trying to rebuilt qemu as provided in the first post now.
I'm a bit stuck with configure now.

I'm getting this error:

ERROR: pa check failed
       Make sure to have the pa libs and headers installed.

using

./configure --prefix=/home/user/qemu-1.7.r29486.g5c5432e --sysconfdir=/etc --audio-drv-list='pa alsa sdl oss' \
              --python=/usr/bin/python2 --smbd=/usr/bin/smbd \
              --enable-docs --libexecdir=/usr/lib/qemu \
              --disable-gtk --enable-linux-aio --enable-seccomp \
              --enable-spice --localstatedir=/var

Do I need "pa" - what does it do?
[//edit: I guess pa means pulseaudio in context with alsa and oss... could have figured that out earlier...] - I have pulseaudi installed, guess I need to check the libs.
Also, what do I set my --libexecdir to, with my given prefix? Or is it just fine?
I don't have /usr/bin/smbd, is that the samba daemon?

Last edited by Norcoen (2013-11-14 20:43:16)

Offline

#756 2013-11-14 20:42:42

Val532
Member
Registered: 2013-11-13
Posts: 35

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hi i need help ^^.

When i start my VM with :

sudo qemu-system-x86_64 -M q35 -m 8G -enable-kvm -cpu Haswell -vga none -nographic -parallel none -boot menu=on \
-bios /usr/share/qemu/bios.bin \
-smp 4,sockets=1,cores=4,threads=1 \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device ahci,bus=pcie.0,id=ahci \
-device vfio-pci,host=01:00.0,x-vga=on,addr=0.0,multifunction=on,bus=root.1 \
-device vfio-pci,host=01:00.1,bus=pcie.0 \
-drive file=/home/val/windows2,id=disk \
-device ide-hd,bus=ahci.0,drive=disk \
-usb -usbdevice host:046d:c019 -usbdevice host:0603:00f2 \
-net nic,model=e1000 -net tap,ifname=tap0

All work ok.

But if i start my VM with Virt-Manager with this xml :

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit Windows7-test2
or other application using the libvirt API.
-->

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Windows7-test2</name>
  <uuid>652e4382-4dc8-7349-cdbf-359d333aba08</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-1.7'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='host'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Haswell</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='abm'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='osxsave'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='rtm'/>
    <feature policy='require' name='invpcid'/>
    <feature policy='require' name='erms'/>
    <feature policy='require' name='bmi2'/>
    <feature policy='require' name='smep'/>
    <feature policy='require' name='avx2'/>
    <feature policy='require' name='hle'/>
    <feature policy='require' name='bmi1'/>
    <feature policy='require' name='fsgsbase'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='rdtscp'/>
    <feature policy='require' name='avx'/>
    <feature policy='require' name='xsave'/>
    <feature policy='require' name='aes'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='popcnt'/>
    <feature policy='require' name='movbe'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='sse4.2'/>
    <feature policy='require' name='sse4.1'/>
    <feature policy='require' name='pcid'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='fma'/>
    <feature policy='require' name='pclmuldq'/>
  </cpu>
  <clock offset='localtime'/>
  <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' cache='writethrough' io='native'/>
      <source file='/home/val/windows2'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:07:1c:aa'/>
      <source bridge='br0'/>
      <model type='e1000'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </interface>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x0603'/>
        <product id='0x00f2'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc019'/>
      </source>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <seclabel type='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=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
    <qemu:arg value='-bios'/>
    <qemu:arg value='bios.bin'/>
  </qemu:commandline>
</domain>

I get a BSOD 0x00000116  atikmpag.sys if i remove the ati driver, the VM work good but no graphique acceleration.

Any idea ?

Edit: I found the problem to slove it juste put clear_emulator_capabilities=0 in qemu.conf

Last edited by Val532 (2013-11-14 21:00:27)

Offline

#757 2013-11-14 20:44:20

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Norcoen wrote:

I'm trying to rebuilt qemu as provided in the first post now.
I'm a bit stuck with configure now.

I'm getting this error:

ERROR: pa check failed
       Make sure to have the pa libs and headers installed.

using

./configure --prefix=/home/user/qemu-1.7.r29486.g5c5432e --sysconfdir=/etc --audio-drv-list='pa alsa sdl oss' \
              --python=/usr/bin/python2 --smbd=/usr/bin/smbd \
              --enable-docs --libexecdir=/usr/lib/qemu \
              --disable-gtk --enable-linux-aio --enable-seccomp \
              --enable-spice --localstatedir=/var

Do I need "pa" - what does it do?
Also, what do I set my --libexecdir to, with my given prefix? Or is it just fine?
I don't have /usr/bin/smbd, is that the samba daemon?

pa is pulseaudio, you have to install the pulseaudio-libs package i think

Offline

#758 2013-11-14 20:53:08

Norcoen
Member
From: Norway
Registered: 2013-11-02
Posts: 23

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Yes, I needed the lib-pulseaudio-devel package, also alsa and oss devel libs after that...^^

//edit2:
After some more missing libs, configure succeeded.
Now when I'm trying to compile it with male I'm getting this SDL error:

$ make
  GEN   alpha-softmmu/config-devices.mak
  GEN   arm-softmmu/config-devices.mak
  GEN   cris-softmmu/config-devices.mak
  GEN   i386-softmmu/config-devices.mak
  GEN   lm32-softmmu/config-devices.mak
  GEN   m68k-softmmu/config-devices.mak
  GEN   microblazeel-softmmu/config-devices.mak
  GEN   microblaze-softmmu/config-devices.mak
  GEN   mips64el-softmmu/config-devices.mak
  GEN   mips64-softmmu/config-devices.mak
  GEN   mipsel-softmmu/config-devices.mak
  GEN   mips-softmmu/config-devices.mak
  GEN   moxie-softmmu/config-devices.mak
  GEN   or32-softmmu/config-devices.mak
  GEN   ppc64-softmmu/config-devices.mak
  GEN   ppcemb-softmmu/config-devices.mak
  GEN   ppc-softmmu/config-devices.mak
  GEN   s390x-softmmu/config-devices.mak
  GEN   sh4eb-softmmu/config-devices.mak
  GEN   sh4-softmmu/config-devices.mak
  GEN   sparc64-softmmu/config-devices.mak
  GEN   sparc-softmmu/config-devices.mak
  GEN   unicore32-softmmu/config-devices.mak
  GEN   x86_64-softmmu/config-devices.mak
  GEN   xtensaeb-softmmu/config-devices.mak
  GEN   xtensa-softmmu/config-devices.mak
  GEN   alpha-linux-user/config-devices.mak
  GEN   armeb-linux-user/config-devices.mak
  GEN   arm-linux-user/config-devices.mak
  GEN   cris-linux-user/config-devices.mak
  GEN   i386-linux-user/config-devices.mak
  GEN   m68k-linux-user/config-devices.mak
  GEN   microblazeel-linux-user/config-devices.mak
  GEN   microblaze-linux-user/config-devices.mak
  GEN   mips64el-linux-user/config-devices.mak
  GEN   mips64-linux-user/config-devices.mak
  GEN   mipsel-linux-user/config-devices.mak
  GEN   mips-linux-user/config-devices.mak
  GEN   mipsn32el-linux-user/config-devices.mak
  GEN   mipsn32-linux-user/config-devices.mak
  GEN   or32-linux-user/config-devices.mak
  GEN   ppc64abi32-linux-user/config-devices.mak
  GEN   ppc64-linux-user/config-devices.mak
  GEN   ppc-linux-user/config-devices.mak
  GEN   s390x-linux-user/config-devices.mak
  GEN   sh4eb-linux-user/config-devices.mak
  GEN   sh4-linux-user/config-devices.mak
  GEN   sparc32plus-linux-user/config-devices.mak
  GEN   sparc64-linux-user/config-devices.mak
  GEN   sparc-linux-user/config-devices.mak
  GEN   unicore32-linux-user/config-devices.mak
  GEN   x86_64-linux-user/config-devices.mak
  GEN   config-all-devices.mak
  GEN   config-host.h
	 DEP tests/dumptrees.c
	 DEP tests/trees.S
	 DEP tests/testutils.c
	 DEP tests/value-labels.c
	 DEP tests/asm_tree_dump.c
	 DEP tests/truncated_property.c
	 DEP tests/path_offset_aliases.c
	 DEP tests/add_subnode_with_nops.c
	 DEP tests/dtbs_equal_unordered.c
	 DEP tests/dtb_reverse.c
	 DEP tests/dtbs_equal_ordered.c
	 DEP tests/extra-terminating-null.c
	 DEP tests/incbin.c
	 DEP tests/boot-cpuid.c
	 DEP tests/phandle_format.c
	 DEP tests/path-references.c
	 DEP tests/references.c
	 DEP tests/string_escapes.c
	 DEP tests/del_node.c
	 DEP tests/del_property.c
	 DEP tests/setprop.c
	 DEP tests/set_name.c
	 DEP tests/rw_tree1.c
	 DEP tests/open_pack.c
	 DEP tests/nopulate.c
	 DEP tests/mangle-layout.c
	 DEP tests/move_and_save.c
	 DEP tests/sw_tree1.c
	 DEP tests/nop_node.c
	 DEP tests/nop_property.c
	 DEP tests/setprop_inplace.c
	 DEP tests/notfound.c
	 DEP tests/get_alias.c
	 DEP tests/node_offset_by_compatible.c
	 DEP tests/node_check_compatible.c
	 DEP tests/node_offset_by_phandle.c
	 DEP tests/node_offset_by_prop_value.c
	 DEP tests/parent_offset.c
	 DEP tests/supernode_atdepth_offset.c
	 DEP tests/get_path.c
	 DEP tests/get_phandle.c
	 DEP tests/getprop.c
	 DEP tests/get_name.c
	 DEP tests/path_offset.c
	 DEP tests/subnode_offset.c
	 DEP tests/find_property.c
	 DEP tests/root_node.c
	 DEP tests/get_mem_rsv.c
	 DEP libfdt/fdt_strerror.c
	 DEP libfdt/fdt_rw.c
	 DEP libfdt/fdt_sw.c
	 DEP libfdt/fdt_wip.c
	 DEP libfdt/fdt_ro.c
	 DEP libfdt/fdt.c
	 DEP ftdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP util.c
	 DEP srcpos.c
	 BISON dtc-parser.tab.c
	 DEP dtc-parser.tab.c
	 LEX dtc-lexer.lex.c
	 DEP dtc-lexer.lex.c
	 DEP treesource.c
	 DEP livetree.c
	 DEP fstree.c
	 DEP flattree.c
	 DEP dtc.c
	 DEP data.c
	 DEP checks.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP dtc.c
	CHK version_gen.h
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 AR libfdt/libfdt.a
ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
  GEN   qemu-options.def
  GEN   qmp-commands.h
  GEN   qapi-types.h
  GEN   qapi-visit.h
  GEN   trace/generated-events.h
  GEN   trace/generated-tracers.h
  GEN   tests/test-qapi-types.h
  GEN   tests/test-qapi-visit.h
  GEN   tests/test-qmp-commands.h
	CHK version_gen.h
  CC    tests/qemu-iotests/socket_scm_helper.o
  LINK  tests/qemu-iotests/socket_scm_helper
  lt CC stubs/arch-query-cpu-def.lo
  lt CC stubs/clock-warp.lo
  lt CC stubs/cpu-get-clock.lo
  lt CC stubs/cpu-get-icount.lo
  lt CC stubs/dump.lo
  lt CC stubs/fdset-add-fd.lo
  lt CC stubs/fdset-find-fd.lo
  lt CC stubs/fdset-get-fd.lo
  lt CC stubs/fdset-remove-fd.lo
  lt CC stubs/gdbstub.lo
  lt CC stubs/get-fd.lo
  lt CC stubs/get-vm-name.lo
  lt CC stubs/iothread-lock.lo
  lt CC stubs/migr-blocker.lo
  lt CC stubs/mon-is-qmp.lo
  lt CC stubs/mon-printf.lo
  lt CC stubs/mon-print-filename.lo
  lt CC stubs/mon-protocol-event.lo
  lt CC stubs/mon-set-error.lo
  lt CC stubs/pci-drive-hot-add.lo
  lt CC stubs/reset.lo
  lt CC stubs/set-fd-handler.lo
  lt CC stubs/slirp.lo
  lt CC stubs/sysbus.lo
  lt CC stubs/uuid.lo
  lt CC stubs/vm-stop.lo
  lt CC stubs/vmstate.lo
  lt CC stubs/cpus.lo
  lt CC libcacard/cac.lo
  lt CC libcacard/event.lo
  lt CC libcacard/vcard.lo
  lt CC libcacard/vreader.lo
  lt CC libcacard/vcard_emul_nss.lo
  lt CC libcacard/vcard_emul_type.lo
  lt CC libcacard/card_7816.lo
  lt CC libcacard/vcardt.lo
  lt CC util/osdep.lo
  lt CC util/cutils.lo
  lt CC util/qemu-timer-common.lo
  lt CC util/error.lo
  lt CC util/qemu-error.lo
  lt CC util/oslib-posix.lo
  lt CC util/qemu-thread-posix.lo
  GEN   trace/generated-events.c
  lt CC trace/generated-events.lo
  lt CC trace/default.lo
  lt CC trace/control.lo
  GEN   trace/generated-tracers.c
  lt CC trace/generated-tracers.lo
lt LINK libcacard.la
  GEN   libcacard.pc
  GEN   qemu-options.texi
  GEN   qemu-monitor.texi
  GEN   qemu-img-cmds.texi
  GEN   qemu-doc.html
  GEN   qemu-tech.html
  GEN   qemu.1
  GEN   qemu-img.1
  GEN   qemu-nbd.8
  GEN   qmp-commands.txt
  GEN   fsdev/virtfs-proxy-helper.1
  GEN   qapi-types.c
  GEN   qga/qapi-generated/qga-qapi-types.h
  GEN   qga/qapi-generated/qga-qapi-visit.h
  GEN   qga/qapi-generated/qga-qmp-commands.h
  CC    qapi-types.o
  GEN   qapi-visit.c
  CC    qapi-visit.o
  CC    qga/commands.o
  CC    qga/guest-agent-command-state.o
  CC    qga/main.o
  CC    qga/commands-posix.o
  CC    qga/channel-posix.o
  GEN   qga/qapi-generated/qga-qapi-types.c
  CC    qga/qapi-generated/qga-qapi-types.o
  GEN   qga/qapi-generated/qga-qapi-visit.c
  CC    qga/qapi-generated/qga-qapi-visit.o
  GEN   qga/qapi-generated/qga-qmp-marshal.c
  CC    qga/qapi-generated/qga-qmp-marshal.o
  CC    qapi/qapi-visit-core.o
  CC    qapi/qapi-dealloc-visitor.o
  CC    qapi/qmp-input-visitor.o
  CC    qapi/qmp-output-visitor.o
  CC    qapi/qmp-registry.o
  CC    qapi/qmp-dispatch.o
  CC    qapi/string-input-visitor.o
  CC    qapi/string-output-visitor.o
  CC    qapi/opts-visitor.o
  CC    qobject/qint.o
  CC    qobject/qstring.o
  CC    qobject/qdict.o
  CC    qobject/qlist.o
  CC    qobject/qfloat.o
  CC    qobject/qbool.o
  CC    qobject/qjson.o
  CC    qobject/json-lexer.o
  CC    qobject/json-streamer.o
  CC    qobject/json-parser.o
  CC    qobject/qerror.o
  CC    trace/generated-events.o
  CC    util/unicode.o
  CC    util/event_notifier-posix.o
  CC    util/qemu-openpty.o
  CC    util/envlist.o
  CC    util/path.o
  CC    util/host-utils.o
  CC    util/cache-utils.o
  CC    util/module.o
  CC    util/bitmap.o
  CC    util/bitops.o
  CC    util/hbitmap.o
  CC    util/fifo8.o
  CC    util/acl.o
  CC    util/compatfd.o
  CC    util/iov.o
  CC    util/aes.o
  CC    util/qemu-config.o
  CC    util/qemu-sockets.o
  CC    util/uri.o
  CC    util/notify.o
  CC    util/qemu-option.o
  CC    util/qemu-progress.o
  CC    util/hexdump.o
  CC    util/crc32c.o
  CC    util/throttle.o
  AR    libqemuutil.a
  AR    libqemustub.a
  LINK  qemu-ga
  CC    qemu-nbd.o
  CC    async.o
  CC    thread-pool.o
  CC    nbd.o
  CC    block.o
  CC    blockjob.o
  CC    main-loop.o
  CC    iohandler.o
  CC    qemu-timer.o
  CC    aio-posix.o
  CC    qemu-io-cmds.o
  CC    qemu-coroutine.o
  CC    qemu-coroutine-lock.o
  CC    qemu-coroutine-io.o
  CC    qemu-coroutine-sleep.o
  CC    coroutine-ucontext.o
  CC    block/raw_bsd.o
  CC    block/cow.o
  CC    block/qcow.o
  CC    block/vdi.o
  CC    block/vmdk.o
  CC    block/cloop.o
  CC    block/dmg.o
  CC    block/bochs.o
  CC    block/vpc.o
  CC    block/vvfat.o
  CC    block/qcow2.o
  CC    block/qcow2-refcount.o
  CC    block/qcow2-cluster.o
  CC    block/qcow2-snapshot.o
  CC    block/qcow2-cache.o
  CC    block/qed.o
  CC    block/qed-gencb.o
  CC    block/qed-l2-cache.o
  CC    block/qed-table.o
  CC    block/qed-cluster.o
  CC    block/qed-check.o
  CC    block/parallels.o
  CC    block/blkdebug.o
  CC    block/blkverify.o
  CC    block/snapshot.o
  CC    block/qapi.o
  CC    block/raw-posix.o
  CC    block/linux-aio.o
  CC    block/nbd.o
  CC    block/sheepdog.o
  CC    block/curl.o
  LINK  qemu-nbd
  GEN   qemu-img-cmds.h
  CC    qemu-img.o
  LINK  qemu-img
  CC    qemu-io.o
  LINK  qemu-io
  CC    fsdev/virtfs-proxy-helper.o
  CC    fsdev/virtio-9p-marshal.o
  LINK  fsdev/virtfs-proxy-helper
  CC    libcacard/vscclient.o
lt LINK vscclient
  CC    qemu-bridge-helper.o
  LINK  qemu-bridge-helper
  CC    blockdev.o
  CC    blockdev-nbd.o
  CC    readline.o
  CC    qdev-monitor.o
  CC    device-hotplug.o
  CC    os-posix.o
  CC    migration.o
  CC    migration-tcp.o
  CC    qemu-char.o
  CC    block-migration.o
  CC    page_cache.o
  CC    xbzrle.o
  CC    migration-exec.o
  CC    migration-unix.o
  CC    migration-fd.o
  CC    spice-qemu-char.o
  CC    bt-host.o
  CC    bt-vhci.o
  CC    dma-helpers.o
  CC    vl.o
  CC    tpm.o
  CC    qemu-seccomp.o
  GEN   qmp-marshal.c
  CC    qmp-marshal.o
  CC    qmp.o
  CC    hmp.o
  CC    qemu-log.o
  CC    tcg-runtime.o
  CC    audio/audio.o
  CC    audio/noaudio.o
  CC    audio/wavaudio.o
  CC    audio/mixeng.o
  CC    audio/sdlaudio.o
audio/sdlaudio.c:24:17: schwerwiegender Fehler: SDL.h: Datei oder Verzeichnis nicht gefunden
 #include <SDL.h>
                 ^
Kompilierung beendet.
make: *** [audio/sdlaudio.o] Fehler 1

I have installed all the sdl-devel libs. What am I missing?

Last edited by Norcoen (2013-11-14 21:17:06)

Offline

#759 2013-11-14 21:26:46

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Couldnt hold myself from playing around a bit more big_smile

Installed windows, initial BSOD was because of -cpu host , needed -cpu SandyBridge instead.

Installed NVidia drivers but they give me Error 43. I think aw had more patches around that might solve this. Also GTX 680 is now my secondary GPU, this might be the problem.

Offline

#760 2013-11-14 21:30:56

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Norcoen wrote:

I have installed all the sdl-devel libs. What am I missing?

Most distros have some sort of build dependency tool, ex:

yum-builddep qemu
apt-get build-dep qemu

It's generally a better starting point that recursively trying to build and installing missing dependencies.  I've never used arch, but I'd guess it has a similar tool


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#761 2013-11-14 21:33:14

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

ilya80 wrote:

Couldnt hold myself from playing around a bit more big_smile

Installed windows, initial BSOD was because of -cpu host , needed -cpu SandyBridge instead.

Installed NVidia drivers but they give me Error 43. I think aw had more patches around that might solve this. Also GTX 680 is now my secondary GPU, this might be the problem.

Code 43 error - http://lists.nongnu.org/archive/html/qe … 01417.html

This didn't end up being the final solution, but it works for Geforce cards.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#762 2013-11-14 21:42:57

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

aw wrote:

Code 43 error - http://lists.nongnu.org/archive/html/qe … 01417.html
This didn't end up being the final solution, but it works for Geforce cards.

Isnt this vfio_disallow_device_from_using_nosnoop_transactions.patch ? I have pulled qemu from git and applied this patch successfully before testing.

Is there any way to debug this?

Last edited by ilya80 (2013-11-14 22:24:25)

Offline

#763 2013-11-15 03:44:22

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

ilya80 wrote:
aw wrote:

Code 43 error - http://lists.nongnu.org/archive/html/qe … 01417.html
This didn't end up being the final solution, but it works for Geforce cards.

Isnt this vfio_disallow_device_from_using_nosnoop_transactions.patch ? I have pulled qemu from git and applied this patch successfully before testing.

Is there any way to debug this?

Yes, those are the same patches.  Code 43 is pretty difficult to debug, google for it and you'll find videos of people baking their GPU to try to re-flow the solder.  If you have the nosnoop patch, looks at the GPU in the host with 'lspci -vvv' while Windows is running.  You should see NoSnoop with a + or - next to it.  If it's - then the nosnoop patch is doing it's job.  If it's + I can point you at some other patches.  Otherwise I'd suggest comparing your VM setup versus others that have reported success with similar cards.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#764 2013-11-15 07:48:10

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Right I got to check it while Windows is running.

Last edited by ilya80 (2013-11-15 08:23:16)

Offline

#765 2013-11-15 09:44:25

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

OK, when VM is running, Nvidia VGA Adapter has NoSnoop-, but Nvidia HDMI Audio has NoSnoop+

Can that affect the drivers in guest?

Also, I wonder would saving the card BIOS and then supplying it to qemu make any difference?

Thanks,
Ilya.

Last edited by ilya80 (2013-11-15 11:25:36)

Offline

#766 2013-11-15 11:38:41

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

ilya80 wrote:

Also GTX 680 is now my secondary GPU, this might be the problem.

Have you disabled the emulated vga?

Offline

#767 2013-11-15 11:44:37

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

nbhs wrote:
ilya80 wrote:

Also GTX 680 is now my secondary GPU, this might be the problem.

Have you disabled the emulated vga?

Yes, I`ve got -vga none in qemu command line. Without it passthrough doesnt work I think. Here's how I start qemu:

kalujny@cave-lin:~$ sudo qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu SandyBridge -smp 3,sockets=1,cores=3,threads=1 -vga none -bios /opt/kalujny/kernel/seabios/out/bios.bin
 -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on -device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 
-device ahci,bus=pcie.0,id=ahci -drive file=/opt/kalujny/thrash/windows.img,id=disk,format=raw -device ide-hd,bus=ahci.0,drive=disk -usbdevice tablet -usb -usbdevice host:046d:c311 -net nic -net user

VNC server running on `::1:5900'

Last edited by ilya80 (2013-11-15 11:46:28)

Offline

#768 2013-11-15 14:20:36

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

ilya80 wrote:

OK, when VM is running, Nvidia VGA Adapter has NoSnoop-, but Nvidia HDMI Audio has NoSnoop+

Can that affect the drivers in guest?

Also, I wonder would saving the card BIOS and then supplying it to qemu make any difference?

I don't know if these will make a difference, but should eliminate the question of whether the problem is related to NoSnoop.  This is the current upstream solution.  Kernel:
https://git.kernel.org/cgit/linux/kerne … a429732ef4
https://git.kernel.org/cgit/linux/kerne … 860dae4d56
https://git.kernel.org/cgit/linux/kerne … 7612b7f235

QEMU:
http://lists.nongnu.org/archive/html/qe … 00090.html
http://lists.nongnu.org/archive/html/qe … 00091.html

Remove the previous QEMU nosnoop patch with these fixes.  I doubt saving the card BIOS would make any difference.  If you get seabios output to the monitor and the windows boot animation then it's working correctly.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#769 2013-11-15 14:22:40

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Thanks a lot! I`ll try these and see what comes out of it.

There's always an option of hardmodding the card into GRID K2

Offline

#770 2013-11-15 17:14:22

gentoo-nut
Member
Registered: 2013-11-14
Posts: 4

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hello all

I am very close to a fully working VFIO passthrough.  I had been using the legacy KVM pci-assign in the past but it's just not reliable enough - having to reboot the host is unnacceptable to me.  nbhs, I believe we know each other from a certain other forum, under a certain other aliases -- thank you for your reply the other day.  I am making good progress.

I am using all of the software versions and patches linked in the first post.  The windows guest works perfectly, I can stop and restart it many times with the x-vga card and the host thankfully remains quite healthy.  I do not have any error messages in dmesg or the qemu logs, I believe everything is in good shape.

I'm just having an issue getting the guest to behave with the official AMD GPU drivers installed.  If I don't install these, again everything is fine but there's no 3d acceleration and that's the whole point here.  smile   

Originally I was not using the ioh3420 device.  When I installed the guest drivers, windows would always say "code 10" on the GPU -- which I've found means that it thinks it is not "properly connected to a root port", so enter the ioh3420.

I've added the ioh3420 to my command line and send the vga/hdmi device through that controller instead. However now I see the "starting windows" animated logo for about 3 seconds, and it just blacks out and reboots at "launch startup repair".  It's possible there is a blue screen here but I am just not seeing it.  If I use send-key KEY_DOWN KEY_ENTER I again get the logo for 3 seconds, rinse repeat.  I would guess this is right at the point where the AMD driver loads and tries to get a hold of the GPU.  Unfortunately I do not see any text or info to tell me why it's restarting....

Any ideas what I'm running into here?   Unfortunately I am at work now and cannot share any logs/commands used, but I can later.  I guess I could try re-installing the guest with the ioh3420 present from the get-go, but I'm wondering if anybody has any thoughts on what could be going on and/or how to debug it. 

ASUS Z9PE-D8WS
2x E5-2687w
EVGA Nvidia GTX570  used for host
ASUS AMD 7870HD passed to guest
IOMMU group 32:   0000:82:00.0  pci bridge of some sort, { 0000:83:00.0, 0000:83:00.1, 0000:83:00.2 } nec usb controller passed to guest (works perfect, cannot pass the 82)
IOMMU group 33:   0000:84:00.0  pci bridge of some sort, { 0000:85:00.0, 0000:85:00.1, 0000:85:00.2 } second nec usb controller passed to guest (works perfect, cannot pass the 84)
IOMMU group 34:  { 0000:86:00.0, 0000:86:00.1 } ASUS 7870, passed to guest - almost works right.

I am using aw's scripts on the previous page to bind those three groups to vfio on startup, works great.

Interestingly, nbhs pointed me towards patching the nvidia-drivers for a VGA_ARB fix.  I'm not sure if I still need this or not.  When I apply the patch, the windows installer never gets past the starting windows animated logo - when it tries to flip the display mode for the "blue install now screen", it never gets there.  When I don't apply the patch, everything works - but I have seen ARTIFACTS on my screen for the host occasionally, but not recently since getting everything set right.  Perhaps nvidia is the problem with the guest. 

Another question -- if you were to do this from scratch, which cards would you use for the host, and which for the guest?  I have too much time and money invested in this for it to not work, I don't mind exchanging cards.  I do have an AST onboard video, I could go with a 3 way setup of onboard for host, AMD for guest1, NVIDIA for guest2.

Thanks for any input!!

Last edited by gentoo-nut (2013-11-15 17:22:38)

Offline

#771 2013-11-15 17:21:07

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

gentoo-nut wrote:

I guess I could try reinstalling the guest with the ioh3420 present from the get-go

I guess this is a good idea.

Also in the first post in troubleshooting area there were portions about running host with dedicated cards. Have you gone through that?

Also AST onboard video may be the trouble. I have this weird idea of assigning it to pci-stub in kernel boot options.

Last edited by ilya80 (2013-11-15 17:24:43)

Offline

#772 2013-11-15 17:41:39

gentoo-nut
Member
Registered: 2013-11-14
Posts: 4

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

^ The AST card is currently disabled in the bios and the VGA backplate is unplugged from the board - so that is all well out of the picture for the time being.  But yes, if I did elect to add it back in, I would put it in the pci-stub-ids listing in grub.conf.  I may eventually go to that 3 way model and use the host as a "pure host" - not a desktop at all.  If I could find out the ideal cards to pass to a linux and windows guests I may go that way in a month or so.  For now I just want to get my golf simulator software rolling with existing hardware...  smile

I will review the first post again (has to be the 5th time now... smile ) and I will certainly wipe the guest install and try again with the ioh3420 for starters when I get home.

Thank you for the quick reply!!

Offline

#773 2013-11-15 18:00:53

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

gentoo-nut wrote:

Hello all

I am very close to a fully working VFIO passthrough.  I had been using the legacy KVM pci-assign in the past but it's just not reliable enough - having to reboot the host is unnacceptable to me.  nbhs, I believe we know each other from a certain other forum, under a certain other aliases -- thank you for your reply the other day.  I am making good progress.

I am using all of the software versions and patches linked in the first post.  The windows guest works perfectly, I can stop and restart it many times with the x-vga card and the host thankfully remains quite healthy.  I do not have any error messages in dmesg or the qemu logs, I believe everything is in good shape.

I'm just having an issue getting the guest to behave with the official AMD GPU drivers installed.  If I don't install these, again everything is fine but there's no 3d acceleration and that's the whole point here.  smile   

Originally I was not using the ioh3420 device.  When I installed the guest drivers, windows would always say "code 10" on the GPU -- which I've found means that it thinks it is not "properly connected to a root port", so enter the ioh3420.

I've added the ioh3420 to my command line and send the vga/hdmi device through that controller instead. However now I see the "starting windows" animated logo for about 3 seconds, and it just blacks out and reboots at "launch startup repair".  It's possible there is a blue screen here but I am just not seeing it.  If I use send-key KEY_DOWN KEY_ENTER I again get the logo for 3 seconds, rinse repeat.  I would guess this is right at the point where the AMD driver loads and tries to get a hold of the GPU.  Unfortunately I do not see any text or info to tell me why it's restarting....

Any ideas what I'm running into here?   Unfortunately I am at work now and cannot share any logs/commands used, but I can later.  I guess I could try re-installing the guest with the ioh3420 present from the get-go, but I'm wondering if anybody has any thoughts on what could be going on and/or how to debug it.

Windows doesn't much like hardware changes, so it's worth a shot to reinstall.  Others have noted success with Radeon cards when they attach the audio device to bus=pcie.0 rather than as function 1 of the GPU behind the root port.

gentoo-nut wrote:

ASUS Z9PE-D8WS
2x E5-2687w
EVGA Nvidia GTX570  used for host
ASUS AMD 7870HD passed to guest
IOMMU group 32:   0000:82:00.0  pci bridge of some sort, { 0000:83:00.0, 0000:83:00.1, 0000:83:00.2 } nec usb controller passed to guest (works perfect, cannot pass the 82)
IOMMU group 33:   0000:84:00.0  pci bridge of some sort, { 0000:85:00.0, 0000:85:00.1, 0000:85:00.2 } second nec usb controller passed to guest (works perfect, cannot pass the 84)
IOMMU group 34:  { 0000:86:00.0, 0000:86:00.1 } ASUS 7870, passed to guest - almost works right.

I am using aw's scripts on the previous page to bind those three groups to vfio on startup, works great.

Interestingly, nbhs pointed me towards patching the nvidia-drivers for a VGA_ARB fix.  I'm not sure if I still need this or not.  When I apply the patch, the windows installer never gets past the starting windows animated logo - when it tries to flip the display mode for the "blue install now screen", it never gets there.  When I don't apply the patch, everything works - but I have seen ARTIFACTS on my screen for the host occasionally, but not recently since getting everything set right.  Perhaps nvidia is the problem with the guest.

The nvidia VGA arbiter fix is required if you intend to use the nvidia driver in the host.  Without this the host driver will lock the VGA resources and never release them.  If you were experiencing this problem the guest would be blocked as soon as it tries to do a VGA access, so it sounds like you must not be running nvidia in the host.

gentoo-nut wrote:

Another question -- if you were to do this from scratch, which cards would you use for the host, and which for the guest?  I have too much time and money invested in this for it to not work, I don't mind exchanging cards.  I do have an AST onboard video, I could go with a 3 way setup of onboard for host, AMD for guest1, NVIDIA for guest2.

Thanks for any input!!

Surprisingly I'd say we have a bit better success assigning Nvidia cards than we do Radeon cards.  Possibly due to the better reverse engineered hardware documentation through the nouveau project.  So, you might have better luck using the Radeon for the host and assigning the Nvidia.  Your 3-headed approach may work, but it depends on what the graphics is onboard and how well it participates in VGA arbitration.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#774 2013-11-15 18:45:58

gentoo-nut
Member
Registered: 2013-11-14
Posts: 4

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

aw wrote:

Windows doesn't much like hardware changes, so it's worth a shot to reinstall.  Others have noted success with Radeon cards when they attach the audio device to bus=pcie.0 rather than as function 1 of the GPU behind the root port.

The nvidia VGA arbiter fix is required if you intend to use the nvidia driver in the host.  Without this the host driver will lock the VGA resources and never release them.  If you were experiencing this problem the guest would be blocked as soon as it tries to do a VGA access, so it sounds like you must not be running nvidia in the host.

Surprisingly I'd say we have a bit better success assigning Nvidia cards than we do Radeon cards.  Possibly due to the better reverse engineered hardware documentation through the nouveau project.  So, you might have better luck using the Radeon for the host and assigning the Nvidia.  Your 3-headed approach may work, but it depends on what the graphics is onboard and how well it participates in VGA arbitration.

Thanks, if the reinstall doesn't work I will also try moving the hdmi audio device over.

I AM using the nvidia-drivers package with the nvidia module loaded and working.  I am using version 331.20 from gentoo portage ~amd64.  Without the patch it seems to be fine.  With the patch I can't get through the installer.   Perhaps they just fixed the problem in this version?  I cannot get a version prior to 331.20 to compile against kernel 3.12.  (Without at least hacking the build to say - <=kernel-3.11  + <=kernel-3.12  -- or probably updating the old code to be compatible with a changed kernel API, which I'm not going to attempt).  Which version of the driver are you using that requires the patch? The patch does still apply cleanly to 331.20.

If I still run into issues, I will try switching the Nvidia / AMD cards in the slots and give that a shot as you suggested.  Either way is fine with me.  I also have a second 7870 sitting here from when I was experimenting with Xen last year, so I could try that with nvidia totally out of the picture.  However when I tried that last year, the fglrx driver would ALWAYS forcefully claim both cards despite pci-stub already claiming one, so I was never able to try passing one and keeping one.  I don't remember what happened when trying the radeon module, I think that was about the point where I got fed up with Xen in general and did something else.  smile  I do remember the nvidia card was a big no go for dom0 and domU.

Let me ask this very simply:  if anyone has this working perfectly - what exact model card do you have in the host, what driver, and which for the guest?  I am totally fine with ebay-ing all of my graphics cards and starting fresh with a known good setup.

Thanks again for the replies!!

Offline

#775 2013-11-15 19:41:22

ilya80
Member
Registered: 2013-11-12
Posts: 34

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I could only wish someone at NVidia with access to drivers development environment took sometime to repro the code 43 stuff to check whats actually going wrong. Dreams, dreams...

Wonder if installing linux guest with nouveau drivers & debug enabled kernel would do us any good. I think I could pull that off.

Offline

Board footer

Powered by FluxBB