Counter-Strike 2

Counter-Strike 2

56 ratings
Max performances on Linux
By Keplyx
This guide will help you get a maximum of fps on Linux, based on my experience.

I will mainly focus on Nvidia hardware, as I don't have any AMD graphics card.

The following is mainly for Ubuntu based systems (I use KDE Neon), so the first steps may vary for you.

Everybody knows Linux is not the best for playing game, as drivers are usually less powerful than on windows, and games have less support. But a huge progress has been made in the recent years, and with some tweaks, it is even possible to get more fps than on windows.

I will cover everything, from installing the drivers to tweaking configurations, but if you already did some of the steps bellow, jump directly to the section that interests your.
   
Award
Favorite
Favorited
Unfavorite
Preview
Here's a preview of the effects of this guide on my computer:
Potato Alert
First of all, make sure you do not have a potato as a PC. Check the minimum requirements, and if you are bellow those settings, well good luck.
Nvidia Users
Install Proprietary Drivers
Make sure you use the proprietary drivers for you GPU, as those give better performances than the nouveau (open source) drivers.

To install them, first add the graphics repository:
  • sudo add-apt-repository ppa:graphics-drivers/ppa
remember to update your package list:
  • sudo apt update
then display the available drivers with the command bellow:
  • ubuntu-drivers devices
You should get an output like this:
Find the line that ends with recommended, here nvidia-driver-430, then install that driver:
  • sudo apt install nvidia-driver-(number)
Here I used sudo apt install nvidia-driver-430 to install the recommended one.


More information here: here[askubuntu.com].

Laptops

If you have a laptop with an Nvidia card, you most probably have the optimus system installed. Optimus is a system developed by Intel and Nvidia. It allows switching from the integrated graphics (GPU on the Intel processor, less powerful but gives maximum battery life), to the Nvidia Card (the main GPU, drains battery faster but is a lot more powerful).

The state of optimus support under Linux is poor, but still usable. On Linux, you need to reboot to start the Nvidia GPU, while it automatically starts when you launch a game on Windows. As stated in the previous link, the required packages should have been installed along with the driver. You can check this by starting the nvidia-settings app:


To switch from one GPU to the other, start the nvidia-settings app, go to prime profiles like in picture above, and select the GPU you want to switch to. Keep in mind you will need to reboot for the change to take effect.

And that's it for the drivers, you should now be able to run csgo on your GPU.

Tweak Nvidia Settings

The default config for nvidia may not be perfect for you (especially if you don't have the latest card). To edit it, start the nvidia-settings program. It can be found by running the command nvidia-settings, or by finding the program in the list of installed apps.
Here, you can set the image quality, for better performances or quality.
You should also set power mizer to performance instead of auto or adaptive if you have the optimus system (sadly this resets on every new session.
AMD Users

Sadly, I do not have any AMD hardware, so I am not able to provide you with information. If you own one and found a way to get better performances, tell in the comments and I'll add it to this section.
CSGO (Independent of system)
Reset CSGO Config

Doing the above for nvidia users should be enough for most games, but csgo may still feel laggy despite high fps. For example, I had 120+ fps, but the game did not feel fluid at all when compared to other games.

The cause may be a faulty configuration. In my case, deleting my config did the trick.
Here are the steps:
  • Make a backup of the folder /home/USER/.steam/steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/ (path may vary on your system)
  • Delete it
  • Verify the csgo installation with steam (open steam, right click on csgo, properties, local files, verify integrity of game files).
  • Disable steam cloud sync for csgo
  • Make a backup of the folder /home/USER/.steam/steam/userdata/A VERY LONG NUMBER/730/ (the very long number is tied to you account. If you only have one account on your machine, then the only one available is yours. If you have several accounts, well, you can do this for both anyways)
  • Delete it
  • Open the game

With the backup you made, you can create a file for your binds and for your crosshair. In my case, I made a file named binds.cfg with all my binds, crosshair.cfg with my crosshair config, put them in the newly created /home/USER/.steam/steam/userdata/A VERY LONG NUMBER/730/local, then in csgo I ran the commands exec binds and exec crosshair.

Doing this helped greatly and it didn't feel like I was playing on a potato.

Tweak CSGO Video Settings
If you do not have a very powerful computer, use common sense and do not put every video setting on max. You can watch this video to understand which settings have the most important impact on your system: https://www.youtube.com/watch?v=b8UIZzUU4Ns&t=86s

For example, use MSAA x2 and FXAA combined instead of MSAA x8, this gives basically the same result but uses far less your CPU. More information here: https://www.youtube.com/watch?v=nEbAJHd84ug
Vertical sync in CSGO does not seem to work on Linux, so simply disable it.
Distro Specific
If your system has desktop animations, you should disable them while playing. It will improve fps, as well as reducing frame delay.

In Ubuntu, this is called Compiz, in KDE, the compositor.

For example, in Kubuntu (or KDE in general), press alt+shift+F12 to toggle the compositor. If you have a high end GPU, you may not notice a huge difference, so you may want to keep it enabled. You can use various effects in-game, such as a zoom, a fake crosshair, and other funny stuff (use that at your own risk though).

If you really need all the frames you can get, you could kill the desktop manager while in game and reopen it after. This will free some RAM and hopefully improve your fps.
For example, in KDE, you can open a console, type:
  • pkill plasmashell
your wallpaper will become black but this is expected as you just killed the desktop manager. When you are finished playing, reopen a console and type:
  • plasmashell &
Close that console and you are good to go.

Some users reported that starting a game in it's own separate X-server improved their performances, but I never managed to do it, but feel free to try it on your own if you have the sufficient knowledge.
Gamemode
Thanks to Feral Interactive, we know have a very powerful game optimizer on Linux. Gamemode[github.com] gives top priority to the game while playing, removing stutters and improving fps.

To install gamemode, you can try and see if it is available on your package manager (for example on ubuntu based distros, with sudo apt install gamemode).
If you do not find the package, you can build it from source (this is what I did), which is fairly easy. Simply follow these instructions[github.com].

Once installed, right click on your game in the steam library, properties, set launch option, and enter gamemoderun %command% before any launch option you have.


And that's it, every time you start your game it will be optimized by gamemode. To check whether it is active, open a terminal after you started the game and write gamemoded -s, it should say gamemode is active.
Conclusion
Those are the little tips and tricks I used to get my csgo running perfectly, even on not so recent hardware. In my case, I had a lot of fps, but the game didn't feel smooth at all compared to the windows version. Resetting the config and enabling gamemode did the trick.
Hope it helps a fellow gamer in need.
Troubleshooting
If you cannot start the game after the panorama update, add -nojoy as launch option. For some reason the game starts after that (this is a know issue[github.com])
15 Comments
ELEKTRO I Trading Skins 20 Jun, 2023 @ 12:15pm 
Great post, we need more posts like that!
Zordon 17 May, 2023 @ 1:01am 
You can also use tools like proton-ge with amd FSR, gamescope, zink, a low latency Kernel, etc.
Zordon 17 May, 2023 @ 12:59am 
You can also improve the gamemode creating a custom gamemode.ini config file and make some tweaks like these:

[general]

reaper_freq=5

desiredgov=performance

defaultgov=schedutil


igpu_power_threshold=-1

softrealtime=on

renice=20

ioprio=0

inhibit_screensaver=1


After creating a custom configuration folder, open this file with sudo:
sudo nano /etc/security/limits.conf

and paste this command in the end of the file and save:
@wheel - nice -20

Now everytime you use gamemode, they will gonna change your game to the highest priority and set your power settings to the performance mode.
Keplyx  [author] 22 Jul, 2021 @ 9:39am 
Yes gamemode is really useful, it removed stutter from many games! I think it comes preinstalled in some linux distros now
Macro Nerd 21 Jul, 2021 @ 10:45pm 
Gamemode made it so much better. I had been getting microstutters for months and it would drive me crazy. My frame rate would bomb when getting shot sometimes. Now I rarely dip below 100 fps and when I do I only know because of netgraph. This is a really helpful guide and I hope I don't have to reset my config but thank you!
drkdo 15 May, 2021 @ 12:17pm 
how do you save all these settings into nvidia application profile? for example so they are only set when CS:GO is launched.
Szpila 23 Apr, 2021 @ 2:01am 
why my Nvidia server x dont have screen X only gpu
tanjil 20 Mar, 2021 @ 2:31pm 
Hi, im using Parrot OS, i cant do sudo add-apt-repository ppa:graphics-drivers/ppa because appears the following error
Error: could not find a distribution template for Parrot/n/a

Im trying to install nvidia drivers and im trying to run the following command
└──╼ $nvidia-settings

ERROR: NVIDIA driver is not loaded


ERROR: Unable to load info from any available system
Same as └──╼ $nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.


I already did sudo apt install nvidia-cuda-toolkit
Any solutions to insall nvidia graphics at parrot?
Keplyx  [author] 1 Feb, 2021 @ 11:15pm 
I'm using csgo with gamemode right now and I don't have any issue
midnight 1 Feb, 2021 @ 3:04pm 
Great tips!