{"id":34288,"date":"2021-08-01T16:36:51","date_gmt":"2021-08-01T16:36:51","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=34288"},"modified":"2024-04-26T13:50:59","modified_gmt":"2024-04-26T13:50:59","slug":"enable-game-mode-ubuntu-linux","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/08\/enable-game-mode-ubuntu-linux\/","title":{"rendered":"How to Enable Game Mode for Better Gaming Experience in Ubuntu Linux"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamepad-icon250.png\" alt=\"\" width=\"250\" height=\"250\" class=\"alignleft size-full wp-image-34290\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamepad-icon250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamepad-icon250-150x150.png 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/p>\n<p>Want to get better performance when playing games in Linux? Try GameMode!<\/p>\n<p>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. <\/p>\n<p>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:<\/p>\n<ul>\n<li>CPU governor<\/li>\n<li>I\/O priority<\/li>\n<li>Process niceness<\/li>\n<li>Kernel scheduler<\/li>\n<li>Screensaver inhibiting<\/li>\n<li>GPU performance mode (NVIDIA and AMD), GPU overclocking (NVIDIA)<\/li>\n<li>Custom scripts<\/li>\n<\/ul>\n<h3>1. How to Install GameMode in Ubuntu Linux:<\/h3>\n<p>The package is available in Ubuntu as well as most other Linux repositories.<\/p>\n<p>Firstly open terminal by either searching from &#8216;Activities&#8217; overview screen, or pressing Ctrl+Alt+T on keyboard. When terminal opens, run command to install it:<\/p>\n<pre>sudo apt install gamemode<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/apt-gamemode.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/apt-gamemode.png\" alt=\"\" width=\"600\" height=\"223\" class=\"aligncenter size-full wp-image-34291\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/apt-gamemode.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/apt-gamemode-300x112.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For Fedora and CentOS Linux, you can install it via command:<\/p>\n<pre>sudo dnf install gamemode<\/pre>\n<h4>(Optional) Install GameMode indicator:<\/h4>\n<p>For choice, you can install an indicator applet that shows the current status of GameMode. It&#8217;s an extension for the default Gnome desktop.<\/p>\n<p>a.) Open terminal and run command to make sure <code>chrome-gnome-shell<\/code> browser integration is installed:<\/p>\n<pre>sudo apt install chrome-gnome-shell gnome-shell-extension-prefs<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/apt-chrome-gnome-shell-prefs.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/apt-chrome-gnome-shell-prefs-600x150.png\" alt=\"\" width=\"600\" height=\"150\" class=\"aligncenter size-large wp-image-32875\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/apt-chrome-gnome-shell-prefs.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/10\/apt-chrome-gnome-shell-prefs-450x113.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>b.) Next go to the extension web page by clicking the button below. And turn on the slider icon to install it.<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/extensions.gnome.org\/extension\/1852\/gamemode\/\" target=\"_blank\" rel=\"noreferrer noopener\">GameMode Extension<\/a><\/div>\n<\/div>\n<p>If you don&#8217;t see the toggle icon, click the <i>&#8220;click here to install browser extension&#8221;<\/i> link to install browser extension and reload the page.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions-600x354.jpg\" alt=\"\" width=\"600\" height=\"354\" class=\"aligncenter size-large wp-image-34292\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions-600x354.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions-300x177.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions-768x454.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/game-mode-extensions.jpg 1002w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Finally, search for and open &#8216;Gnome Extensions App&#8217; from start menu. And click on the gear button to configure the status indicator.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings-600x413.jpg\" alt=\"\" width=\"600\" height=\"413\" class=\"aligncenter size-large wp-image-34293\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings-600x413.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings-300x207.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings-768x529.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-extension-settings.jpg 887w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>2. How to Run Game in GameMode:<\/h3>\n<p>Some games and platforms have integrated GameMode support. Which means you don&#8217;t have to do anything to activate it. They are:<\/p>\n<ul>\n<li>DiRT 4<\/li>\n<li>Rise of the Tomb Raider<\/li>\n<li>Shadow of the Tomb Raider<\/li>\n<li>Total War Saga: Thrones of Britannia<\/li>\n<li>Total War: Three Kingdoms<\/li>\n<li>Total War: WARHAMMER II<\/li>\n<li>ATLauncher Minecraft launcher<\/li>\n<li>Lutris<\/li>\n<\/ul>\n<p>For other games, you can now run the executable command by adding <code>gamemoderun<\/code> at the beginning. For example, run SuperTux2 in GameMode via:<\/p>\n<pre>gamemoderun supertux2<\/pre>\n<p><i>For steam, you can simply add <code>gamemoderun %command%<\/code> as launch option.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-600x254.jpg\" alt=\"\" width=\"600\" height=\"254\" class=\"aligncenter size-large wp-image-34294\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-600x254.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-300x127.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-768x325.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux.jpg 928w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>And without launching game every time from command line, write the rule into app shortcut file. They are <code>.desktop<\/code> files generally locate in &#8220;<i>\/usr\/share\/applications<\/i>&#8221; directory. <\/p>\n<p>For example, edit SuperTux 2 app shortcut via command:<\/p>\n<pre>sudo gedit \/usr\/share\/applications\/supertux2.desktop<\/pre>\n<p>When the file opens, add <code>gamemoderun<\/code> before executable command in Exec line.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min-600x352.jpg\" alt=\"\" width=\"600\" height=\"352\" class=\"aligncenter size-large wp-image-34295\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min-600x352.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min-300x176.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min-768x450.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/08\/gamemode-supertux-desktop-min.jpg 932w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For Hybrid GPU users, the GameMode supports environment variable via <code>GAMEMODERUNEXEC<\/code>. So you can run GameMode while using dedicated gpu for rendering game which will be displayed using the integrated card. For example:<\/p>\n<pre>export GAMEMODERUNEXEC=\"env DRI_PRIME=1\" && gamemoderun supertux2<\/pre>\n<p>To set the environment variable globally, add either line into <b>\/etc\/environment<\/b> config file for your case.<\/p>\n<p><code>GAMEMODERUNEXEC=optirun<\/code> #Bumblebee implementation.<\/p>\n<p><code>GAMEMODERUNEXEC=\"env DRI_PRIME=1\"<\/code><\/p>\n<p>or <\/p>\n<pre style=\"background:none;color:red;\">GAMEMODERUNEXEC=\"env __NV_PRIME_RENDER_OFFLOAD=1 env __GLX_VENDOR_LIBRARY_NAME=nvidia env __VK_LAYER_NV_optimus=NVIDIA_only\"<\/pre>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34289,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1189],"class_list":["post-34288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-game"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/34288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=34288"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/34288\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34289"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=34288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=34288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=34288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}