Skip to content

GameScope

Eamonn Rea edited this page May 13, 2024 · 27 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.

There is a "Default" button available on the GameScope menu which allows you to easily reset all of your GameScope command options to default.

GameScope GUI

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 (or "Filtering" in newer versions of GameScope) using AMD FidelityFX SuperResolution 1.0 (FSR) or NVIDIA Image Scaling v1.0.3 (NIS) for Wine/Proton and native Linux games
  • Support for ReShade effects

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.

Filtering & Scaling

Newer versions of GameScope (ValveSoftware/gamescope@7a1fe2d) have two types of image processing that can be applied: Filtering (such as FidelityFX SuperResolution), which is used to enhance image quality, and Scaling, which is used to dictate how GameScope should handle images when the window the game is running in is scaled up from the game's base resolution (such as Integer scaling).

In older versions of GameScope, these options were passed with individual switches (such as gamescope -n -- glxgears for Nearest Neighbor filtering), but now these options are passed as arguments to the -F or -S flag, for Filtering and Scaling respectively. So the equivalent to the above Nearest Neighbor example now would be gamescope -F nearest -- glxgears. Note that -f is used for Fullscreen, but -F is used for filtering.

To accomodate both the old and new ways of passing arguments, SteamTinkerLaunch offers a dropdown under "Filtering Options" where you can select the filter and scaling mode. SteamTinkerLaunch will check before saving the GameScope options which options are available in your installed version of GameScope, and so will choose whether to pass -n or -F nearest for you. This dropdown has a list of presets but can also accept text input, so if a filter mode is available in your version of GameScope but is not mentioned in the dropdown, you can enter it manually. However this means if you enter an invalid option that does not exist (such as i-love-stl) then it will get passed to GameScope and the command may not work properly!

Here is a list of the Filtering and Scaling options available at the time of writing.

  • Filtering (-F flag)
    • Linear: linear (may be the default, unsure)
    • Nearest Neighbor: nearest
    • AMD FidelityFX SuperResolution 1.0: fsr (can be toggled during gameplay with Super+U`)
    • NVIDIA Image Scaling v1.0.3: nis (can be toggled during gameplay with Super+Y)
  • Scaling (-S flag)
    • Automatic: auto (most likely the default and equivalent to not passing -S at all)
    • Integer Scaling: integer (useful for pixel art games running at higher internal resolutions)
    • Fit and Preserve Aspect Ratio/Resolution: fit
    • Crop/Zoom and Fill: fill
    • Stretch to Fit: stretch

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.

There are newer versions of FSR available that may be available in your game, but GameScope currently only supports the FSR 1.0 implementation.

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.

Notes on Upscaling Filtering

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.

In older versions of GameScope, it was possible to use multiple filters at once (i.e. gamescope -i -n -U -Y -- glxgears), but this is no longer the case. Only one filter can be used at a time now with newer releases of GameScope.

When toggling filters, 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.

Sharpness Quirks

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.

ReShade Effects

Newer releases of GameScope have support for loading ReShade effect files. Not all effects are supported, and support is still in its early stages. You can find out more about the state of ReShade support on the GameScope Readme.

Joshua Ashton, a core contributor to many Linux gaming projects including GameScope, has a repository of various useful GameScope shaders over at Joshua-Ashton/GamescopeShaders. You may want to use these shaders when working with GameScope and ReShade effects.

GameScope is looking for contributors to extend the ReShade functionality, so consider helping out or spreading the word!

HDR (Wayland Only)

On a Wayland session, GameScope allows you to play games via Proton with HDR support. Newer releases of GameScope will also set the DXVK_HDR environment variable to 1.

DXVK_HDR, GameScope HDR, and SteamTinkerLaunch

(See also: #1103)

Note that SteamTinkerLaunch allows you to set DXVK_HDR=1 from the Game Menu, but this will be ignored and force-enabled when using GameScope HDR. This means if you enable the GameScope HDR option from SteamTinkerLaunch, you will always* have DXVK_HDR=1. Without this, GameScope itself would broadcast support for HDR and enable the relevant layers, but DXVK/vkd3d-proton would not, meaning you would be unable to use HDR. So for convenience we always ensure this environment variable is forced on when using GameScope HDR

Limitations/Bugs

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

GameScope Steam Integration

Steam integration is currently used to workaround a GameScope+Proton 7.0 bug (ValveSoftware/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. This issue may be fixed with Proton 8.0

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

Newer releases of GameScope are beginning to implement support for Wayland clients, gated behind a flag. SteamTinkerLaunch exposes this setting using an "Expose Wayland" checkbox. Not all Wayland applications will work with GameScope (Firefox, glxgears have issues) and several tested games do not work correctly (Factorio, Terraria).

In future, if/when Wayland support in GameScope matures and Wayland applications work correctly, this option can be used in conjunction with the SDL Wayland option on the Game Menu, to run applications within GameScope natively on Wayland. Note that on newer versions of GameScope, if you are not using the Expose Wayland option, then GameScope will automatically override the SDL_VIDEODRIVER=wayland option and force it to X11 (see ValveSoftware/gamescope@8ace192 and ValveSoftware/gamescope@d1eb70b).

There is also a 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). GameScope nested sessions always will incur a performance overhead as it is running a compositor within a compositor, but this may not be noticeable on all setups. These performance issues cannot really be resolved unless you run GameScope in an embedded session, equivalent to what the Steam Deck does in Game Mode.

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