gnif / LookingGlass

An extremely low latency KVMFR (KVM FrameRelay) implementation for guests with VGA PCI Passthrough.
GNU General Public License v2.0
4.72k stars 260 forks source link

[FR] Add an fpsMax parameter for when vsync is disabled to prevent excessive resource usage. #1053

Closed Asmageddon closed 1 year ago

Asmageddon commented 1 year ago

As per title. On my machine, with vsync off, LG uses up to 15% of my host CPU and presumably a measurable amount of GPU for no real benefit - my display is incapable of displaying >1000 FPS.

gnif commented 1 year ago

LG doesn't "generate frames", it captures the frames your title is making as it makes them, you need to limit the FPS of the title.

gnif commented 1 year ago

sorry just realised you're talking about the client app, not the host app.

This is still not something that we will do, the high FPS is during mouse movement of the hardware cursor. Without this your mouse will feel laggy. While you're correct that the display can't keep up with these figures, the GPU pushes the latest most current frame to the screen when it's time to update your monitor. If we slow this down, the mouse becomes laggy as the position it's at in the GPU buffer will be delayed.

As for 15% of the host CPU, yes, because mouse handling has to happen also, it's not just the FPS causing this load increase.

One way you can avoid this is to make use of jitRender which works best on Wayland which only redraws the most recent frame when it's told the screen redraw is about to happen.