# gamescope ## Preface I'm using endeavourOS, KDE Plasma 6.1, a RTX 3080, nvidia-open-dkms 555.58-2, Wayland. My main monitor is a Samsung Odyssey Neo G7 (3840x2160 165hz "HDR10") and my second is a Acer Predator XB271HU (1440x2560 165hz) --- Ideally, these are my launch options for each game: ```sh gamescope -W 3840 -H 2160 -r 165 --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-sdr-content-nits 300 --force-grab-cursor -o 60 -f -e --mangoapp -- gamemoderun %command% ``` There are some issues with it: - Steam overlay and input won't work (`-e` flag is broken) - `--mangoapp` won't show some info - Performance is incredibly low after a while ## and the workarounds... ### Steam overlay and input [GitHub issue](https://github.com/ValveSoftware/gamescope/issues/835) Creating a gamescope window on the terminal and attaching the game to it will work, but HDR will be broken. First I run this on a terminal: ```sh gamescope -W 3840 -H 2160 -r 165 --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-sdr-content-nits 300 -f --mangoapp ``` I take note of the window's number on `wlserver: [xwayland/server.c:107] Starting Xwayland on :2`, then set the game's launch options: ```sh DISPLAY=:x gamemoderun %command% ``` Where `x` is the display number. The game might take a while to open up and also to completely exit, but it works just fine, except for HDR. There are some tweaks that could get HDR running, but I couldn't get it to work for me. To try it, I would run gamescope with the following variables: ```sh DXVK_HDR=1 gamescope -W 3840 -H 2160 -r 165 --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-sdr-content-nits 300 -f --mangoapp ``` and the launch parameters: ```sh ENABLE_GAMESCOPE_WSI=1 DXVK_HDR=1 DISPLAY=:1 gamemoderun %command% ``` but that's a no go for me. Check [the GitHub issues](https://github.com/ValveSoftware/gamescope/issues/1404#issuecomment-2209386662) for more info ### mangohud and --mangoapp It is recommended to run `--mangoapp` if using gamescope, however it won't display any GPU info. Running it as `mangohud` before `%command%` will show GPU info, but might have some other issues down the line. On both ways, information like HDR, FSR, gamemoderun status won't be displayed at all. ### Performance When you run gamescope, you might notice on the terminal something like `No CAP_SYS_NICE, falling back to regular-priority compute and threads. Performance will be affected.` Performance WILL be affected. After a while, your game will look like a slideshow, but your frame counter will still display the FPS as normal. That means you have to set the niceness of gamescope. Run, as *sudo*: ```sh setcap 'CAP_SYS_NICE=eip' $(which gamescope)` ``` It seems that after a while it loses its niceness, so I made a systemd service that runs on login, checking if the niceness is set, and setting it if it's not. Check the `01.gamescope-niceness.service` ### VRR VRR (adaptive sync, GSYNC) will **not** work on NVIDIA cards if you have more than one monitor enabled on that card. A workaround is to have your extra monitors plugged in another GPU or on your motherboard if your CPU has an iGPU. I don't think NVIDIA has even recognised this issue. While this is not a problem related to gamescope, mangohud or gamemoderun, I've added this section because it might come in handy. Since I don have a second (i)GPU. I need to disable my extra monitors. I've made the `02.start-gamescope.sh` script to be run as a launch parameter on the game, it'll start a gamescope window, turn off my extra display and start the game with gamemoderun and connecting it to the window. When quitting the game, the script turns the extra monitor back on and properly disposes of the gamescope window.