Another 2. GPU passthrough post

Yes.
Tried to document the steps here: Qubes OS article and here Update Windows Gaming HVM documentation by neowutran · Pull Request #139 · Qubes-Community/Contents · GitHub

2 Likes

Hi, I read your articles and managed to finally get everything working. Except I cannot get into a 3D world.
I can boot up games and get to the menus, but when trying to join a match or similar, it just gives an infinite loading screen.
Could it have something to do with IOMMU groups? I have almost the same setup as @Rnd3sB3g13rng, with Vega and RXX80.
I couldn’t find any IOMMU groups with my Fedora live USB with the kernel parameters. Maybe with another Linux distro?
I’m not sure if they are in the same IOMMU group because of this.

Could this be the problem here? Everything else works fine, and I can play 2D games using OpenGL with it.

CS:GO throws an error relating to DirectX. With Windows 10 Ameliorated DirectX12 is installed by default.

2 Likes

Solved… by installing Visual C++ redistributables.
Somehow they don’t provide those when you install most games these days.

But there is another issue I have. When “Safely ejecting the Vega GPU” it gives an error instantly after restarting the Windows HVM.
I have to reboot my Qubes after this. I just restart normally now, but after a few restarts the GPU suddenly goes into 100% fan speed, and I have to reboot Qubes. Not a giant issue, though.

2 Likes

There are some very noticeable lags when gaming with my Windows 10 HVM. I guess this is due to me just using a single LVM thin pool, which limits all my drives to the slowest one? These are all SATA/PCIe SSDs.
I haven’t heard anything about PCIe SSDs being mandatory for QEMU/KVM in other distros, but perhaps for Qubes? On your guide you mention M.2 disks, by which you of course mean a M.2 PCIe disk.

I can just tell that on my side, I only have 1 pool, containing 2 extremely fast M.2 PCIe disk. Performance are near native, I don’t have any visible lag that I didn’t had before using Qubes. Maybe try to check the gpu driver you are using, but yes, from my test, windows hvm require a very fast disk to not have lags. linux hvm are less an issue.

1 Like

How do you use USB passthrough? After a lot of troubleshooting I’ve pinpointed the RAM limit patch to not work with stubdom-qrexec feature. From package xen-hvm-stubdom-linux-full. It’s detailed in this post.
Just Qubes Windows Tools won’t let me USB passthrough.

Edit: Thanks to @jevank I learned I need to patch qemu-stubdom-linux-full-rootfs after installing xen-hvm-stubdom-linux-full. Working now.

Yes, I had a working setup but I ran into a new problem now when I switched my “secondary GPU”, or gaming GPU to my x16 slot, and my dom0 GPU to my x16 (x8) slot, but now I’m having difficulty hiding the gaming GPU from dom0.
It worked then the gaming GPU was in the second x16 (x8) slot.

It will boot with the gaming GPU monitor off when at the disk decryption screen, so it looks like it’s working, but after decrypting, it now turns on the input from the gaming GPU card.

GRUB reads rd.qubes.hide_pci=03:00.0,03:00.1

And a side note, if you have 2 M.2 disks both running in an Ultra slot that’s a damn good build.
And SMT didn’t really provide a benefit in my testing so far.

1 Like

I followed your advice and got a hold of a PCIe disk with 2,6GBps read, 1,8GBps write.
Performance is still choppy while gaming for me, and there is intermittent sound lag.

If I stand still in a game, I can reach comfortably 130-40 FPS.
If i start shaking the mouse around it tanks as low as 20-30 FPS.

Using 3 vcpus seems to yield the best, although subpar, performance.

OC’d the GPU a lot, didn’t help much. I think the issue is more related to disk throughput.
And perhaps also worth mentioning is that my GPU is running in x4 mode.
Had problems hiding the x16(x8) slot from dom0.

Can you run some benchmark ? I am a bit curious to understand the difference of performance between my setup and your setup. To compare some benchmark score to try to understand what is the difference.
And how do you use your mouse ? PCI-passthough of one usb controller ?

Depending on your timezone, you could reach me on matrix “neowutran”, “neowutran.ems.host” domain.

I’ve followed the guides (thanks @neowutran for the detailed steps), but sadly the results were bad. First here’s my setup:

AMD Ryzen 9 3900X
ROG Strix x570-E Gaming
64GB ram
2tb m2 nvme ssd

dom0 gpu: NVIDIA 1060
passthrough gpu: NVIDIA 1080 ti

passthrough works in the sense that I could add it to a windows vm and get it running without external issues, but the VM is barely usable at all, with a lot of VIDEO_TDR_FAILURE BSoD errors.

worth mentioning: I was able to use usb passthrough without issues, and I got audio working from the gpu audio device on the monitor speakers

I might be experiencing the same problem as you are, I also have two NVIDIA cards one for dom0 and the other one for the HVM, I might add that the display blackouts very often (lasting for a couple of seconds), when checking for logs in the Windows 10 event viewer I found the following message correlating to the time of each blackout:

Display driver nvlddmkm stopped responding and has successfully recovered.

Also the Windows 10 HVM is very laggy, I’m only facing this on Windows

Yes, I have this as well, once or twice per minute I get “blackouts”, which together with the lag makes the vm unusable (couldn’t even get to install a game and check fps)

Have you figured it out? I still haven’t found a solution, so far I’ve tried downgrading the drivers, installing different versions of Windows such as 7 and 11, and even enabling UEFI, I also tried enabling permissive mode as mentioned in the PCI troubleshooting guide the result was the same

Hi I followed all the steps but performance in the HVM is not so good. It seems like an issue with the disk speed but I am using an NVME. I am using an 11th gen i5 and a RTX 3050. Please let me know if there is a fix.

Thanks

-Ryan

Installing QWT has helped ssd performance but the mouse doesn’t line up and there is screen tearing.

Hi All, is this tread still active? Hope I’m posting in the right spot?

I installed Qubes 4.0.4 in the fall of 2021, and was able to successfully passthrough my Nvidia GTX 1050 to a Win10 HVM with well >3.75GB memory allocated by following neowutran’s great work (Contents/windows-gaming-hvm.md at master · Qubes-Community/Contents · GitHub ARK: source= Contents/windows-gaming-hvm.md at master · Qubes-Community/Contents · GitHub)

The Win10 HVM worked perfectly fine with great performance outputting to a second monitor, other than periodically, after any dom0 updates, booting the HVM resulted a system freeze and ensuing reboot…but I found this was easily resolve by re-executing “grub2-mkconfig -o /boot/grub2/grub.cfg” whenever dom0 updates…

THEN, several weeks ago, I upgraded RAM on my Lenovo D30 ThinkStation (uses DDR3 PC3-12800E type). When doing this, I noticed that the ram slots were not populated correctly for best performance per the manufacturer (ie, ram chips were populated all on one side of each CPU in an order like DIMM slot 6, 2, 5, 1…instead of 1, 2, 3, 4, etc). So I install all the chips, including the additions in the correct fashion per the manufacturer’s hardware manual…

Since then, I can not get the Win10 HVM to work with GPU passthrough…NOR will it work with greater than 3.6GB of ram assigned (even when I don’t pass the GPU). The HVM works fine without any windows errors if I boot it with less than 3.75GB ram and no GPU passthrough.

It is worth noting, I’m also running this HVM off a secondary storage I added to Qubes by following original documentation (Secondary storage | Qubes OS)…not sure if this matters?

So…IN SUMMARY:

  1. Boot win HVM with <=3.6GB RAM and NO gpu passthrough = works fine

  2. Boot win HVM with >3.6GB ram, it hangs in terminal window after Machine UUID… for 5mins, then reports error: “Domain WIN10 has failed to start: Cannot connect to qrexec agent for 300 seconds, see /var/log/xen/console/guest-WIN10.log for details”

  3. Boot win HVM with <=3.6GB RAM +GPU passthrough (with strict no reset per neowutrans’s instruction link above), system freezes and reboots

Log’s attached

Thank you for your help!
guest-WIN10.log (34.6 KB)
guest-WIN10-dm.log (146.7 KB)
guid.WIN10.log (1.4 MB)
qrexec.WIN10.log (60 Bytes)

2 Likes

Where you able to solve this?

Nothing yet…
Thinking to backup all my appVM’s and either upgrading to qubes 4.1 or trying fresh install of 4.0 to see if it resolves the issue…

Can’t tell if adding RAM is the issue or, if running the HVM on a secondary storage added to qubes is the cause…

If you don’t use the secondary storage for other VMs than Windows, you could try to pass the entire disk to Windows, if it’s a NVMe you passthrough it like any other PCIe device.