Refresh rate of windows randomly drops down to 0.3-20 fps, stays this way

This bug had been going for a while, through multiple updates.

What happens is that at some random point in time, some of the windows stop updating at correct refresh rates, dropping down to 0.3-20 fps. So sometimes it drops to less than 1 refresh a second, a literal slideshow.

I see it very often with windowed games, but this happens to Firefox too.
If it a game with an FPS counter, ingame counter does not change, however the game window still refreshes at way lower rate.

When the window is dragged or when some notification window is opened, fps returns to normal, however as soon as you stop dragging the window or notification disappears, fps drops back to much lower value.

Toggling off then on the setting "Enable Compositor at startup" resets all windows to correct refresh rates, but then the bug happens again after some time.

System:    Host: ghost Kernel: 5.6.11-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: KDE Plasma 5.18.5 
           Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: MSI model: 990FXA-GD65 (MS-7640) v: 3.0 serial: <filter> BIOS: American Megatrends v: 20.2 
           date: 04/12/2013 
CPU:       Topology: 8-Core model: AMD FX-8370 bits: 64 type: MCP arch: Bulldozer L2 cache: 2048 KiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 64036 
           Speed: 3987 MHz min/max: 1400/4000 MHz Core speeds (MHz): 1: 3987 2: 4052 3: 3585 4: 3628 5: 2712 6: 1832 7: 3886 
           8: 3990 
Graphics:  Device-1: NVIDIA TU104 [GeForce RTX 2070 SUPER] driver: nvidia v: 435.21 bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.8 driver: nvidia tty: N/A 
           OpenGL: renderer: GeForce RTX 2070 SUPER/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] SBx00 Azalia vendor: Micro-Star MSI driver: snd_hda_intel v: kernel 
           bus ID: 00:14.2 
           Device-2: NVIDIA TU104 HD Audio driver: snd_hda_intel v: kernel bus ID: 01:00.1 
           Device-3: GYROCOM C&C DigiHug USB Audio type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 9-5:5 
           Sound Server: ALSA v: k5.6.11-1-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel 
           port: d000 bus ID: 02:00.0 
           IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 11.62 TiB used: 6.44 TiB (55.4%) 
           ID-1: /dev/sda vendor: Seagate model: ST8000DM0004-1ZC11G size: 7.28 TiB 
           ID-2: /dev/sdb vendor: Crucial model: CT2000MX500SSD1 size: 1.82 TiB 
           ID-3: /dev/sdc vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
           ID-4: /dev/sdd vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB 
           ID-5: /dev/sde vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
           ID-6: /dev/sdf vendor: Crucial model: CT525MX300SSD1 size: 489.05 GiB 
Partition: ID-1: / size: 39.12 GiB used: 27.42 GiB (70.1%) fs: ext4 dev: /dev/sde1 
           ID-2: /home size: 767.09 GiB used: 667.15 GiB (87.0%) fs: ext4 dev: /dev/sde2 
           ID-3: swap-1 size: 18.00 GiB used: 10.92 GiB (60.7%) fs: swap dev: /dev/sde3 
Sensors:   System Temperatures: cpu: 55.0 C mobo: N/A gpu: nvidia temp: 36 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 26% 
Info:      Processes: 1681 Uptime: 9d 10h 20m Memory: 15.59 GiB used: 11.52 GiB (73.9%) Init: systemd Compilers: gcc: 9.3.0 
           Shell: bash v: 5.0.16 inxi: 3.0.37 

Please share
cat /etc/X11/mhwd.d/nvidia.conf

Also, you could install the latest driver 440

image

And we can try to tweak things a bit.

1 Like

I installed 435 after the bug had been happening on 440 for more than a month.
Will post nvidia.conf later, on another PC atm

Care to point me to it ?

What do you mean? If you mean that its a known bug on 440 branch then no, I haven't seen other mentions of it, just pointing out that switch back to 440 will likely do nothing since I was on that branch while the bug was happening for a long time

What bug are you referring too on 440 driver?
You have now the nvidia v: 435.21 installed and it drops frames.
You mentioned installing it because the 440 had a bug (but not this particular one? quite unclear and i wanted you to clarify it)

Are we talking about same bug? :slight_smile:

Yes, same bug, happens on both branches

Ok, personally and i think is common to consider it's a bug when happens on multiple systems and we eliminate the possibility of missconfiguration. I use the 440 since it came out and had no issues on my main rig. Looking forward to see the details i was asking about.

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 435.21

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 440.59

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics 34GK950F"
    HorizSync       225.0 - 225.0
    VertRefresh     48.0 - 144.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2070 SUPER"
        Option "NoLogo" "1"
EndSection

Section "Screen"

# Removed Option "metamodes" "3440x1440_144 +0+0"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-5"
    Option         "metamodes" "3440x1440_144 +0+0 {AllowGSYNCCompatible=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Make a backup of your config and then test this one:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "LG Electronics"
    ModelName      "LG Electronics 34GK950F"
    HorizSync       225.0 - 225.0
    VertRefresh     48.0 - 144.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2070 SUPER"
    Option         "TripleBuffer"  "On"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-5"
    Option         "metamodes" "3440x1440_144 +0+0 {AllowGSYNCCompatible=On} {ForceCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Before you reboot, create the file /etc/profile.d/kwin.sh
sudo touch /etc/profile.d/kwin.sh
and edit it with this lines in it:

export KWIN_TRIPLE_BUFFER=1
export __GL_YIELD=USLEEP
export __GL_MaxFramesAllowed=1

save it and reboot.

Note: After a couple of tests on GTX 650, GTX 960 and for a short time on a GTX 10xx family (can't recall now) the config provided works best at least on my system. I was using for a while the default config, but i had to get back to my config.

Also to check:

  • that you have the .compose-cache folder in your home directory
  • compositor set to OpenGL 3.1 with this settings:

  • in some cases the vsync performs better on Automatic, but i was not able to connect the dots and why is the case; Full screen repaints sometimes works, sometimes is creating issues. :man_shrugging: don't use it.

Tested this for 1 day and so far seems to be working.

Does enabling triple buffering lowers performance in games overall?

It should actually help, as triple buffering generates a third frame in the frame buffer aka back buffer, so there is always a frame ready to be displayed. I'm not a gamer, but even for graphic software this configs always helped on my end. Do more tests and see if the system remains stable and works as you expect. There should be no tearing and no frame lost when gaming tho, should look more fluent.

Forum kindly sponsored by