How to Enable Game Mode for Better Gaming Experience in Ubuntu Linux

Last updated: April 26, 2024

Want to get better performance when playing games in Linux? Try GameMode!

GameMode is a free open-source Linux project allows games to request a set of optimizations be temporarily applied to the host and/or game process.

The project was originally designed as a stop-gap solution to problems with Intel and AMD CPU powersave or ondemand governors. But now GameMode supports for optimizations including:

  • CPU governor
  • I/O priority
  • Process niceness
  • Kernel scheduler
  • Screensaver inhibiting
  • GPU performance mode (NVIDIA and AMD), GPU overclocking (NVIDIA)
  • Custom scripts

1. How to Install GameMode in Ubuntu Linux:

The package is available in Ubuntu as well as most other Linux repositories.

Firstly open terminal by either searching from ‘Activities’ overview screen, or pressing Ctrl+Alt+T on keyboard. When terminal opens, run command to install it:

sudo apt install gamemode

For Fedora and CentOS Linux, you can install it via command:

sudo dnf install gamemode

(Optional) Install GameMode indicator:

For choice, you can install an indicator applet that shows the current status of GameMode. It’s an extension for the default Gnome desktop.

a.) Open terminal and run command to make sure chrome-gnome-shell browser integration is installed:

sudo apt install chrome-gnome-shell gnome-shell-extension-prefs

b.) Next go to the extension web page by clicking the button below. And turn on the slider icon to install it.

If you don’t see the toggle icon, click the “click here to install browser extension” link to install browser extension and reload the page.

Finally, search for and open ‘Gnome Extensions App’ from start menu. And click on the gear button to configure the status indicator.

2. How to Run Game in GameMode:

Some games and platforms have integrated GameMode support. Which means you don’t have to do anything to activate it. They are:

  • DiRT 4
  • Rise of the Tomb Raider
  • Shadow of the Tomb Raider
  • Total War Saga: Thrones of Britannia
  • Total War: Three Kingdoms
  • Total War: WARHAMMER II
  • ATLauncher Minecraft launcher
  • Lutris

For other games, you can now run the executable command by adding gamemoderun at the beginning. For example, run SuperTux2 in GameMode via:

gamemoderun supertux2

For steam, you can simply add gamemoderun %command% as launch option.

And without launching game every time from command line, write the rule into app shortcut file. They are .desktop files generally locate in “/usr/share/applications” directory.

For example, edit SuperTux 2 app shortcut via command:

sudo gedit /usr/share/applications/supertux2.desktop

When the file opens, add gamemoderun before executable command in Exec line.

For Hybrid GPU users, the GameMode supports environment variable via GAMEMODERUNEXEC. So you can run GameMode while using dedicated gpu for rendering game which will be displayed using the integrated card. For example:

export GAMEMODERUNEXEC="env DRI_PRIME=1" && gamemoderun supertux2

To set the environment variable globally, add either line into /etc/environment config file for your case.

GAMEMODERUNEXEC=optirun #Bumblebee implementation.

GAMEMODERUNEXEC="env DRI_PRIME=1"

or

GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 env __GLX_VENDOR_LIBRARY_NAME=nvidia env __VK_LAYER_NV_optimus=NVIDIA_only"

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |