I have been dealing with some “performance” issues when using looking-glass (1440p, I know not really supported) and it was driving me insane. I am running my setup passing through everything, except mouse and keyboard (evdev for these) and expected performance to be good. I am using Q35 as it has been easier for me to dual-boot the VM.
Most games run OK, except, some times, I will see looking-glass using 30% gpu and games just slow to a crawl. Guild Wars 2 would play crappy from time to time. Also, the gpu would, randomly, go to P2 state (600mhz!)
Apparently, under some configurations, if you have the video card attached to a pcie-root-port (the proper way) nvidia driver can just go nuts and downclock the bus from gen3 to gen1 (it always stays at 16x). I have tried different power profiles, regedit hacks and only one thing worked: plug the GPU and the hdaudio straight into the pci-root bus. I have even turned optimal power and the gpu will downclock (and go to gen1 mode) properly and scale back when needed.
With this, Looking Glass is working perfectly fine at 1440p and 60 fps (1080 strix). Maximum is around 5% utilization for the looking-glass-host.
Do not use GPU-Z to verify your current pci-e speeds, the report is usually wrong. Nvidia inspector has been a little better, but I use this to verify:
#Replace 43:00.0 with bus:slot.func used by your passthrough graphics card sudo lspci -s 43:00.0 -nvv|grep LnkS
The first line output should be something like:
LnkSta: Speed 8GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
8GT/s = gen3
5GT/s = gen2
2.5GT/s = gen1
My system always boot as G1 (I think that’s normal) but it will change later to the higher speed when gaming (or under prefer maximum performance). Using Aida64 GPGPU test, I also get close to 12000MB/s on memory test, while gen1 gives 3600MB/s…
This is definitely triggered by the driver, considering my nvme and other devices work without problem at 8x, I am not sure if this is a bug, poor implementation on qemu’s side or nvidia shenanigans.
If you are having some performance problems with looking-glass, check out your lspci output while gaming, it could be related to this. @gnif, I think this should definitely be checked before confirming performance issues.
P.S.: According to some thread on reddit, i440fx doesn’t suffer from this. I wasn’t able to test though.