Difference between revisions of "Improving performance"

From Linux Gaming
Jump to navigation Jump to search
Line 12: Line 12:
**If you can't or don't want to install a kernel that is Fsync compatible, you can also enable Esync. The performance boost is usually not as large, though.
**If you can't or don't want to install a kernel that is Fsync compatible, you can also enable Esync. The performance boost is usually not as large, though.
*Install an optimized kernel like <code>zen</code>, <code>linux-tkg-pds</code>, or <code>Xanmod</code>.  
*Install an optimized kernel like <code>zen</code>, <code>linux-tkg-pds</code>, or <code>Xanmod</code>.  
**<code>linux-tkg-pds</code> ([https://github.com/Frogging-Family/linux-tkg linux-tkg] with PDS scheduler) seems to perform better than <code>zen</code><ref>https://www.youtube.com/watch?v=qNzd57b0h08</ref>, and seems to have a lower input lag. Some people also recommend using <code>linux-tkg-bmq</code> (linux-tkg with BMQ scheduler) to get more consistent frame times. To get all benefits you have to compile it yourself, though. Alternatively you could also get it from [https://aur.chaotic.cx/ chaotic AUR].
**<code>linux-tkg-pds</code> ([https://github.com/Frogging-Family/linux-tkg linux-tkg] with PDS scheduler) seems to perform better than <code>zen</code><ref>https://www.youtube.com/watch?v=qNzd57b0h08</ref>, and seems to have a lower input lag. Some people also recommend using <code>linux-tkg-bmq</code> (linux-tkg with BMQ scheduler) to get more consistent frame times. To get all benefits you have to compile it yourself, though. Alternatively you could also get it from [https://aur.chaotic.cx/ chaotic AUR] ([https://archlinux.pkgs.org/rolling/chaotic-aur-x86_64/ list of available packages]).


==Optional==  
==Optional==  

Revision as of 09:00, 3 March 2022

Major tweaks

This will give a huge boost for all games. If your presets are bad, this might be in the magnitude of 300% more FPS:

  • If you use X11, disable composition.
  • Set GPU and CPU to maximum performance. This might not always be necessary, but will give large improvements in some cases. Definitely try it if you notice stuttering or input lag.
    • CPU: You can use GameMode or CoreCtrl to do this.
    • GPU: Read the AMD/Nvidia specific tweaks section to see how.
  • Look at your thermals and if they are too high, adapt the fan speed.

Minor tweaks

This will not make a difference as big as the major tweaks. But depending on the game, it can still give you something in the scale of ~20% FPS. Maybe more, maybe less.

  • Enable Fsync. You need to use a compatible Kernel (like zen, tkg-pds, or Xanmod; kernel above 5.16 is compatible with F-sync out of the box), and enable it in Lutris: Right click the game -> Configure -> Runner options -> Enable Fsync
    • If you can't or don't want to install a kernel that is Fsync compatible, you can also enable Esync. The performance boost is usually not as large, though.
  • Install an optimized kernel like zen, linux-tkg-pds, or Xanmod.
    • linux-tkg-pds (linux-tkg with PDS scheduler) seems to perform better than zen[1], and seems to have a lower input lag. Some people also recommend using linux-tkg-bmq (linux-tkg with BMQ scheduler) to get more consistent frame times. To get all benefits you have to compile it yourself, though. Alternatively you could also get it from chaotic AUR (list of available packages).

Optional

  • Use FSR. This might dramatically improve your framerate in GPU limited games but will definitely hurt the image quality.

Input lag, Desktop Environments, and x11/Wayland

This page needs work, for the following reason(s): Might be outdated, and there is missing data for various desktop environments and window managers.
  • It appears that KDE Plasma (X11) with no composition (currently) is (one of) the best regarding performance, and input lag. Gnome is also ok.[2]
    • Generally you should be fine if you can disable composition. This is not possible in Gnome, but Gnome uses unredirection (the same thing, Windows does) instead, which is almost as good.
  • You should only use Wayland, if you can enable FreeSync, because otherwise it will force vsync. If you are using KDE, and you have FreeSync enabled, the performance and input lag should be close to KDE X11 with composition disabled.[3] The input lag will increase by the "half frame" that is displayed with tearing. It's basically the question whether or not you want to wait for the frame to complete before displaying it. KDE Plasma is currently the best DE for Wayland.[4]

It should be noted that we are talking about milliseconds here (the best value is 20ms, the worst is 90ms). If you are not susceptible to this, you might not even notice. But generally speaking, the game will feel more responsive if your input lag is low. You might also notice stuttering if you 99th percentile is bad.

AMD/Nvidia specific tweaks

AMD

  • Use CoreCtrl
    • Add a profile for every game:
      • For your GPU select Performance mode: Fixed and use the High setting (you may also adapt GPU fan speed here)
      • For your CPU select Performance scaling: Custom and use Frequency governor: Performance
  • Use Mesa drivers

Nvidia[5]

This page needs work, for the following reason(s): not complete, and just copied from a reddit post.
  • Use the proprietary Nvidia driver. In almost every case the proprietary Nvidia driver will offer much better performance than the open source driver, Nouveau.[6][7] In addition, Nouveau does not support many features available on newer Nvidia cards.[8]
  • Use DKMS. DKMS is a prerequisite for using custom kernels like Zen, Xanmod or tkg with the Nvidia driver. It also lets you update to newer kernel versions without waiting for an Nvidia driver update. [9]Every distro that has proprietary Nvidia driver support offers a DKMS version.
  • The Arch Wiki is the best place to start. Enable coolbits as the link explains. Good is, setting the coolbits value to 28 on anything currently supported (post-Fermi) to enable full control over the GPU (at least, as much control as you're allowed to be given).
  • Use GreenWithEnvy for overclocking, setting power limits (raise or lower) and fan curves. It's the closest alternative we have to MSI Afterburner.
  • Make sure to use a Proton version of 6.3, Experimental, Proton-6.21-GE-2 or later for Proton-GE and Proton-tkg/wine-tkg-git of 6.17 or greater (or build your own) for DLSS support. For Steam, you need to put PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 %command% in your launch options (side note: there should only ever be one %command%).
  • For non-Steam games, use the latest lutris or wine-ge-custom build, with Lutris, and make sure to toggle on DLSS support in the Configure -> Runner options menu (though this might be better-suited to a Lutris article, which should exist). For non-Steam games, you also need a dxvk.conf file with dxgi.nvapiHack = False in it. You can just create one (mine is ~/Documents/dxvk.conf) and set DXVK_CONFIG_FILE=/path/to/dxvk.conf in your /etc/environment.
  • Use this to get minimal required drivers installed.
  • For Arch-based distributions, use TKG's nvidia-all repo, with _dkms="" set to true in customization.cfg.

Troubleshooting

  • Limiting FPS with MangoHud can introduce input lag. (I assume it adds one frame delay. It might as well be a bug, and only happen in specific scenarios. If you know more, why this happens, if, or how it can be avoided, please add information here.)