ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.24k stars 175 forks source link

Steam process hangs at start when run on a Optimus setup where NVidia 495.44 acts as the primary GPU #8212

Open TiZ-HugLife opened 2 years ago

TiZ-HugLife commented 2 years ago

Your system information

Please describe your issue in as much detail as possible:

Whenever my Optimus laptop is configured to run as the primary GPU on which Xorg runs, I am unable to start Steam at all, because the process hangs.

Output from the terminal attempting to run Steam:

❯ com.valvesoftware.Steam
INFO:root:https://github.com/flathub/com.valvesoftware.Steam/wiki
INFO:root:Will set XDG dirs prefix to /home/tiz
INFO:root:Overriding TZ to US/Eastern
DEBUG:root:Addding /usr/lib/extensions/vulkan/MangoHud/bin to PATH
Running Steam on org.freedesktop.platform 21.08.4 64-bit
STEAM_RUNTIME is enabled automatically
Steam runtime environment up-to-date!
Steam client's requirements are satisfied
WARNING: Using default/fallback debugger launch
/home/tiz/.local/share/Steam/ubuntu12_32/steam
[2021-11-07 22:22:21] Startup - updater built Oct 13 2021 19:47:06
Installing breakpad exception handler for appid(steam)/version(1634158817)
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2021-11-07 22:22:21] Loading cached metrics from disk (/home/tiz/.local/share/Steam/package/steam_client_metrics.bin)
[2021-11-07 22:22:21] Using the following download hosts for Public, Realm steamglobal
[2021-11-07 22:22:21] 1. https://cdn.cloudflare.steamstatic.com, /client/, Realm 'steamglobal', weight was 100, source = 'update_hosts_cached.vdf'
[2021-11-07 22:22:21] 2. https://cdn.akamai.steamstatic.com, /client/, Realm 'steamglobal', weight was 100, source = 'update_hosts_cached.vdf'
[2021-11-07 22:22:21] 3. http://media.steampowered.com, /client/, Realm 'steamglobal', weight was 1, source = 'baked in'
Installing breakpad exception handler for appid(steam)/version(1634158817)
[2021-11-07 22:22:21] Checking for update on startup
[2021-11-07 22:22:21] Checking for available updates...
[2021-11-07 22:22:21] Downloading manifest: https://cdn.cloudflare.steamstatic.com/client/steam_client_ubuntu12
Installing breakpad exception handler for appid(steam)/version(1634158817)
[2021-11-07 22:22:21] Download skipped: /client/steam_client_ubuntu12 version 1634158817, installed version 1634158817, existing pending version 0
[2021-11-07 22:22:21] Nothing to do
[2021-11-07 22:22:21] Verifying installation...
[2021-11-07 22:22:21] Performing checksum verification of executable files
[2021-11-07 22:22:22] Verification complete
Loaded SDL version 2.0.17-6744061
Gtk-Message: 22:22:22.825: Failed to load module "appmenu-gtk-module"

Output from a terminal checking on steam processes:

❯ ps aux | grep steam
tiz        29425  0.6  0.0   2464   712 pts/0    S+   22:22   0:00 bwrap --args 46 steam-wrapper
tiz        29433  0.1  0.0   2564  1244 pts/0    S+   22:22   0:00 bwrap --args 46 steam-wrapper
tiz        29434  0.6  0.0   7932  4344 pts/0    S+   22:22   0:00 bash /home/tiz/.local/share/Steam/steam.sh
tiz        29586 10.3  0.0      0     0 pts/0    Zl+  22:22   0:00 [steam] <defunct>
tiz        29597  0.0  0.0   6492  2540 pts/1    S+   22:22   0:00 grep --color=auto steam

Note that the steam process appears defunct.

My setup is comprised of two xorg.conf.d files.

15-dgpu.conf:

Section "Device"
    Identifier "dGPU"
    Driver "nvidia"
    BusID "PCI:01:00:0"
EndSection

25-igpu.conf:

Section "Device"
    Identifier "iGPU"
    Driver "modesetting"
    Option "AsyncFlipSecondaries" "on"
EndSection

I am on xorg-xserver-git because I want to try out the AsyncFlipSecondaries flag and xorg 21.1 is not yet in Arch's repos. But turning it off does not make any difference. In addition, if I revert to the repo versions of the xorg packages, the problem still occurs. I am not using anything like optimus-manager; in order to make the Intel GPU the primary GPU, I just rename 25-igpu.conf to 05-igpu.conf. Previously, I had a single file that merely specified the PrimaryGPU option on the NVidia GPU, but due to an issue in xorg it is not possible to specify options for the modesetting driver without it trying to take over the NVidia GPU.

I am using the current stable branch of the Flatpak version of Steam. My desktop environment is XFCE; Wayland is a distant future for this particular DE.

Steps for reproducing this issue:

  1. Start Steam.
  2. Steam does not appear.
TiZ-HugLife commented 2 years ago

It seems that the main thing affecting this is the NVidia 495 driver series; after I roll back to Nvidia 470.74, I am able to start up Steam with NVidia as the Primary GPU.

kisak-valve commented 2 years ago

Hello @HugLifeTiZ, can you check if you're seeing the flatpak packaged equivalent of #8179? Also, can you confirm that any 32 bit OpenGL application works in Flatpak? Usually, I'd suggest a 32 bit build of glxinfo, but I'm not familiar enough with Flatpak to know if that's easy to use as a test case.

TiZ-HugLife commented 2 years ago

No, I don't believe I'm experiencing #8179. In that bug, the claim is that the PrefersNonDefaultGPU .desktop key is doing something. Render offload variables should effectively do nothing when you're on an NVidia-as-primary configuration anyways. But XFCE doesn't support launching with that key yet; to get any application to launch with the discrete GPU on XFCE, I have to edit the .desktop file and prepend my dgpu script. Maybe GNOME does something wonky on NVidia-as-primary to try and make it run on the integrated GPU?

In any case, with Intel as primary, I can use the render offload variables to launch Steam and it works fine. With NVidia as primary, it hangs.

I don't have any other Flatpak applications that are built to use 32-bit even on a 64-bit setup; Steam is pretty much it. So I did flatpak run --command=bash com.valvesoftware.Steam and trawled through my library for 32-bit games. I stopped on Alwa's Awakening. It works both on NVidia-as-primary and as Intel-as-primary with render offload variables set. I also tried Distance, but it tries to start Steam, which fails when NVidia is primary. But the window does come up. It's a little hard to find games that check all the boxes of Linux native, distributes 32-bit binary, and won't try to start Steam.

TiZ-HugLife commented 2 years ago

This is still a problem in the 510 driver series.

tomwhoiscontrary commented 2 years ago

I believe i also have this problem.

Driver akmod-nvidia-515.76-1.fc36.x86_64 and friends.

I have this in /etc/X11/xorg.conf.d/nvidia.conf:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "SLI" "Auto"
    Option "BaseMosaic" "on"
    # twic: below added according to https://docs.fedoraproject.org/en-US/quick-docs/how-to-set-nvidia-as-primary-gpu-on-optimus-based-laptops/
    Option "PrimaryGPU" "yes"
EndSection

Defunct steam:

$ ps -ef | grep steam
twic        4315    3012  0 12:03 tty2     00:00:00 bash /home/twic/.local/share/Steam/steam.sh
twic        4475    4315  0 12:03 tty2     00:00:00 [steam] <defunct>
twic        8625    4180  0 12:19 pts/0    00:00:00 grep --color=auto steam

I installed Steam from RPMFusion, and have steam-1.0.0.75-1.fc36.i686. I don't know how to find out what version of the actual Steam client is installed, given that i can't boot it. But it did seem to successfully run through a client update just now. I haven't tried the flatpak version.

EDIT: I installed the flatpak, and it works fine out of the box.