<div dir="ltr"><div><div>Hi everyone,<br><br></div>This is my very first message to this list. I've been trying to run QEMU/KVM with VFIO withuot success... In fact, everything I got so far was a "no signal" message in my monitor.<br><br></div>I'm copying a message I sent twoo weeks ago to another forum, and I hope someone may lead the right way.<br><br><p>This is my hardware:</p><p>Motherboard: Gigabyte GA-B75M-D3H<br>CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz<br>Primary VGA: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (i915)<br>Secondary (passed through) VGA: GTX 680<br>Monitor: BenQ XL2420T</p><p>I'm using Arch Linux.<br></p><p>My kernel: 4.2.5-1-ARCH<br></p>QEMU version: QEMU emulator version 2.4.0.1, Copyright (c) 2003-2008 Fabrice Bellard<br><div><div><div><pre><code>cat /proc/cmdline 
vmlinuz-linux dart=0 darkwake=0 kext-dev-mode=1 nvda_drv=1  root=UUID=163f32ba-fc90-456a-b9ef-853b98cdd39d resume=UUID=a819ecdf-ed99-464d-bd8e-329da2183854 rw add_efi_memmap intel_iommu=on initrd=/initramfs-linux.img<br><br></code></pre><pre><code>IOMMU Groups<br></code><code>find /sys/kernel/iommu_groups/ -type l
/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/2/devices/0000:00:02.0
/sys/kernel/iommu_groups/3/devices/0000:00:14.0
/sys/kernel/iommu_groups/4/devices/0000:00:16.0
/sys/kernel/iommu_groups/5/devices/0000:00:1a.0
/sys/kernel/iommu_groups/6/devices/0000:00:1b.0
/sys/kernel/iommu_groups/7/devices/0000:00:1c.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.4
/sys/kernel/iommu_groups/9/devices/0000:00:1d.0
/sys/kernel/iommu_groups/10/devices/0000:00:1e.0
/sys/kernel/iommu_groups/11/devices/0000:00:1f.0
/sys/kernel/iommu_groups/11/devices/0000:00:1f.2
/sys/kernel/iommu_groups/11/devices/0000:00:1f.3
/sys/kernel/iommu_groups/12/devices/0000:03:00.0</code><br></pre><br><pre><code>dmesg|grep -e DMAR -e IOMMU
[    0.000000] ACPI: DMAR 0x00000000C5D42850 0000B8 (v01 INTEL  SNB      00000001 INTL 00000001)
[    0.000000] DMAR: IOMMU enabled
[    0.024287] DMAR: Host address width 36
[    0.024289] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.024296] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap c0000020e60262 ecap f0101a
[    0.024297] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.024300] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap c9008020660262 ecap f0105a
[    0.024301] DMAR: RMRR base: 0x000000c5bc3000 end: 0x000000c5bcffff
[    0.024302] DMAR: RMRR base: 0x000000c7800000 end: 0x000000cf9fffff
[    0.024304] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.024304] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.024305] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.024533] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.284348] DMAR: No ATSR found
[    0.284417] DMAR: dmar0: Using Queued invalidation
[    0.284771] DMAR: dmar1: Using Queued invalidation
[    0.284777] DMAR: Setting RMRR:
[    0.284786] DMAR: Setting identity map for device 0000:00:02.0 [0xc7800000 - 0xcf9fffff]
[    0.285324] DMAR: Setting identity map for device 0000:00:14.0 [0xc5bc3000 - 0xc5bcffff]
[    0.285339] DMAR: Setting identity map for device 0000:00:1a.0 [0xc5bc3000 - 0xc5bcffff]
[    0.285352] DMAR: Setting identity map for device 0000:00:1d.0 [0xc5bc3000 - 0xc5bcffff]
[    0.285360] DMAR: Prepare 0-16MiB unity mapping for LPC
[    0.285365] DMAR: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]
[    0.285686] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    0.345658] [drm] DMAR active, disabling use of stolen memory
[    4.436520] vboxpci: IOMMU found<br><br></code></pre><pre><code>My /etc/mkinitcpio.conf<br></code><code><br>MODULES="i915 vfio vfio_iommu_type1 vfio_pci vfio_virqfd"<br><br></code><code>lsmod | grep vfio
vfio_pci               32768  0
vfio_virqfd            16384  1 vfio_pci
vfio_iommu_type1       20480  0
vfio                   24576  2 vfio_iommu_type1,vfio_pci<br><br></code></pre><pre><code>Here goes the most significant part of a lspci command<br><br></code></pre><div class=""><pre><code>00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller [8086:0150] (rev 09)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 680] [10de:1180] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)</code></pre></div><div class=""><pre><code>01:00.0 0300: 10de:1180 (rev a1)
        Subsystem: 1458:353c
        Kernel driver in use: vfio-pci
        Kernel modules: nouveau
01:00.1 0403: 10de:0e0a (rev a1)
        Subsystem: 1458:353c
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel</code></pre></div><pre><br><code>cat /etc/modprobe.d/vfio.conf 
options vfio-pci ids=10de:1180,10de:0e0a<br><br><br></code></pre><pre><code>Before running KVM:<br></code><code>dmesg | grep -i vfio
[    0.571102] VFIO - User Level meta-driver version: 0.3
[    0.583832] vfio_pci: add [10de:1180[ffff:ffff]] class 0x000000/00000000
[    0.597174] vfio_pci: add [10de:0e0a[ffff:ffff]] class 0x000000/00000000<br><br></code></pre><pre><code>After running KVM:<br></code></pre><pre><code>dmesg | grep vfio
[    0.583832] vfio_pci: add [10de:1180[ffff:ffff]] class 0x000000/00000000
[    0.597174] vfio_pci: add [10de:0e0a[ffff:ffff]] class 0x000000/00000000
[ 3182.192258] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
[ 3182.192386] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x19@0x900</code></pre><div><div><br><pre><code>dmesg | grep vgaarb
[    0.186604] vgaarb: setting as boot device: PCI:0000:00:02.0
[    0.186605] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[    0.186608] vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=none,locks=none
[    0.186609] vgaarb: loaded
[    0.186610] vgaarb: bridge control possible 0000:01:00.0
[    0.186610] vgaarb: no bridge control possible 0000:00:02.0
[    0.345717] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=none:owns=io+mem
[    0.572405] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=io+mem:owns=none
[   13.193732] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=io+mem:owns=none
[   13.206373] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=io+mem:owns=none
[ 2319.146020] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=io+mem:owns=none
[ 2319.159069] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=io+mem:owns=none<br><br></code></pre><pre><code>I've already blacklisted the "nouveau" driver, and I've also tried the following:<br><br></code><code>modprobe -r kvm_intel
modprobe kvm_intel emulate_invalid_guest_state=0<br><br></code></pre><pre><code>I've also tried this parameter on the bootloader: </code><code><code>i915.enable_hd_vgaarb=1</code><br><br></code></pre><pre><code>As I told, once I run kvm (command line provided below, althouh I've tried another variations of this) all I get is a small black screen. I have only one monitor with multiple inputs. What I'm trying to do is switch from one input (DVI from the integrated Intel card) to the other one (GTX 680 passed through using HDMI). The thing is there's no signal on the HDMI input...<br><br></code><br><code><code>sudo qemu-system-x86_64 \
  -enable-kvm \
  -m 8192 \
  -vga none \
  -cpu host,kvm=off \
  -smp 4,sockets=1,cores=4,threads=8 \
  -device vfio-pci,host=01:00.0,multifunction=on \
  -device vfio-pci,host=01:00.1 \
  -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
  -drive if=pflash,format=raw,file=/tmp/my_vars.fd</code><br></code></pre><pre><code>I sincerely don't know what else I could try in order to make my setup work... Any indication would be pretty much appreciated.<br></code></pre><pre><code>I hope I've provided enough information.<br></code></pre></div><div><br><br>-- <br><div class="gmail_signature">Atenciosamente,<br><br>Leonardo Caldas<br><a href="mailto:leonardo.caldas@xleox.org" target="_blank">leonardo.caldas@xleox.org</a></div>
</div></div></div></div></div></div>