Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.

Valve developer shows off Gamescope for Linux at XDC 2020

By - | Views: 29,290

As we highlighted in our initial XDC 2020 article, one of the presentations this year was from a Valve developer who is working on Gamescope.

Gamescope, something we revealed before across two articles (#1, #2), was started by Valve dev Pierre-Loup Griffais, who is one of the most prominent Linux people at Valve after joining them in 2012. Griffais has also been heavily involved in Valve's various external open source contracting, with things like ACO for Mesa and more.

Created as an evolution of steamcompmgr, the original SteamOS session compositing window manager but it's come a long way since then. Being a rewrite to be based on Wayland (and XWayland for what doesn't work with Wayland directly) rather than GLX, giving them much more direct control over everything with Vulkan. From the talk, Griffais mentioned how they began with using wlroots (a modular Wayland compositor library), from there they hacked away at it and merged it with a bunch of what was in steamcompmgr.

One of the aims here ended up being to have it work on a normal desktop, not just in a single-screen / single-activity like SteamOS did with steamcompmgr. The idea is that with Gamescope the game cannot interfere with your Linux desktop, while you also get more direct control over it for things like input, resolution, refresh rate and more. Griffais showed an example of Portal not working well with an Ultrawide monitor, and then when run with Gamescope at least the rendering was correct due to the sandboxing. Example below, launched as normal and then launched with Gamescope.

Another useful feature of Gamescope is that you can set it up so if a Gamescope window is out of focus, it throttles it down so you can interact properly with your desktop without the game sucking away all your juice. Something that would be seriously useful for lower powered devices / laptops and even on a high-powered PC there's certain games that bring your entire PC to a crawl when you ALT+TAB - so there's lots of uses there.

Plenty of work is still left to do, various polishing features still to be done but Griffais thinks it could be quite useful with a nice UI to go along with it. Lots more was talked about during the short presentation, it's well worth a watch if you're interested in one possible way of how games will be run on Linux in future.

You can see the video below, which begins at around 7:08:17. Our embed video should begin there for you to make it easy.

YouTube Thumbnail
YouTube videos require cookies, you must accept their cookies to view. View cookie preferences.
Accept Cookies & Show   Direct Link

Quite an exciting project that will currently work with AMD drivers, and Intel is probably "not too far off". Eventually, once NVIDIA actually decide how they will be properly supporting Wayland and XWayland it might work there too.

Learn more about Gamescope on GitHub.

Article taken from GamingOnLinux.com.
41 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. Find me on Mastodon.
See more from me
The comments on this article are closed.
19 comments
Page: «2/2
  Go to:

jens Sep 18, 2020
  • Supporter
Quoting: Phlebiac
Quoting: bisbyxI have no idea if there is any "bad blood" between X and Wayland devs

The X devs turned into Wayland devs; no one is really working on X11 any more.

Well, it makes a lot of sense if you just think Wayland = X12.
Cloversheen Sep 18, 2020
Quoting: brokeassben
Quoting: shorbergGave this a try last night with the old Touhou games, which can be peculiar about screen resolution, and it Just Worked™!
I tried compiling Gamescope and kept getting errors. How did you get it working? I wasn't able to find any mention of dependencies or installation instructions on the GitHub page.

Had to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.

The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.

Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install

The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.

I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.
brokeassben Sep 18, 2020
Quoting: shorbergHad to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.

The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.

Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install

The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.

I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.
Thanks for that! I'll give it a go after I'm done with work for the day. Didn't realize the dependencies were listed in there. So much I don't know even after using linux for nearly twenty years.
Cloversheen Sep 20, 2020
Quoting: shorberg
Quoting: brokeassben
Quoting: shorbergGave this a try last night with the old Touhou games, which can be peculiar about screen resolution, and it Just Worked™!
I tried compiling Gamescope and kept getting errors. How did you get it working? I wasn't able to find any mention of dependencies or installation instructions on the GitHub page.

Had to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.

The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.

Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install

The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.

I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.

Just a short update for anyone waiting; I didn't get as much free time this weekend as I was hoping to get so this will take a little longer than expected.
Cloversheen Sep 22, 2020
Ok... *phew* I think I got it.

Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.

On a newly installed and fully updated Fedora 32:

sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)

On a newly installed and fully updated Ubuntu 20.4 (focal)

sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev

Focal does not package an up-to-date version of meson so we need to install that separately from apt

$ sudo apt install python3-pip
$ pip3 install --user -I meson


Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile

$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)


Build instructions (common)

$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install


Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install



Last edited by Cloversheen on 22 September 2020 at 12:07 pm UTC
cprn Sep 22, 2020
So, if I understand it correctly, all this hassle is to get rid of micro freezes and tearing, i.e. to sync between GPU and app layer so that monitor driver could handle sync with the screen, right? I think there was a talk about limits of X from Ryan C. Gordon (Icculus) few years back that mentioned something like that is badly needed. So, yeah, finally. Way to go Pierre.
Cloversheen Sep 23, 2020
Quoting: cprnSo, if I understand it correctly, all this hassle is to get rid of micro freezes and tearing, i.e. to sync between GPU and app layer so that monitor driver could handle sync with the screen, right? I think there was a talk about limits of X from Ryan C. Gordon (Icculus) few years back that mentioned something like that is badly needed. So, yeah, finally. Way to go Pierre.

It is also for dealing with multi-monitor and different resolutions. Some games don't deal well with a multi-monitor setup and make their own (sometimes wrong) decision about which screen you want it to use and refuse to move. And sometimes they just don't want to work with certain resolutions etc. Previously you could use something like xpra for it, but doing it this way means you can essentially optimize it for the very specific case of games.

And as you said, "Way to go Pierre".
brokeassben Sep 23, 2020
Quoting: shorbergOk... *phew* I think I got it.

Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.

On a newly installed and fully updated Fedora 32:

sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)

On a newly installed and fully updated Ubuntu 20.4 (focal)

sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev

Focal does not package an up-to-date version of meson so we need to install that separately from apt

$ sudo apt install python3-pip
$ pip3 install --user -I meson


Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile

$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)


Build instructions (common)

$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install


Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Thanks for taking the time to put this together for internet strangers. Hopefully others see your post and it isn't buried here.

I got it up and running and it makes CS:GO (and a couple Proton titles) much better looking at 1920x1080 on my ultra wide monitor. I'm guessing it'll help people with multiple monitors even more. It's a pretty sweet tool.
Cloversheen Sep 23, 2020
Quoting: brokeassben
Quoting: shorbergOk... *phew* I think I got it.

Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.

On a newly installed and fully updated Fedora 32:

sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)

On a newly installed and fully updated Ubuntu 20.4 (focal)

sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev

Focal does not package an up-to-date version of meson so we need to install that separately from apt

$ sudo apt install python3-pip
$ pip3 install --user -I meson


Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile

$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)


Build instructions (common)

$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install


Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Thanks for taking the time to put this together for internet strangers. Hopefully others see your post and it isn't buried here.

I got it up and running and it makes CS:GO (and a couple Proton titles) much better looking at 1920x1080 on my ultra wide monitor. I'm guessing it'll help people with multiple monitors even more. It's a pretty sweet tool.

Happy it was of use! I'll see about sending a pull request upstream where it will be more useful.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.