Skip to content

GameScope

Eamonn Rea edited this page Nov 8, 2022 · 28 revisions

NOTE: There are reported issues with enabling GameScope alongside any third-party tools that need to open in their own window such as ModOrganizer 2. See this issue for details. If you have anything to add to the issue feel free to also post there. The issue was closed as we believe it to be an upstream issue.


(Project Page: GameScope)

GameScope is a tool from Valve that allows for games to run in an isolated Xwayland instance and supports AMD, Intel, and Nvidia GPUs. Relatively up-to-date GPU drivers are required for GameScope to work correctly:

  • AMD: Mesa 20.3 or above
  • Intel: Mesa 21.2 or above
  • Nvidia: NVIDIA 515.43.04 or above, and the nvidia-drm.modeset=1 kernel parameter

SteamTinkerLaunch exposes various GameScope features, including those that may not yet be available in a distribution's stable repositories. If you are experiencing issues with GameScope and SteamTinkerLaunch, double-check that the feature you are trying to use is available in the version of GameScope you have installed. A good way to check this is to run gamescope --help in a Terminal. If this feature is available, there may be a bug in SteamTinkerLaunch, and you should check the issue tracker to see if it's been reported or open a new issue.

(in Game Menu and Game Config) Set USEGAMESCOPE to 1 to automatically start GameScope when the game starts, either per game or globally. The command-line arguments used (GAMESCOPE_ARGS) can be configured both per game and globally as well. Some GameScope features exposed in SteamTinkerLaunch are very new and may require a version of GameScope built from the latest Git release.

GameScope can be easily configured (and enabled) with the built-in GameScope Gui, which can be found as Extra Button in the Main Menu. Please note that GameScope options are disabled on Steam Deck Game Mode as it unnecessary with Game Mode's bundled GameScope. However, GameScope is available in Steam Deck Desktop Mode.

GameScopeGui

Features

GameScope has various useful features:

  • Spoofing game resolutions to force running at higher/lower/exotic resolutions (such as Ultrawide)
  • Focused and Unfocused Framerate Limits
  • Upscaling using AMD FidelityFX SuperResolution 1.0 (FSR) or NVIDIA Image Scaling v1.0.3 (NIS) for Wine/Proton and native Linux games

There are other, more technical options that can be passed to GameScope manually. In the Game Menu, the GameScope arguments can be manually adjusted. Refer to the GameScope help screen by running gamescope --help from a Terminal for specifics on these options.

Spoofing Resolution

Using the Game Internal Resolution box, the resolution that the game will run at can be increased. This can be any reasonable resolution including (and especially usefully) one higher than your monitor's resolution.

On Wayland with a scaled display, GameScope can be used to force games to see your monitor's native resolution, f.e., on a 4k display with 150% scaling, games will report a maximum resolution of 2560x1440. GameScope can be used to force games to run at 3840x2160.

The actual game window size can be set with the Game Show Resolution box. The default game window size and game internal resolution size is 1280x720. The effect has virtually no effect when running fullscreen.

Focused and Unfocused Framerate Limits

GameScope allows for framerate limiting when a game window is focused and unfocused. This can be any reasonable value, with the default being unlimited.

This option may conflict with and cause stuttering on games where Vsync is enabled, or games that have their own framerate limit option. Disabling these and letting GameScope manage the framerate may help eliminate stutter, or vice versa, depending on the game.

On Wayland with Vsync enabled desktop-wide (such as on KDE Plasma Wayland), you can safely disable vsync without causing tearing.

Upscaling

In the context of GameScope, upscaling is running a game with a window size larger than the internal resolution. This could be running a game fullscreen on a 1080p display with an internal resolution set to the default of 720p, which can have a significantly lower performance overhead at the cost of visual fidelity. GameScope gives you the ability to use various filters to mitigate the loss of visual quality, making a game look better when running at a lower internal resolution on a higher resolution window.

With the exception of NVIDIA Image Scaling (NIS), the active filter used is dependent on the order that they are passed, meaning the last filter passed will get priority and other filters will be inactive. In the case of SteamTinkerLaunch, checking Integer Scaling, Nearest Neighbor and FSR will result in only FSR being used. Toggling FSR off after launch, in this case, will result in Nearest Neighbor taking priority, and that being disabled will result in Integer Scaling being used. The last filter in will be the only one active, so there is really no reason to have more than one of these options selected.

NVIDIA Image Scaling has different and seemingly undocumented behavior than listed above. It can be applied in addition to existing filters such as Integer Scaling or Nearest Neighbor so that they can be used together. Keep in mind that Integer Scaling and Nearest Neighbor will still overwrite each other, so you can only use one of these effects with NIS. However, NIS will overwrite FSR if it is in use. This means if you try to use NIS and FSR together, only the last one passed to GameScope will be used, and disabling it with a keyboard shortcut will not fall back to the other. In SteamTinkerLaunch's case, if you enable NIS and FSR, NIS will always be passed last. Disabling it using the Super+Y shortcut at runtime will not fall back to using FSR and will instead overwrite it. The order of other filters will be preserved however, so in the case of enabling Integer Scaling, Nearest Neighbor, and NIS, and then enabling FSR, disabling FSR will fall back on Nearest Neighbor, and disabling Nearest Neighbor will fall back on Integer Scaling.

The default sharpness value for NIS and FSR is 2. This can be adjusted from the GameScope menu using the "Upscaler Sharpness" setting, accepting values between 0 (maximum sharpening) and 20 (minimum sharpening), though this may be different for NIS (the behavior is still fairly undocumented). It can be increased with Super+I and decreased with Super+O when a game using Gamescope is running. If no upscaler method is checked, the Upscaler Sharpness value will default back to 2.

GameScope offers various methods of improving visual quality when upscaling using filters:

Integer Scaling

This filter may be good for pixel art games running at higher internal resolutions, as it can reduce some blur effects. This can be toggled with the Integer Scaling box in the GameScope UI, but cannot be toggled after launch.

Nearest Neighbor

A basic, low-overhead method of upscaling. It is good for most games that don't benefit from Integer Scaling. It can be toggled after launch with the Super+N shortcut.

AMD FidelityFX SuperResolution 1.0 (FSR)

An open-source upscaling technique developed by AMD for better upscaling quality. While keeping relatively low-performance overhead, depending on hardware, the sharpness value, and base resolution (for GameScope, the internal game resolution), there may be a noticeable performance hit. Running a game with maximum sharpness, an internal resolution of 720p, and upscaling to 1440p can incur some performance costs and latency. FSR can be toggled on and off in-game with Super+U. Note that enabling it will overwrite NIS.

NVIDIA Image Scaling v1.0.3 (NIS)

An open source upscaling technique developed by Nvidia as a cross-vendor, low-overhead alternative to their proprietary DLSS solution, meaning it works on AMD and Intel GPUs as well as Nvidia GPUs. NIS serves a similar purpose to FSR 1.0. It takes the same sharpness values as FSR and may have similar performance impacts when scaling up from much lower resolutions too much higher resolutions. NIS can be toggled on and off in-game with Super+Y. Note that enabling it will overwrite FSR.

Steam Integration

Steam integration is currently used to workaround a GameScope+Proton 7.0 bug (Plagman/gamescope#438, Plagman/gamescope#420) preventing mouse and controller input. According to Plagman/gamescope#388, when asking what the option is meant to be used for:

You don't right now. There is no version of Steam available publicly that interfaces with the stuff for it.

With versions of Proton older than 7.0 or with Native Linux games, the bug should not be present.

Limitations/Bugs

There are some limitations with using GameScope currently. These are not specific to SteamTinkerLaunch but are still worth watching out for.

Nested Session Only

Currently, SteamTinkerLaunch only supports configuring GameScope as a nested session, where GameScope runs on top of your current desktop environment as another window. As a result, there may be a performance overhead when using GameScope with some desktop environments, distros, and/or compositors.

If you want to run GameScope in an embedded session (such as from a TTY) you will have to configure this manually without SteamTinkerLaunch.

No Window Switching

There is currently no way to allow for setting/switching the active window with GameScope nested sessions (see #490). Some GameScope sessions such as the one used by the Steam Deck's Game Mode may allow for this though.

Wayland-native Applications

Currently, GameScope nested sessions do not support Wayland-Native applications on a Wayland desktop session (such as Plasma Wayland or GNOME), and as noted above SteamTinkerLaunch only supports nested GameScope sessions. Wayland-Native applications will not run inside a Wayland session. In cases where a game launcher may be Wayland but the game itself runs on Xwayland, the launcher will not use GameScope but the Xwayland game will.

This also holds true for embedded sessions if you are logged into a desktop session. For example, using an embedded Steam + GameScope session from a TTY while logged into a Plasma Wayland session and then attempting to using a Wayland-native application with GameScope, will put your Wayland application window on the Plasma Wayland session. If an Xwayland window is opened from this application (e.g., a launcher which is Wayland-native and a game which is Xwayland) then the Xwayland window will run through GameScope on the embedded GameScope session.

There is an open GameScope issue for supporting Wayland (Plagman/gamescope#543).

Performance issues/graphical artifacts

There are open issues for GameScope performance problems and artifacting on AMD, Intel and Nvidia GPUs alike. Usually the best course of action is to use the most up-to-date graphics drivers and the most bleeding-edge release of GameScope you can get your hands on (e.g., Nvidia beta drivers and Mesa-git for AMD/Intel).

There are some instances where bugs may not be resolved though, and there are a few troubleshooting steps below. If these do not solve your problem, you may want to search the GameScope issue tracker for an open bug report, or open a new bug report if your issue is not listed.

Don't use GameScope's Meta+F fullscreen shortcut

GameScope has a shortcut for fullscreening applications, but this has been known to cause some performance penalties and artifacting (Plagman/gamescope504). To work around this, you should launch your game in fullscreen with SteamTinkerLaunch's GameScope Fullscreen option (this adds the -f flag to the GameScope command). This issue may be resolved for KDE Plasma users in Plasma 5.26 and above.

If you need to switch between windowed and fullscreen, you should manage this with your window manager. For example, KDE Plasma's KWin allows for setting a keyboard shortcut to fullscreen applications, and has an option for manually toggling whether a window is fullscreen or not from a window menu.

Setting GameScope process priority

(Credits to u/Pipyui on Reddit for documenting this!)

Sometimes GameScope stuttering can be solved by changing its process priority. This is done at a system-level. When launching GameScope from the command line you may see an error mentioning CAP_SYS_NICE not being set. It is possible to solve this by setting this value with the following command:

sudo setcap 'CAP_SYS_NICE=eip' $(which gamescope)

This can help resolve performance problems. If you want to undo this for any reason, you can do so by changing the priority back to its original state with the following command:

sudo setcap 'CAP_SYS_NICE-eip' $(which gamescope)

NVIDIA Driver support

GameScope supports Nvidia's proprietary drivers, but there may still be some hiccups. Refer to the GameScope issue tracker for bugs related to Nvidia.


PROTIP: While troubleshooting issues with certain launch commands being added before GameScope causing crashes, I realized you can add custom launch commands after GameScope like this:

image

Replace obs-vkcapture with whatever launch command you want. It has to go after the -- followed by a single space then the command. No need for %command% at the end, that's for when you add it as a Steam launch command.


Clone this wiki locally