protonscr

[Suggestion] Better GPU offloading handling

steamclosed
ValveSoftware/steam-for-linux#8658 · opened 2022-06-28 by Matombo · updated 2022-07-28 · 2 comments · github
MMatombo 2022-06-28 github

The status quo:

GPU offloading on Linux Laptops with 2 GPUs currently is quite messy with steam.

When you are running gnome-shell and launch steam from the desktop entry, the steam client itself is launched on the GPU because of this: https://github.com/ValveSoftware/steam-for-linux/issues/7089 (PrefersNonDefaultGPU=true)

This ofc causes all games to also be launched on the GPU, but when no game is running the GPU still stays active as long as Steam is lingering in the background. Preventing the GPU from powering down and saving battery.

And to my knowledge, all other Desktop Environments ignore PrefersNonDefaultGPU=true at the time of this writing. Causing no game to run on the dGPU.

The alternative way is to set primus-run %command% or (if your distro doesn't have that command) __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia DRI_PRIME=1 %command% individually for every single game in the game properties start command line.

My proposed Idea:

Let the steam client set __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia DRI_PRIME=1 automatically before launching a game.

This can be done for the whole cataloge, or based on the minimum required specs of the games.

You should be able to turn this behaviour off, for example with a checkmark in the game properties menu and/or with an additional environment variable like STEAM_NO_GPU_OFFLOADING=1

Kkisak-valve maintainer 2022-06-28 github

Hello @Matombo, this feature request is functionally the same as #3453. Closing as a duplicate.

MMatombo 2022-07-28 github

Not completly, the part with the "based on minimum required specs" is new