[Solved] Bad FPS and freeze

When I play games using LG, I have more than 2x less fps. I have disabled gsync and vsync. I tried with and without spice but nothing change.
Also sometimes, my LG freezes and I can’t kill the process on the windows host, I have to reboot to VM.
I have nothing in logs for both problems.
High chance I did something bad but I don’t really know where to look.

Host GPU: 5700xt
Client GPU: 4070
CPU: 5600x
OS: Arch/W11
LG: B6
Screen: 1920x1080 144hz

My current VM XML:

<domain type="kvm">
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/11"/>
  <memory unit="KiB">33554432</memory>
  <currentMemory unit="KiB">33554432</currentMemory>
  <vcpu placement="static">8</vcpu>
    <vcpupin vcpu="0" cpuset="2"/>
    <vcpupin vcpu="1" cpuset="8"/>
    <vcpupin vcpu="2" cpuset="3"/>
    <vcpupin vcpu="3" cpuset="9"/>
    <vcpupin vcpu="4" cpuset="4"/>
    <vcpupin vcpu="5" cpuset="10"/>
    <vcpupin vcpu="6" cpuset="5"/>
    <vcpupin vcpu="7" cpuset="11"/>
    <emulatorpin cpuset="0-1,6-7"/>
    <iothreadpin iothread="1" cpuset="0-1,6-7"/>
  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-8.0">hvm</type>
      <feature enabled="no" name="enrolled-keys"/>
      <feature enabled="yes" name="secure-boot"/>
    <loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/x64/OVMF_CODE.secboot.fd</loader>
    <nvram template="/usr/share/edk2/x64/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vpindex state="on"/>
      <synic state="on"/>
      <stimer state="on"/>
      <reset state="on"/>
      <vendor_id state="on" value="kvm hyperv"/>
      <frequencies state="on"/>
      <hidden state="on"/>
    <vmport state="off"/>
    <smm state="on"/>
    <ioapic driver="kvm"/>
  <cpu mode="host-passthrough" check="none" migratable="on">
    <topology sockets="1" dies="1" cores="4" threads="2"/>
    <cache mode="passthrough"/>
    <feature policy="require" name="topoext"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x9"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0xa"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0xb"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3"/>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0xc"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4"/>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0xd"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5"/>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0xe"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x6"/>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0xf"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x7"/>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x10"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    <controller type="pci" index="15" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="15" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    <controller type="pci" index="16" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    <interface type="network">
      <mac address="52:54:00:0d:34:f8"/>
      <source network="enp42s0"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <input type="mouse" bus="virtio">
      <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
    <input type="keyboard" bus="virtio">
      <address type="pci" domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>
    <input type="evdev">
      <source dev="/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"/>
    <input type="evdev">
      <source dev="/dev/input/by-id/usb-Keychron_Keychron_K3_Pro-event-kbd" grab="all" grabToggle="ctrl-ctrl" repeat="on"/>
    <tpm model="tpm-tis">
      <backend type="emulator" version="2.0"/>
    <audio id="1" type="none"/>
    <hostdev mode="subsystem" type="pci" managed="yes">
        <address domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
      <boot order="1"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    <hostdev mode="subsystem" type="pci" managed="yes">
        <address domain="0x0000" bus="0x2b" slot="0x00" function="0x0"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    <hostdev mode="subsystem" type="pci" managed="yes">
        <address domain="0x0000" bus="0x2b" slot="0x00" function="0x1"/>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    <watchdog model="itco" action="reset"/>
    <memballoon model="none"/>
    <shmem name="looking-glass">
      <model type="ivshmem-plain"/>
      <size unit="M">32</size>
      <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>

LG client (my linux)

❯ looking-glass-client -s -F
[I]   4669462403              main.c:1785 | main                           | Looking Glass (B6)
[I]   4669462418              main.c:1786 | main                           | Locking Method: Atomic
[I]   4669462601           cpuinfo.c:37   | lgDebugCPU                     | CPU Model: AMD Ryzen 5 5600X 6-Core Processor
[I]   4669462609           cpuinfo.c:38   | lgDebugCPU                     | CPU: 1 sockets, 6 cores, 12 threads
[I]   4669469000              main.c:1162 | lg_run                         | Using font: /usr/share/fonts/TTF/DejaVuSansMono.ttf
[I]   4669469055           ivshmem.c:128  | ivshmemOpenDev                 | KVMFR Device     : /dev/shm/looking-glass
[I]   4669469089               egl.c:267  | egl_initialize                 | Double buffering is off
[I]   4669469094              main.c:1116 | tryRenderer                    | Using Renderer: EGL
[I]   4669477282                gl.c:58   | waylandGetEGLDisplay           | Using eglGetPlatformDisplay
[I]   4669498724               egl.c:828  | egl_renderStartup              | Single buffer mode
[I]   4669500210               egl.c:855  | egl_renderStartup              | EGL     : 1.5
[I]   4669500215               egl.c:856  | egl_renderStartup              | Vendor  : AMD
[I]   4669500218               egl.c:857  | egl_renderStartup              | Renderer: AMD Radeon RX 5700 XT (navi10, LLVM 15.0.7, DRM 3.49, 6.1.46-1-lts)
[I]   4669500221               egl.c:858  | egl_renderStartup              | Version : OpenGL ES 3.2 Mesa 23.1.6
[I]   4669500225               egl.c:859  | egl_renderStartup              | EGL APIs: OpenGL OpenGL_ES
[I]   4669500231               egl.c:930  | egl_renderStartup              | Debug messages disabled, enable with egl:debug=true
[I]   4669529086           eglutil.c:35   | swapWithDamageInit             | Using EGL_KHR_swap_buffers_with_damage
[I]   4669532896              main.c:1566 | lg_run                         | Guest Information:
[I]   4669532901              main.c:1567 | lg_run                         | Version  : B6
[I]   4669532903              main.c:1588 | lg_run                         | UUID     : f7b469f1-b897-4968-9482-440a90c30d86
[I]   4669532909              main.c:1597 | lg_run                         | CPU Model: AMD Ryzen 5 5600X 6-Core Processor
[I]   4669532914              main.c:1598 | lg_run                         | CPU      : 1 sockets, 4 cores, 8 threads
[I]   4669532915              main.c:1600 | lg_run                         | Using    : DXGI Direct3D 11
[I]   4669532917              main.c:1636 | lg_run                         | OS       : Windows
[I]   4669532919              main.c:1638 | lg_run                         | OS Name  : Windows 10 Pro (Build: 22621)
[I]   4669532920              main.c:1660 | lg_run                         | Starting sessio[I]   4669675358              main.c:698  | main_frameThread               | Format: FRAME_TYPE_BGRA 1920x1080 stride:1920 pitch:7680 rotation:0

LG host (Windows)

[I]    183621300              dxgi.c:390  | dxgi_init                      | Device Name       : \\.\DISPLAY1
[I]    183621841              dxgi.c:391  | dxgi_init                      | Device Description: NVIDIA GeForce RTX 4070
[I]    183622364              dxgi.c:392  | dxgi_init                      | Device Vendor ID  : 0x10de
[I]    183622855              dxgi.c:393  | dxgi_init                      | Device Device ID  : 0x2786
[I]    183623383              dxgi.c:394  | dxgi_init                      | Device Video Mem  : 12026 MiB
[I]    183623903              dxgi.c:395  | dxgi_init                      | Device Sys Mem    : 0 MiB
[I]    183624390              dxgi.c:396  | dxgi_init                      | Shared Sys Mem    : 16374 MiB
[I]    183679129              dxgi.c:503  | dxgi_init                      | Feature Level     : 0xc100
[I]    183679548              dxgi.c:504  | dxgi_init                      | Capture Size      : 1920 x 1080
[I]    183679897              dxgi.c:505  | dxgi_init                      | AcquireLock       : enabled
[I]    183680172              dxgi.c:506  | dxgi_init                      | Debug mode        : disabled
[I]    183682639              dxgi.c:598  | dxgi_init                      | Source Format     : DXGI_FORMAT_B8G8R8A8_UNORM
[I]    183682970              dxgi.c:640  | dxgi_init                      | Request Size      : 1920 x 1080
[I]    183684413              dxgi.c:658  | dxgi_init                      | Output Size       : 1920 x 1080
[I]    183684777              dxgi.c:666  | dxgi_init                      | Copy backend      : Direct3D 11
[I]    183685061              dxgi.c:667  | dxgi_init                      | Damage-aware copy : enabled
[I]    183685533               app.c:379  | captureStart                   | ==== [ Capture Start ] ====
[I]    183685865               app.c:312  | frameThread                    | Frame thread started

Has the resource useage during games changed at all?

The resource usage between with and without LG seems similar but when I was in game to test, few seconds after I again had the freeze. I can switch my monitor input when LG freeze and I have my normal fps.

I tried in rocket league with unlimited FPS, without LG I have like 100% gpu and 700 fps and when I use LG I am stuck to 30-40% gpu and 140 fps which feel stuttering.

Okay, so I can’t say I’m familiar with a lot of the virtualized part, I’m a dual-booter, but Windows does natively have options for variable refresh rate, there’s a change that it could be the Windows VM throwing the wrench in?

The thing is my Windows VM works correctly without LG.

Hi @hyderman have you tryed asking for help on LG Diskcord server. They probally will no what questions to ask.

If your Windows VM works fine without LG, why do you n

Solved on the discord, motherboard second slot limited to x4 speed.

1 Like