Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.

GameMode is a new daemon/lib combo for Linux that will allow you to optimize your PC for gaming. It’s not magic, it won’t suddenly make your Linux games suddenly get better performance, but it’s something that can help.

You might have seen a message box pop up with some more recent Linux ports from Feral Interactive, one that tells you that your current CPU governor is not optimised—like this:

When games end up waiting on the GPU, some CPU performance governors may downclock the CPU and then up it again later, which can result in performance problems. GameMode, as it is right now, is to help you with that. Curious about it and wanting to know a little more direct from the developers, Feral agreed to answer some quick questions I had about it:

1) Can you give us a rundown on what exactly GameMode is and why Linux gamers might need it?

“GameMode is a daemon/library combo for Linux, written in C, which allows games to request that a set of optimisations be temporarily applied to the host OS. These optimisations improve the performance of the game.

To apply these optimisations, some of our games require that users manually swap the CPU governor using sudo privileged commands. We've had some feedback from people saying that they'd prefer not to have to do so much setup in order to get the best performance from their game. Further to this, some users voiced concerns about the increased energy usage that might result from leaving the CPU in a higher power usage mode.

By automatically applying these optimisations when the game is running and removing them when it isn't, GameMode saves users the trouble of having to tinker. It also ensures that the CPU is restored to a more efficient state when they've finished playing.”

2) You say it is "intended to be expanded beyond just CPU governor states", what extras did you have in mind?

“A lot of good ideas have been put forward by beta testers, including de-activating tools like f.lux, swapping KWin from OpenGL to xrender, and changing users' chat client status to "Playing X". GameMode is Open Source, so pull requests, or forks with features like these are welcome.”

3) To be clear for our readers, is this something that will ship built-in with Feral games and will users have to do any manual steps to enable it?

“GameMode won't ship with the games; since it's open source, users will need to install it themselves using the steps on GitHub. The tool will only need to be installed once, and will work with all future Linux titles released by Feral.

It will also work with previously released games, provided users adjust their launch options on Steam.”

It’s currently under a “BSD 3-Clause License (Revised)” license and you can find out more on GitHub. It’s certainly going to be interesting to see how this project evolves over time, could end up being something extremely useful. It already made its way to the AUR for Arch users.

Once you've installed it using their instructions, you can then tell any game to use it by doing this command:

LD_PRELOAD=/usr/\$LIB/libgamemodeauto.so ./game

You can also add it as a Steam launch option for each of your games like so:

LD_PRELOAD=$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so %command%

If you wish to know what current CPU governor is in use, you can run this command in terminal:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I actually had pre-announcement access to it and testing it has given me some good early results. Obviously this will be game and hardware dependent and yes, all tests were done over multiple runs to ensure it wasn't a fluke.

Testing it with F1 2017 for example, gave these FPS results:

That might not look like a big difference, however, behind the FPS results are the frame timings:

  Without Game Mode With Game Mode
Min Frame Time 10.32ms 10.03ms
Average Frame Time 13.31ms 11.88ms
Max Frame Time 19.36ms 16.02ms

As you can see, it has helped to reduce frame timings while increasing the overall framerate, so using GameMode (or manually using performance mode) can have an impact resulting in a smoother game. Using GameMode instead of doing it manually, does have the benefit of your CPU reverting to a more power efficient mode afterwards of course.

Testing Deus Ex: Mankind Divided was a slightly different story, as it always gave a better minimum FPS score when using GameMode, but the average and maximum showed little difference—certainly still worth it though! As for frame timings, the built-in benchmark doesn't give them.

Company of Heroes 2 is similar to Deux Ex with the benchmark mode only giving FPS scores. During my testing, both in the benchmark mode and actually playing it, the difference was noticable when using GameMode—with it being much smoother overall:

Again, to stress, your results will depend on your hardware and it's no different to manually changing your CPU governor to performance—for now (until they do more with it), although it does bring it back down to powersave or ondemand automatically which is nice.

Rise of the Tomb Raider will be the first game from Feral to have support for it integrated, so you won't need to give it any special launch options. However, you still need to install the tool yourself.

It’s great to see Feral Interactive do more open source projects, as they already have their game launcher scripts up on GitHub too.

Article taken from GamingOnLinux.com.
57 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. You can also follow my personal adventures on Bluesky.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
92 comments
Page: 1/5»
  Go to:

Brisse Apr 10, 2018
I guess this won't do much for us AMD-users since they don't usually default to "powersave"? When I used Ubuntu 17.10 I think it defaulted to "ondemand" with my Ryzen 1700X, and now I'm on Debian Sid which seems to default to "performance".

Edit: I just realized the latter could be because I run a custom kernel.


Last edited by Brisse on 10 April 2018 at 10:31 am UTC
Nevertheless Apr 10, 2018
Holy cow, Linux has a game mode ;-)
Leopard Apr 10, 2018
Wow , cool stuff.

I'm on default setting for cpu power , which is "on demand" i guess.

Will try that , on i7 7700HQ.
mike44 Apr 10, 2018
Good but I would prefer not to install anything. Could we simply run a command before and after playing?
ysblokje Apr 10, 2018
For archlinux users I created some aur packages.

gamemode-git

gamemode (stable releases)

lib32-gamemode-git

lib32-gamemode (stable releases)


(edit : added lib32 variants)


Last edited by ysblokje on 11 April 2018 at 11:08 am UTC
Faattori Apr 10, 2018
Good but I would prefer not to install anything. Could we simply run a command before and after playing?

Yes you can.

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

https://www.gamingonlinux.com/articles/you-will-want-to-force-your-cpu-into-high-performance-mode-for-vulkan-games-on-linux.9369


Last edited by Faattori on 10 April 2018 at 10:44 am UTC
Nevertheless Apr 10, 2018
Good but I would prefer not to install anything. Could we simply run a command before and after playing?

You could do all it does yourself in a script before and after playing. It will just need sudo to do anything.. That's what a daemon keeps away from the user.
Liam Dawe Apr 10, 2018
I guess this won't do much for us AMD-users since they don't usually default to "powersave"? When I used Ubuntu 17.10 I think it defaulted to "ondemand" with my Ryzen 1700X, and now I'm on Debian Sid which seems to default to "performance".

Edit: I just realized the latter could be because I run a custom kernel.
I messed up the wording a little there, it works with both powersave and ondemand :)

FYI: powersave is the default for newer intel CPUs, ondemand is for older (source
Depending on the scaling driver, one of these governors will be loaded by default:

ondemand for AMD and older Intel CPU.
powersave for Intel CPUs using the intel_pstate driver (Sandy Bridge and newer).


Last edited by Liam Dawe on 10 April 2018 at 11:11 am UTC
Xpander Apr 10, 2018
I guess this won't do much for us AMD-users since they don't usually default to "powersave"? When I used Ubuntu 17.10 I think it defaulted to "ondemand" with my Ryzen 1700X, and now I'm on Debian Sid which seems to default to "performance".

Edit: I just realized the latter could be because I run a custom kernel.

it does impact. ondemand mode is not good either. it will switch between clocks in games a lot (not in all games) and will cause fps drops. i run my ryzen always on performance mode when i go gaming. It has pretty big impact on the minimum framerates when running ondemand.

if you are on performance mode then its fine, its not the default behaviour on most distros though. Running it on performance constantly isnt that great also imo, but ryzen is pretty efficient (on idle with performance mode enabled) and just adds +20W compared to ondemand judging by my UPS reporting


to avoid sudo thing i created a polkit rule for cpupower to let me execute the command without sudo :)

looking forward to see this gamemode being implemented into the future games of feral and others.


Last edited by Xpander on 10 April 2018 at 11:05 am UTC
Jahimself Apr 10, 2018
Wow! Usefull tool, I myself is not abble to create such a tool, and it was a bit annoying to run a .sh every time I wanted to play a game, and also after playing the game. Clearly good stuff.

Microsoft must be like WTF!! They have million dollars (if not billion) of ressource to make a game mode that is slower than normal mode, and a small but well trained team of porter release an open source that actually works as intended!

Thank you Feral Interactive, good job!


Last edited by Jahimself on 10 April 2018 at 11:05 am UTC
Grimfist Apr 10, 2018
For archlinux users I created some aur packages.

gamemode-git

gamemode (stable releases)

Give this man a cookie! This is the reason why I switched to an Arch-based distro. ;)

And big thanks to Feral for continuous support of us Linux freaks!


Last edited by Grimfist on 10 April 2018 at 11:03 am UTC
Xpander Apr 10, 2018
This is what i used so far:

Spoiler, click me
xpander@arch ~ $ cat /usr/share/polkit-1/actions/org.archlinux.pkexec.cpupower.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 " http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  <action id="org.archlinux.pkexec.cpupower">
    <message>cpupower without super user</message>
    <icon_name>cpupower</icon_name>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/cpupower</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>

</policyconfig>


and then keybinds for:

pkexec cpupower frequency-set -g performance && notify-send "Performance Mode" "Cpu clocks set to perfromance mode" -t 2000 -i messagebox_info

and pack to normal:
pkexec cpupower frequency-set -g ondemand && notify-send "Ondemand Mode" "Cpu clocks set to ondemand mode" -t 2000 -i messagebox_info
Marky Apr 10, 2018
This is seriously cool; both in concept and to see Feral further helping the platform (with open source, no less!).
I won't be installing it yet, as I already use indicator-cpufreq to change the cpu governor. But When other improvements come I probably will give it a spin.


Last edited by Marky on 10 April 2018 at 11:20 am UTC
buenaventura Apr 10, 2018
Cool, will definately try this out, for me, a few frames more can mean difference between playable and not, so yeah, great!
Shmerl Apr 10, 2018
I guess this won't do much for us AMD-users since they don't usually default to "powersave"? When I used Ubuntu 17.10 I think it defaulted to "ondemand" with my Ryzen 1700X, and now I'm on Debian Sid which seems to default to "performance".

Edit: I just realized the latter could be because I run a custom kernel.

Debian testing defaults to "ondemand". I have scripts that switch it to "perforamnce" for certain games, and then back to "ondemand".
Shmerl Apr 10, 2018
Shouldn't this kind of feature be built-in with the OS?

It is. Check:

cpupower help frequency-set

sudo cpupower frequency-info



Last edited by Shmerl on 10 April 2018 at 11:20 am UTC
Keyrock Apr 10, 2018
Great stuff from Team Cheetah. There are a bunch of companies and individuals doing great work to make Linux a more gaming friendly OS, notably Valve and Feral. Keep up the great work!
bolokanar Apr 10, 2018
I hope it get's non-systemd variant with time.
For now we gotta use the good old terminal.
Eike Apr 10, 2018
View PC info
  • Supporter Plus
Feral wrote "The first Feral release to integrate the tool is Rise of the Tomb Raider, an incredible action-adventure coming to Linux this month." But Liam is testing it with other games. What does that mean? In the moment, it has to be trigger manually, and starting with Rise of the Tomb Raider, it will do automatically if it finds the daemon?
Eike Apr 10, 2018
View PC info
  • Supporter Plus
For archlinux users I created some aur packages.

Did you find a way to test it?
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.