flathub / com.valvesoftware.Steam

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

Steam/any game crashes on launch with __GLX_VENDOR_LIBRARY_NAME=nvidia #1198

Open amsyarzero opened 7 months ago

amsyarzero commented 7 months ago

Hello, I would like to report an issue.

Issue description

Starting from yesterday (26th Nov 2023), after an NVIDIA driver upgrade, Steam crashes every single time I try to launch it. The culprit apparently is the environment variable __GLX_VENDOR_LIBRARY_NAME=nvidia.

System info

Host: HP Pavilion Gaming Laptop 15-dk0xxx
Kernel: 6.6.2-arch1-1
Uptime: 5 hours, 2 mins
Packages: 650 (pacman), 50 (flatpak)
Shell: bash 5.2.21
Resolution: 1920x1080
WM: sway
Theme: Adwaita [GTK3]
Icons: Adwaita [GTK3]
Terminal: alacritty
CPU: Intel i7-9750H (12) @ 4.500GHz
GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630]
GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q
Memory: 2289MiB / 15836MiB

NVIDIA driver version

545.29.06

Logs

File Description
installation_bootstrap_log.txt the bootstrap_log.txt file generated after reinstalling Steam
launch_bootstrap_log.txt the bootstrap_log.txt generated every time I try to launch Steam
flatpak_launch_log.txt the wall of text generated every time I run flatpak run com.valvesoftware.Steam

Modifications to Steam Flatpak

Through Flatseal, I added these variables to run Steam with NVIDIA:

  1. __NV_PRIME_RENDER_OFFLOAD=1
  2. __GLX_VENDOR_LIBRARY_NAME=nvidia
  3. __VK_LAYER_NV_optimus=NVIDIA_only When I removed them from Steam, I added it to a game I'm testing it with (The Binding of Isaac: Rebirth). Note that this issue happens with other games too.

    Workarounds tried

    Workaround Result
    Reinstalling Steam and rebooting Steam/game crashes
    Running Steam in Big Picture mode (flatpak run com.valvesoftware.Steam -bigpicture) as described in #1040 Steam/game crashes
    Running Steam with -gamepadui flag enabled as described in #102 Steam/game crashes
    Reinstalling the latest NVIDIA drivers Steam/game crashes
    Running Steam with steam -vgui parameter Steam/game crashes
    Changing nvidia_drm.modeset=1 to modeset=1 (thanks @Syntist ) Steam/game crashes
    Properly putting modeset=1 and fbdev=1 under /etc/modprobe.d/nvidia.conf Steam/game crashes
    Replacing NVIDIA with nvidia-open Steam/game crashes
    Removing the variables listed above through Flatseal/launch options Steam/game can run with integrated graphics only
    Removing only __GLX_VENDOR_LIBRARY_NAME=nvidia Steam/game can run with integrated graphics only
amsyarzero commented 7 months ago

The native package from Arch's multilib repository launches as intended. However, I'm still keeping this issue open as it seems to be a problem with the Flatpak version of Steam rather than Steam itself.

EDIT: Games crash when trying to run them with NVIDIA PRIME.

amsyarzero commented 7 months ago

An acquaintance found out the issue: I was trying to run the whole client with NVIDIA through the use of PRIME (which I've now detailed in the original post). Removing these variables allows Steam to launch, albeit with integrated graphics.

In addition to that, trying to add said variables to a game's launch options crashes the game, so it's most likely an issue with NVIDIA in general. Here is an excerpt of the error: x86_64-linux-gnu-capsule-capture-libs: warning: Dependencies of libnvidia-pkcs11.so.545.29.06 not found, ignoring: Missing dependencies: Could not find "libcrypto.so.1.1" in LD_LIBRARY_PATH "/app/lib/i386-linux-gnu/GL/default/lib:/app/lib/i386-linux-gnu/GL/nvidia-545-29-06/lib:/app/lib32:/app/lib/i386-linux-gnu:/lib64:/app/lib:/usr/lib/x86_64-linux-gnu/GL/default/lib:/usr/lib/x86_64-linux-gnu/GL/nvidia-545-29-06/lib:/usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/lib:/usr/lib/x86_64-linux-gnu/openh264/extra:/usr/lib/x86_64-linux-gnu:/mnt/hdd/SteamLibrary/steamapps/common/The Binding of Isaac Rebirth", ld.so.cache, DT_RUNPATH or fallback /lib:/usr/lib

amsyarzero commented 7 months ago

Further testing: Games installed in Heroic Games (Flatpak) crash like Steam too. However, weirdly enough, RPCS3 Flatpak runs its games perfectly fine on NVIDIA GPU.

Syntist commented 6 months ago

@amsyarzero Any luck? I am facing the same issue, I t was working fine before, but now i can't run any game on steam, While Lutris works fine.

amsyarzero commented 6 months ago

Any luck? I am facing the same issue, I t was working fine before, but now i can't run any game on steam, While Lutris works fine.

@Syntist Unfortunately, no. I'll try reinstalling the NVIDIA drivers first (along with the Flatpak NVIDIA installations). If that doesn't work, then I'll try reinstalling Arch next.

Syntist commented 6 months ago

@amsyarzero I got it fixed, you using Wayland? You might have to update the nvidia_drm.modeset=1 to modeset=1, now it's working for me. I don't know a silent change by nvidia driver, 545 was causing the issue.

To enable DRM (Direct Rendering Manager) kernel mode setting, set modeset=1 and fbdev=1 kernel module parameters for the nvidia_drm module. The latter is required to tell the nvidia driver to provide its own framebuffer device instead of relying on efifb or vesafb, which don't work under simpledrm. For nvidia driver version < 545, the nvidia_drm.modeset=1 option must be set through kernel parameters, in order to disable simpledrm

amsyarzero commented 6 months ago

@Syntist changing nvidia_drm.modeset=1 to modeset=1 doesn't work for me. Where did you change it? Mine is located in GRUB's config line.

Also, yes, I'm using Wayland.

Syntist commented 6 months ago

I dont know it was working yesterday, today it's stop working again. I reinstall the steam, and change that modeset. Though I notice one thing, before I was getting Shader Compiling and i skip it, game was working, now game is not working but am not getting shader Compiling dialog, it just straight up crashes. Game i am trying is Dota 2

amsyarzero commented 6 months ago

Update: I found a similar issue on Reddit. Apparently, it's due to upgrading to version 545, and the solution is to downgrade to 535. I'll update here if it works.

UPDATE:

It works

Steps

(skip the first two steps if you're already using the DKMS version of NVIDIA drivers)

  1. Remove current NVIDIA drivers
  2. Install nvidia-dkms or nvidia-open-dkms (whichever you prefer)
  3. Downgrade nvidia-dkms (or nvidia-open-dkms), nvidia-utils, and lib32-nvidia-utils + any other NVIDIA packages (such as opencl-nvidia) to the latest 535 version (should be 535.113.01)
  4. Regenerate initramfs by running mkinitcpio -P as root
  5. If you use GRUB, make sure to add nvidia_drm.modeset=1 to the launch options
  6. If you use Flatpak, uninstall any NVIDIA 545 runtimes and install the 535.113.01 versions (including its corresponding 32 bit)
  7. Restart

Disadvantages

Games run abysmally. The performance is even worse than running on iGPU.

Syntist commented 5 months ago

Any update regarding this, I tried 535 and it was slow. Sometimes game run but that's only once in a while