What is Gamescope?

linux, wayland, x11, valve

Gamescope created by Valve is a micro-compositor that has been making waves in the gaming industry. Born out of the former SteamCompMgr, Gamescope focuses on optimized game presentation with efficient Wayland usage and various optimizations to reduce frame latency.

How does it work? #

Gamescope gets game frames through Wayland by way of Xwayland, so there’s no copy within X itself before it gets the frame. It can use DRM/KMS to directly flip game frames to the screen, even when stretching or when notifications are up, removing another copy. When it does need to composite with the GPU, it does so with async Vulkan compute, meaning you get to see your frame quick even if the game already has the GPU busy with the next frame.

Benefits of Gamescope #

One of the key benefits of Gamescope is that it runs on top of a regular desktop, a ‘nested’ use case that steamcompmgr didn’t support. Because the game is running in its own personal Xwayland sandbox desktop, it can’t interfere with your desktop and your desktop can’t interfere with it. You can spoof a virtual screen with a desired resolution and refresh rate as the only thing the game sees, and control/resize the output as needed.

Compatibility #

Gamescope runs on Mesa + AMD or Intel, and could be made to run on other Mesa/DRM drivers with minimal work. AMD requires Mesa 20.3+, Intel requires Mesa 21.2+1. For NVIDIA’s proprietary driver, version 515.43.04+ is required (make sure the nvidia-drm.modeset=1 kernel parameter is set).

Launch Options #

Here are some examples of launch options for Valve’s Gamescope micro-compositor:

Please note that these commands should be run in a terminal or command line interface.