My system becomes very sluggish after running any game

Hey there! I am completely new to Linux in general so I thought I’d stop by and ask for some help. Basically my PC runs OK when I’ve just booted it up, but upon running even GTA Vice City from Steam using Proton 6.3, it just becomes really lag if I alt tab, and once I close the game, although it becomes a little faster, it is still slower and not a smooth experience in general. I have the proprietary drivers.

I ran mhwd -li and it said this:

              NAME               VERSION          FREEDRIVER           TYPE

      video-nvidia            2020.11.30               false            PCI

My specs are a Ryzen 7 3800x, 2x16 gb of RAM at 3200 MHz (Corsair Vengeance) and a 1660 Ti.

Any help would be greatly appreciated.

PS: I also tried GTA IV but it crashes after the loading screen.

Hello,

Probably the compositor is turned off while gaming, or it crashes when closing the game or at Alt+Tab …
Check in Compositor settings, set it to OpenGL 3 and disable Allow apps to disable compositor.

1 Like

I just did that and restarted my PC. It’s even worse this way. GTA Vice City runs at like 5 fps for some reason.

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

Here:

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

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
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"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
        Option "NoLogo" "1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    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

PS: Allowing apps to block composition fixes GTA VC’s low framerate but then results in my PC acting up

Make a backup of your original file:
sudo cp /etc/X11/mhwd.d/nvidia.conf /etc/X11/mhwd.d/nvidia.conf_BCK

Then edit the /etc/X11/mhwd.d/nvidia.conf and replace everything with this:

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

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
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"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option  "ConnectToAcpid"    "Off"
    Option "metamodes" "nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    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

Save it and reboot the system. If you notice an improvement then we can tweak it even more, but might not be necessary. If is worst than that, then the issue might be elsewhere, so you can restore your original file from the BCK one.

I just tried that and there isn’t any difference.

Ok,
Lets try to make kwin use triple buffer. Add this line above ConnectToAcpid entry in Sction “Device”

Option         "TripleBuffer"  "On"

Then from terminal run this command:
echo "export KWIN_TRIPLE_BUFFER=1" | sudo tee /etc/profile.d/kwin.sh

Make sure you set it like this in Compositor:


Reboot.

Just finished testing and there’s a difference now. Although when I don’t allow apps to block compositing GTA VC still runs at 5 fps, and when I alt tab while playing with allow applications to block compositing my PC is still very sluggish, the difference comes in when I close the game. My PC runs fine afterwards, unlike before where it would just start running very weird.

Well, see what scenario will have the best outcome. Still unclear for me why all this happen to your system, but if you notice a positive change in what we did, then it might be just that “is not perfect” :slight_smile:

Yeah, I will. Thanks a lot for spending your time helping someone as clueless as me that also has extremely broken english haha :smiley: !

1 Like