<div dir="ltr"><div><div>Hi,<br><br></div>I'm trying to build my own machine and at this point I have almost working machine with some issues for future resolve with your help I hope so :)<br><br></div><div>Let me introduce to you my hardware setup and main problem for now. <br><br></div><div>Motherboard: Asus Rampapge VI <br></div><div>CPU: i7-5960X<br></div><div>GPU: Zotac GTX980<br></div><div>This is headless setup for host machine with only one GPU passedthrough to VM.<br><br></div><div>Software:<br></div><div>Debian Jessie 8.0<br></div><div>Kernel 3.16.0-4<br></div><div>Qemu version 2.1.2 -(stable debian)<br></div><div><br></div><div>I'm successfully runing and even gaming on Windows 10 virtual machine with latest nvidia drivers. Now I want to move control over vm to virsh but I've got error and found too small information about it to solve it on my own. Can you give me some hints how to diagnose the problem, what to check or change.  I'm running vm as root and want to start it automaticly after host startup. Below is the error and starting script. <br></div><div><div><div><br>ERROR:<br>error: Failed to start domain Windows10<br>error: internal error: early end of file from monitor: possible problem:<br>2016-07-08T23:07:50.518597Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on,romfile=/home/vm/windows10_test/GTX980_vbios.rom: vfio_dma_map(0x7f1b4f4207a0, 0x0, 0xa0000, 0x7f1aa8000000) = -12 (Cannot allocate memory)<br>2016-07-08T23:07:50.518785Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on,romfile=/home/vm/windows10_test/GTX980_vbios.rom: vfio_dma_map(0x7f1b4f4207a0, 0xc0000, 0x20000, 0x7f1b3c200000) = -12 (Cannot allocate memory)<br>2016-07-08T23:07:50.518881Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on,romfile=/home/vm/windows10_test/GTX980_vbios.rom: vfio_dma_map(0x7f1b4f4207a0, 0x100000, 0x7ff00000, 0x7f1aa8100000) = -12 (Cannot allocate memory)<br>2016-07-08T23:07:50.518938Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on,romfile=/home/vm/windows10_test/GTX980_vbios.rom: vfio: memory listener initialization failed for container<br>2016-07-08T23:07:50.518966Z qemu-system-x86_64: -dev<br><br></div><div>WORKING QEMU COMMAND:<br>qemu-system-x86_64 \<br>  -enable-kvm \<br>  -smp cores=2,threads=2 \<br>  -m 8G \<br>  -cpu host,kvm=off \<br>  -vga none \<br>  -usb -usbdevice host:046d:c328 \<br>  -nographic \<br>  -usb -usbdevice host:046d:c069 \<br>  -device vfio-pci,host=01:00.0,multifunction=on,romfile=/root/vbios.rom \<br>  -device vfio-pci,host=01:00.1 \<br>  -soundhw hda,ac97 \<br>  -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \<br>  -drive if=pflash,format=raw,file=/tmp/my_vars.fd \<br>  -device virtio-scsi-pci,id=scsi \<br>  -drive file=/home/iso/windows10_x64.iso,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd \<br>  -drive file=/home/iso/virtio-win.iso,id=virtio,format=raw,if=none -device ide-cd,bus=ide.1,drive=virtio \<br>  -drive file=/home/vm/firebird_ws/firebird_ws.img,id=disk,format=qcow2,if=none,cache=writeback -device scsi-hd,drive=disk \<br><br></div><div>XML FILE:<br><domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0">http://libvirt.org/schemas/domain/qemu/1.0</a>'><br>  <name>Windows10</name><br>  <uuid>ab048875-7fbf-4e61-b10c-685ccf92c477</uuid><br>  <memory unit='KiB'>2097152</memory><br>  <currentMemory unit='KiB'>2097152</currentMemory><br>  <vcpu placement='static'>4</vcpu><br>  <os><br>    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type><br>    <boot dev='cdrom'/><br>  </os><br>  <features><br>    <acpi/><br>    <apic/><br>    <pae/><br>    <kvm><br>      <hidden state='on'/><br>    </kvm><br>  </features><br>  <cpu mode='custom' match='exact'><br>    <model fallback='allow'>SandyBridge</model><br>  </cpu><br>  <clock offset='utc'><br>    <timer name='rtc' tickpolicy='catchup'/><br>    <timer name='pit' tickpolicy='delay'/><br>    <timer name='hpet' present='no'/><br>  </clock><br>  <on_poweroff>destroy</on_poweroff><br>  <on_reboot>restart</on_reboot><br>  <on_crash>restart</on_crash><br>  <devices><br>    <emulator>/usr/bin/kvm</emulator><br>    <disk type='file' device='disk'><br>      <driver name='qemu' type='raw'/><br>      <source file='/home/vm/windows10_test/windows10_test.img'/><br>      <target dev='vda' bus='virtio'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/><br>    </disk><br>    <disk type='block' device='cdrom'><br>      <driver name='qemu' type='raw'/><br>      <target dev='hda' bus='ide'/><br>      <readonly/><br>      <address type='drive' controller='0' bus='0' target='0' unit='0'/><br>    </disk><br>    <disk type='block' device='cdrom'><br>      <driver name='qemu' type='raw'/><br>      <target dev='hdb' bus='ide'/><br>      <readonly/><br>      <address type='drive' controller='0' bus='0' target='0' unit='1'/><br>    </disk><br>    <controller type='usb' index='0' model='ich9-ehci1'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x7'/><br>    </controller><br>    <controller type='usb' index='0' model='ich9-uhci1'><br>      <master startport='0'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/><br>    </controller><br>    <controller type='usb' index='0' model='ich9-uhci2'><br>      <master startport='2'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/><br>    </controller><br>    <controller type='usb' index='0' model='ich9-uhci3'><br>      <master startport='4'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/><br>    </controller><br>    <controller type='pci' index='0' model='pci-root'/><br>    <controller type='ide' index='0'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/><br>    </controller><br>    <interface type='bridge'><br>      <mac address='52:54:00:88:73:ed'/><br>      <source bridge='br0'/><br>      <model type='rtl8139'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/><br>    </interface><br>    <serial type='pty'><br>      <target port='0'/><br>    </serial><br>    <console type='pty'><br>      <target type='serial' port='0'/><br>    </console><br>    <input type='mouse' bus='ps2'/><br>    <input type='keyboard' bus='ps2'/><br>    <graphics type='vnc' port='-1' autoport='yes'/><br>    <video><br>      <model type='cirrus' vram='9216' heads='1'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/><br>    </video><br>    <memballoon model='virtio'><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/><br>    </memballoon><br>  </devices><br>  <qemu:commandline><br>    <qemu:arg value='-device'/><br>    <qemu:arg value='vfio-pci,host=01:00.0,multifunction=on,romfile=/home/vm/windows10_test/GTX980_vbios.rom'/><br>    <qemu:arg value='-device'/><br>    <qemu:arg value='vfio-pci,host=01:00.1'/><br>  </qemu:commandline><br></domain><br><br><br></div><div>Best Regards <br></div><div>Tomasz Strzelecki<br></div><div><br></div></div></div></div>