<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I get the feeling this has more to to with a certain quirk with some
    recent Asus cards. Now that we got Ruben's passthrough to work,
    maybe we could try and gather some info to pinpoint that specific
    bug.<br>
    <br>
    Ruben, do you think you could try and dump your GPUs firmware from
    within your Windows VM and then send it over? Just fire up GPU-Z and
    <a href="http://img.techpowerup.org/150524/SavingBios.png">click
      here</a>. Maybe there's something we can uncover by analyzing
    those, providing it's not an hardware issue of some sort. Don't
    worry about the VM altering the ROM in any way either, I tried
    booting on my VM disk and dumping the image from a native
    environnement and ended up with a completely identical dump.<br>
    <br>
    <div class="moz-cite-prefix">On 2016-01-31 02:44, Will Marler wrote:<br>
    </div>
    <blockquote
cite="mid:CACjWF0TJyUrcTHC9VqmFo1QwPsiMZrmn0_+FZNXqZEdFeMu3JQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Hey Ruben,
        <div><br>
        </div>
        <div>I think this might be problematic in your XML: </div>
        <div><br>
        </div>
        <div>
          <div>    <graphics type='spice' autoport='yes'></div>
          <div>      <image compression='off'/></div>
          <div>    </graphics></div>
        </div>
        <div>    [...]</div>
        <div>
          <div>    <video></div>
          <div>      <model type='qxl' ram='65536' vram='65536'
            vgamem='16384' heads='1'/></div>
          <div>      <address type='pci' domain='0x0000' bus='0x00'
            slot='0x02' function='0x0'/></div>
          <div>    </video></div>
        </div>
        <div>    [...]<br>
        </div>
        <div><br>
        </div>
        <div>I wouldn't play with the XML directly to remove them;
          rather, do it through virt-manager. As a reference, <a
            moz-do-not-send="true" href="http://imgur.com/9722s0c">here's</a>
          what my virt-manager window looks like. My guess is you still
          have a spice & QXL device.</div>
        <div><br>
        </div>
        <div>I have an IGD and was completely uninterested in patching
          the kernel, so I only ever tried UEFI/OVMF. I tried both
          Fedora and Arch, and ultimately preferred Arch, so I installed
          the ovmf-git package to get Windows booting. At the time I was
          working on getting my VM installed there was a bug in the
          released OVMF code that would cause Windows to reboot during
          install. I'm not sure if this is fixed or not (but you can
          search the forums and find me asking about it, and find me
          getting pointed in the right direction). </div>
        <div><br>
        </div>
        <div>Removing the Spice & QXL device might be all you need.
          But if you're feeling adventurous, here's a fuller suggested
          solution:</div>
        <div><br>
        </div>
        <div> -- Create a new guest using an LVM partition. This allows
          you to create snapshots (useful in one particular situation,
          see below).</div>
        <div> -- Spin up the VM guest using UEFI/OVMF. Get Windows 10 to
          boot & install. (This might take a few tries; it took me 5
          or 6 iirc) </div>
        <div> -- Install a VNC server in the guest, and test that it
          works.</div>
        <div> -- (snapshot & dump xml and ...) using virt-manager
          delete the non-essential devices from the VM. Make the
          necessary tweaks to the XML using virsh (deleting the hyperv
          stuff, kvm hidden state = on).</div>
        <div> -- restart the guest, and connect with VNC to make sure
          the guest is still boots. If it doesn't, import the earlier
          XML & roll back the LVM snapshot & try again (after
          creating a new LVM snapshot ofc!). </div>
        <div> -- Shut off the guest and configure the VGA devices in
          virt-manager to be passed through</div>
        <div> -- Restart the guest and connect over VNC; the Windows
          Device Manager should now see the graphics hardware. Install
          the device drivers.</div>
        <div> -- Reboot the guest and switch your monitor input and hold
          your breath!</div>
        <div> -- Once it works, don't forget to delete the LVM snapshot!
          (filling it up would be a Bad Time).</div>
        <div><br>
        </div>
        <div>Hope to hear of your success!</div>
        <div><br>
        </div>
        <div>Will</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, Jan 30, 2016 at 3:10 AM, Ruben
          Felgenhauer <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:4felgenh@informatik.uni-hamburg.de"
              target="_blank">4felgenh@informatik.uni-hamburg.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> Hi,<br>
              <br>
              I tried your method and it definitely did something.<br>
              <br>
              When attaching the device as is, virsh tells me:<br>
              error: internal error: Attempted double use of PCI slot
              0000:00:02.0 (may need "multifunction='on'" for device on
              function 0)<br>
              If I remove the second <address ... /> tag
              completely, virsh attaches the device successfully.<br>
              Windows tells me, that the GPU has an error code 14
              (that's new) and that I shall restart.<br>
              After the restart, the GPU gives me Code 43 again.<br>
              <br>
              Best regards,<br>
              Ruben
              <div>
                <div class="h5"><br>
                  <br>
                  <div>Am 29.01.2016 um 01:56 schrieb Nicolas
                    Roy-Renaud:<br>
                  </div>
                  <blockquote type="cite"> Ok, try to remove your
                    passthrough from your guest configuration (either
                    using virsh of virt manager). That is : remove the
                    actual gpu (PCI:1:0.0) but keep the associated sound
                    card (PCI:1:0.1) in there so virsh knows it needs to
                    bind with this VFIO group.<br>
                    From there, create a file (let's say
                    ./GPU_DEVICE.xml) containing just the following :<br>
                    <br>
                    <blockquote>
                      <ol>
                        <li style="background:rgb(255,255,255)">
                          <div>   <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"><hostdev</span><span> </span><span
                                style="color:rgb(0,0,102)">mode</span>=<span
                                style="color:rgb(255,0,0)">'subsystem'</span><span> </span><span
                                style="color:rgb(0,0,102)">type</span>=<span
                                style="color:rgb(255,0,0)">'pci'</span><span> </span><span
                                style="color:rgb(0,0,102)">managed</span>=<span
                                style="color:rgb(255,0,0)">'yes'</span><span
style="color:rgb(0,0,0);font-weight:bold">></span></span></div>
                        </li>
                        <li style="background:rgb(255,255,255)">
                          <div>     <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"><source<span
style="color:rgb(0,0,0);font-weight:bold">></span></span></span></div>
                        </li>
                        <li style="background:rgb(255,255,255)">
                          <div>       <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"><address</span><span> </span><span
                                style="color:rgb(0,0,102)">domain</span>=<span
                                style="color:rgb(255,0,0)">'0x0000'</span><span> </span><span
                                style="color:rgb(0,0,102)">bus</span>=<span
                                style="color:rgb(255,0,0)">'0x01'</span><span> </span><span
                                style="color:rgb(0,0,102)">slot</span>=<span
                                style="color:rgb(255,0,0)">'0x00'</span><span> </span><span
                                style="color:rgb(0,0,102)">function</span>=<span
                                style="color:rgb(255,0,0)">'0x0'</span><span
style="color:rgb(0,0,0);font-weight:bold">/></span></span></div>
                        </li>
                        <li style="background:rgb(255,255,255)">
                          <div>     <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"></source<span
style="color:rgb(0,0,0);font-weight:bold">></span></span></span></div>
                        </li>
                        <li style="background:rgb(255,255,255)">
                          <div>     <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"><address</span><span> </span><span
                                style="color:rgb(0,0,102)">type</span>=<span
                                style="color:rgb(255,0,0)">'pci'</span><span> </span><span
                                style="color:rgb(0,0,102)">domain</span>=<span
                                style="color:rgb(255,0,0)">'0x0000'</span><span> </span><span
                                style="color:rgb(0,0,102)">bus</span>=<span
                                style="color:rgb(255,0,0)">'0x00'</span><span> </span><span
                                style="color:rgb(0,0,102)">slot</span>=<span
                                style="color:rgb(255,0,0)">'0x02'</span><span> </span><span
                                style="color:rgb(0,0,102)">function</span>=<span
                                style="color:rgb(255,0,0)">'0x0'</span><span
style="color:rgb(0,0,0);font-weight:bold">/></span></span></div>
                        </li>
                        <li style="background:rgb(255,255,255)">
                          <div>   <span> </span><span
                              style="color:rgb(0,153,0)"><span
                                style="color:rgb(0,0,0);font-weight:bold"></hostdev<span
style="color:rgb(0,0,0);font-weight:bold">></span></span></span></div>
                        </li>
                      </ol>
                    </blockquote>
                    <br>
                    You'll be able to use this file to tell libvirt to
                    append your GPU to guest's config at runtime, which
                    somehow gets around the invalid ROM issue. Just run
                    something like this :<br>
                    <pre>virsh start Win10Full && sleep 60 && virsh attach-device --live --file ./GPU_DEVICE.xml
</pre>
                    If I guessed right, windows should detect a new GPU
                    and get the drivers in place once virsh is done
                    mounting it. If that does work, you'll gave to run
                    this same command every time you start your VM too,
                    or at least until that specific bug is fixed.
                    Hopefully that should get you some results so you
                    can work your way from there.<br>
                    <br>
                    <div>On 2016-01-28 17:03, Ryan Flagler wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">I was going to recommend you use
                        UEFI, which is why I was asking. I've personally
                        had better luck getting things to pass through
                        properly.
                        <div><br>
                        </div>
                        <div>Is your VM down when you try to cat the
                          rom? The GPU needs to be unused by anything.</div>
                      </div>
                      <br>
                    </blockquote>
                    I had the exact same symptoms on my Asus Strix 970,
                    looks like a recurring issue with Asus cards. This
                    happenned both when trying to start a VM with a
                    managed passthrough and when attempting to dump the
                    ROM from sysfs. I figured it's probably an issue
                    with vfio-pci itself, and I still haven't fixed it
                    wet, but the solution I posted above is my current
                    workaround.</blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            vfio-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a><br>
            <a moz-do-not-send="true"
              href="https://www.redhat.com/mailman/listinfo/vfio-users"
              rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/vfio-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>