flathub / com.valvesoftware.Steam

https://flathub.org/apps/details/com.valvesoftware.Steam
336 stars 70 forks source link

Use default GPU #1086

Closed jntesteves closed 12 months ago

jntesteves commented 1 year ago

The new Steam Big Picture Mode is now the default and it fails to start with the option to prefer a non-default GPU (usually a dGPU in a laptop). Now, the current beta branch has the same problem for Steam's main window due to using the same new graphical framework as the new BPM. Remove the option to avoid the issue.

There is no reason for the Steam app to wake-up a non-default GPU, only starting games should to do that. This setting was already bad before this issue.

Related to ValveSoftware/steam-for-linux#9383, ValveSoftware/steam-for-linux#9487, ValveSoftware/steam-for-linux#9190, ValveSoftware/steam-for-linux#8984, ValveSoftware/steam-for-linux#8381, ValveSoftware/steam-for-linux#9633, ValveSoftware/steam-for-linux#9641, ValveSoftware/steam-for-linux#9652

Resolves #1103, #1110

flathubbot commented 1 year ago

Started test build 42421

flathubbot commented 1 year ago

Build 42421 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/25050/com.valvesoftware.Steam.flatpakref
doraskayo commented 1 year ago

I'm not sure I understand the issue. Why does starting Steam with the non-default GPU (dGPU in your case?) result in Steam not working? Is this a known issue in Steam or your GPU drivers? Can you share the relevant bug report?

I have to say that it would be a bit strange to work around an issue by making Steam (and thus all games) run on the iGPU by default, affecting all users of this Flatpak.

While I don't disagree that the Steam .desktop file preferring to be executed on the non-default GPU (instead of Steam setting DRI_PRIME=1 when running games) is a poor design choice, this is the behavior Valve currently intends to have and is not an issue of this Flatpak.

cc: @smcv

jntesteves commented 1 year ago

I'm not sure I understand the issue. Why does starting Steam with the non-default GPU (dGPU in your case?) result in Steam not working? Is this a known issue in Steam or your GPU drivers? Can you share the relevant bug report?

I listed the related issues in a comment above. I've commented specifically about this solution on ValveSoftware/steam-for-linux#9383 upstream.

I have to say that it would be a bit strange to work around an issue by making Steam (and thus all games) run on the iGPU by default, affecting all users of this Flatpak.

DXVK and VKD3D-proton already detect and use the dGPU by default, DRI_PRIME=1 is not needed for them. Vulkan apps usually offer GPU selection, as it's a feature of the API. Only OpenGL games need DRI_PRIME=1, but they already needed that manually added by users on the game's launch options before this change. So, this fix has no behavioral change when launching games in Steam, it only makes the Steam UI not use the dGPU.

Edit: I must confess my claim above of OpenGL games still needing manual intervention from users is something I haven't tested in a while, could not be the case anymore. I'll update after I check.

Edit 2: Just checked launching an OpenGL game (World Of Goo) without this change, and it does use the dGPU without user intervention, so my last claim was incorrect. With this change it uses the iGPU by default, and manually adding a launch option would be required if wanting to launch it with the dGPU.

jntesteves commented 1 year ago

Hi @doraskayo, I updated my last comment above. Maybe it isn't the best solution to merge this right now, as it changes behavior of OpenGL games.

Right now on stable channel the issues only affect Big Picture Mode, which hardly anyone cares about, so I think it isn't an urgent matter. On Steam beta, though, this issue prevents Steam from launching at all. If Valve decides to promote that version to stable before fixing this issue, this PR would come in handy. So I would like to keep this open for now.

nanonyme commented 1 year ago

I don't want to deviate from Steam default behaviour for this app

flathubbot commented 1 year ago

Started test build 47872

flathubbot commented 1 year ago

Build 47872 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/30478/com.valvesoftware.Steam.flatpakref
jntesteves commented 1 year ago

OK, guys, I'm proposing this for merge again. Valve went ahead and promoted the last beta to stable with the cited issues unresolved. Steam is now broken in dual-GPU setups without this change, the app can't create a window.

nanonyme commented 1 year ago

Is this the case also with native Steam and is there a bug filed that clearly states the problem (and current behaviour)?

jntesteves commented 1 year ago

Is this the case also with native Steam

Hi nanonyme, sorry for the delayed reply. I have personally only tested in Flatpak on Fedora Silverblue. On the linked Steam issues there are reports of the problem on Fedora, Ubuntu, Kubuntu and PopOS, some of which I believe are system packages.

and is there a bug filed that clearly states the problem (and current behaviour)?

That is tricky, Steam is proprietary software and new issues are being opened by kids daily, it's hard to consolidate information. Kisak has been aggressively closing issues and centralizing information on ValveSoftware/steam-for-linux#9383 I think.

With the problem now on the stable branch, only yesterday at least three new issues were opened citing the same problem (ValveSoftware/steam-for-linux#9633, ValveSoftware/steam-for-linux#9641, ValveSoftware/steam-for-linux#9652) that Kisak closed as duplicates of 9383.

serhii-nakon commented 1 year ago

Hello I can run Steam only from terminal using iGPU. If i trying to run Steam using discrete graphics by setting DRI_PRIME=1 or just from clicking UI icon I have infinite loop of Steam restarts.

*I mean that better to use default graphics, instead of using terminal to run Steam by default

Eonfge commented 1 year ago

bot, build

flathubbot commented 1 year ago

Queued test build for com.valvesoftware.Steam.

flathubbot commented 1 year ago

Started test build 52524

flathubbot commented 1 year ago

Build 52524 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/35162/com.valvesoftware.Steam.flatpakref
Eonfge commented 1 year ago
[kevin@fedora ~]$ flatpak run com.valvesoftware.Steam 
INFO:root:https://github.com/flathub/com.valvesoftware.Steam/wiki
ERROR:root:~/.steam/root isn't a symlink to an existing directory, cannot determine current prefix
INFO:root:Will set XDG dirs prefix to /home/kevin/.var/app/com.valvesoftware.Steam
INFO:migration:Copying /home/kevin/.var/app/com.valvesoftware.Steam/config to /home/kevin/.var/app/com.valvesoftware.Steam/.config, ignoring set()
INFO:migration:Renaming /home/kevin/.var/app/com.valvesoftware.Steam/config to /home/kevin/.var/app/com.valvesoftware.Steam/config.old
INFO:migration:Symlinking /home/kevin/.var/app/com.valvesoftware.Steam/config to .config
INFO:migration:Copying /home/kevin/.var/app/com.valvesoftware.Steam/.local/share to /home/kevin/.var/app/com.valvesoftware.Steam/.local/share.bak, ignoring {'Steam'}
Traceback (most recent call last):
  File "/app/bin/steam-wrapper", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 480, in main
    should_restart += migrate_data(current_info, xdg_dirs_prefix)
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 332, in migrate_data
    should_restart = migrator.apply()
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 284, in apply
    self.do_migrate()
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 244, in do_migrate
    self._copytree(self.target, self.target_backup)
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 237, in _copytree
    shutil.copytree(src, dst, symlinks=True, ignore=self.file_ignorer, dirs_exist_ok=True)
  File "/usr/lib/python3.10/shutil.py", line 559, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.10/shutil.py", line 453, in _copytree
    ignored_names = ignore(os.fspath(src), [x.name for x in entries])
  File "/app/lib/python3.10/site-packages/steam_wrapper.py", line 206, in __call__
    os.path.join(src, ignored_pat)):
NameError: name 'src' is not defined
flathubbot commented 1 year ago

Started test build 52549

flathubbot commented 1 year ago

Build 52549 failed

jntesteves commented 1 year ago

@Eonfge I think the beta branch had this issue in steam-launcher where it couldn't create the base directories if they weren't pre-populated by a previous version of Steam. Seems to have been fixed in #1116, so I've just rebased to beta. Hopefully will work in the next build.

Edit: The last build failed because it couldn't download a screenshot from Akamai's CDN in 5 seconds, might be a connectivity problem.

nanonyme commented 1 year ago

bot, build

flathubbot commented 1 year ago

Queued test build for com.valvesoftware.Steam.

flathubbot commented 1 year ago

Started test build 52570

flathubbot commented 1 year ago

Build 52570 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/35208/com.valvesoftware.Steam.flatpakref
flathubbot commented 12 months ago

Started test build 55704

nanonyme commented 12 months ago

Given user input I'm moving ahead with integrating this. Will not land in stable app release until closer to September.

flathubbot commented 12 months ago

Build 55704 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/38361/com.valvesoftware.Steam.flatpakref