Games lagging through looking glass

Hi everyone,

Looking-Glass is going quite well for me so far, but I noticed that in games I have a lag every few seconds. When I run the VM directly over the Guest GPU everything is smooth.

My system:
Host CPU: Ryzen 5 2600X
Host GPU:Geforce GTX 1060
Guest GPU: AMD RX 570 4G
Host Kernel version: 5.4.18-1-MANJARO
Host QEMU version: 4.2.0-1

best regards

Is it hitching as in it completely stops for half a second and then resumes?

That’s what’s happening to me

Can you advise what resolution and frame rate you’re playing at in the guest and host? Also what motherboard are you using, and where are the cards plugged in?

At high resolutions and/or framerates you can start to run into PCIe bandwith limits, so we should eliminate that as the issue.

Additionally if you hold scroll lock while running looking glass there are a number of debug options which may help you troubleshoot this. Like FPS display and timings.

Edit; Didn’t notice this was a necro, whoops. Same questions to you @ravenstargames

So I’m running
Asus rog strix x570e gaming wifi ii
AMD 5950x
With 32 Gb of ram @ 3600
EVGA 3090 ti ftw3 - passthrough gpu
XFX Speedster SWFT105 Radeon RX 6400 - host gpu

I’m running at 1440p at 144hz for both host and guests

The 3090 ti is plugged in to slot 1 x16 running at 8x speed and the amd card is running in slot two x16 at 4x speed which is the fastest I can run the amd card in any slot that isn’t slot 1

I get lag spikes on the graph I think it might be a memory transfer issue. I have no idea how memory copying works with graphics card so I wouldn’t know to diagnose it. I’m a software engineer so hardware isn’t my most studied thing with computers

It was a necro thread but used this one so I did not create a new thread and was hoping the original poster had insights on something

Doesn’t sound like a bandwidth issue, you need roughly 2160px * 1440px * 144hz * 3 colours ~= 1.2 GB/s, and one PCIe 4.0 lane is good for 2 GB/s. It’s 4k at 144hz (~3.3 GB/s) that hits an uncomfortable limit on older PCIe 3.0 x 4 cards. Also are those 4 lanes from CPU or GPU, you could have an issue on chipset lanes.

VM copies video buffer from VRAM of guest GPU to RAM (in shared memory), then host copies video buffer from RAM to VRAM of host gpu.

Which graph had am issue? A screenshot would be useful. (This will show where the lag comes from, generation, transfer or display)

Also could you try testing with a lower resolution, then a lower framerate. You might be hitting an FPS limit somewhere. Also are you pinning your VM to one CCD? If you’re not you may be having latency issues on your 5950x.

Sorry for the low res had to take it on my phone but this is what it looks like when it happens.

I do not have it pinned to a ccd so probably can try that

I didn’t capture it but it also happens on the render graph as well

I also have issues with cyberpunk 2077 and LOD issues and that’s why I thought it might be a memory issue somewhere

Ive pinned to use one ccd and lowered the refresh rate to 120 on both the host and guest, I’m still getting hitching but not as bad and the LOD issue is now gone, I wonder if I need to do some more optimizations

1 Like

Try something slower, like 60 hz. Then try 1080p at 144 hz (looking glass has FSR built in). The point is to isolate whether framerate is the trigger.

Also does the hitching happen when playing directly on the monitor? (You can leave looking glass running with mouse / keyboard captured and switch monitors to easily test this).

As for optimisations The Arch wiki is king here. If pinning appears to help (FYI you should have pinned CCD 2 cores), then maybe try isolation next. The point is to reduce scheduling latency, which makes it harder to hit high framerates.

I think I’m going to reinstall arch without zfs and see if that helps, it might be that I’m saturating the memory bandwidth between the ram cacheing on zfs and doing this… I’m going to try that and see

I don’t see how that’s possible, and reinstalling your entire OS based on a hunch feels like a waste of time. All filesystems have a RAM cache, and it isn’t magically going to steal all your RAM bandwith. Dual channel 2133 MHz DDR4 is rated for 34GB/s, you aren’t hitting anywhere near that with looking glass.

Do you get the hitching at 1080p 144hz or 1440p 60hz on the guest?

Yes I do get it, and it’s not the only reason why I reinstalled the os… I wanted to do that anyways because I’ve been experiencing other issues unrelated to this with some dependencies as well.

I experience a similar thing. Just got it up and running yesterday.

1080p 60Hz
Asrock Taichi x570
rx 6600 - linux host (pci-e 4.0 x16)
rx 590 - windows 10 guest (pci-e 4.0 x8)
32GB DDR 4 Ram 3200 MHz
Ryzen 7 5800X

What I am experiencing is that the game through the looking glass client either in obs or the standalone look stunningly great but there is a bit of lag sometimes, like the framerate or frametime drops on my linux machine, via hdmi and seperate monitor out the game runs perfectly fine and no lag or microstutter at all, its only in the looking glass client.

I was working fine with one day, hitching the next, fine again, etc.

for me it turned out that I was randomly connecting a PS4 controller (usb pass-through) to different USB ports. The USB2 port doesn’t cause any hitching, the usb3 port is basically unusable.

If you are passing other devices in (I’m passing in a GPU, SSD, vNIC, and a couple of USB devices), check those.

also, take a look at the following: