Feral Interactive has been doing an amazing job porting games to Linux. Way to go, Feral! I have played several of their ported games on Linux (my distro of choice is Arch Linux), like Alien: Isolation, Tomb Raider, and Hitman. In 2018 Feral released Rise of Tomb Raider for Linux as well. Since this game is very demanding in terms of hardware capatilities, they recommend Linux users to set CPU governor to performance in order to play it (and other games too, actually).

So, let’s see how to do it.

The Script

Feral actually has a faq explaining the commands to set CPU governor to either performance (for playing games) or powersave (for when you are using the computer for ordinary tasks that do not require that much power).

Since it is a bit harder to remember the whole path and command line used to set it, I decided to make a shell script to run the actual commands. Check the script on gitlab.

set CPU to either performance or powersave.

#!/usr/bin/env bash

# This script sets all available CPUs to either
# 'performance' (for playing games, for instance)
# or 'powersave'.
# I Made this script based on the information from:
# Instead of this script, you may want to use the 'gamemode' (open source)
# tool by Feral Interactive:
# Way to go, Feral!
# ------
# Download this script and save it as `` then
# just run it like this:
#     bash --performance
# or
#     bash --powersave
# Of course, if you have more experience with Linux, you can also make it
# executable, add it your some directory in your PATH and just run it like
# any other command.
# NOTE: This script assumes you have `tr', `sed', `wc' and `bash' at least
# version 3.2 installed. This should be the no problem for any Linux
# distribution as of 2018.
# NOTE: We also assume you have `sudo' installed and you are in a group that
# allows you to used `sudo'. This is the default on Ubuntu and derived distros.
# For Arch Linux (also useful for other distros), check:
# Checking the current mode
# -------------------------
# To check in which mode your CPUs are currently in, check one
# of your CPUs, example:
#     cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor

usage () {


Run with: ‘%s’ or ’%s’\n' '--powersave' '--performance'


    $script_name --performance

    $script_name --powersave

You may also use '--dry-run' as the second argument, in
which case no real configurations will be made, but the
script will just print what it _would_ do:

    $script_name --performance --dry-run

    $script_name --powersave --dry-run

    exit 0

if [[ $# < 1 ]] ; then


case "$1" in

if [[ "$2" == '--dry-run' ]]; then

# Replace tabs with spaces.
# Squeeze multiple spaces to one space.
# Match lines '^processor : <num>$'. Not all SEDs support `[0-9]\+'.
# Count those lines.
# Delete '\n' produced by previous command.
num_processors=$(cat /proc/cpuinfo \
    | tr '\t' ' ' \
    | tr -s ' ' \
    | sed -n '/^processor : [0-9][0-9]*/p' \
    | wc --lines \
    | tr -d '\n')

# Perform the actual config.
for (( num = 0; num < $num_processors; num++ )) ; do
    if [[ $try =~ --dry-run ]] ; then
        printf "Would set CPU '%d' to '%s'\n" $num $mode
        printf "echo \"$mode\" | sudo tee \"/sys/devices/system/cpu/cpu${num}/cpufreq/scaling_governor\n"
        printf "Setting CPU '%d' to '%s'\n" $num $mode
        echo "$mode" | sudo tee "/sys/devices/system/cpu/cpu${num}/cpufreq/scaling_governor"

Download and run

Download the script:


Run it without arguments to see some help text:


See what it would do:

bash --performance --dry-run

Set CPU to performance (for real):

bash --performance

Set CPU back to default:

bash --powersave

Feral Gamemode Open Source Tool

Instead of the above script, you may want to check Feral Interactive’s Gamemode open source tool. There is an AUR package for Arch Linux.

Links and Resources