NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

Steam fails to launch and causes the user environment to become unresponsive. #292690

Open xusiai opened 6 months ago

xusiai commented 6 months ago

Describe the bug

At some point in the past month Steam broke for me. When I attempt to launch it now no window ever appear and it seems to break something else as spawning a new shell environment for the active user becomes impossible after launching Steam. Environments spawned prior to Steam continue to work but new ones are stuck in a permanent initialization stage (terminal show nothing but a blinking underscore; prompt never appears). It remains like this until I kill the entire user session/reboot. Terminating the Steam process is not sufficient to resolve this.

Steps To Reproduce

  1. Set programs.steam.enable to true.
  2. Launch Steam.

Expected behavior

Steam window appears.

Additional context

steam.sh[12011]: Running Steam on nixos 24.05 64-bit
steam.sh[12011]: STEAM_RUNTIME is enabled automatically
setup.sh[12089]: Steam runtime environment up-to-date!
steam.sh[12011]: Steam client's requirements are satisfied
03/02 01:23:39 Init: Installing breakpad exception handler for appid(steam)/version(1709168962)/tid(12143)
steamwebhelper.sh[12162]: === Sat Mar  2 01:23:48 AM CET 2024 ===
steamwebhelper.sh[12162]: Starting steamwebhelper under bootstrap sniper steam runtime at /home/kama/.local/share/Steam/ubuntu12_64/steam-runtime-sniper
CAppInfoCacheReadFromDiskThread took 47 milliseconds to initialize
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 12232
libEGL warning: egl: failed to create dri2 screen
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
src/steamUI/steamuisharedjscontroller.cpp (546) : Failed creating offscreen shared JS context
src/steamUI/steamuisharedjscontroller.cpp (546) : Failed creating offscreen shared JS context
03/02 01:24:14 Init: Installing breakpad exception handler for appid(steam)/version(1709168962)/tid(12143)
assert_20240302012414_31.dmp[12446]: Uploading dump (out-of-process)
/tmp/dumps/assert_20240302012414_31.dmp
src/clientdll/steamengine.cpp (2646) : Assertion Failed: CSteamEngine::BMainLoop appears to have stalled > 15 seconds without event signalled
src/clientdll/steamengine.cpp (2646) : Assertion Failed: CSteamEngine::BMainLoop appears to have stalled > 15 seconds without event signalled
{
  pkgs,
  config,
  ...
}: {
  services.xserver.videoDrivers = ["nvidia"];

  environment.variables = {
    GBM_BACKEND = "nvidia-drm";
    WLR_NO_HARDWARE_CURSORS = "1";
    LIBVA_DRIVER_NAME = "nvidia";
    __GLX_VENDOR_LIBRARY_NAME = "nvidia";
  };

  environment.systemPackages = with pkgs; [
    vulkan-loader
    vulkan-validation-layers
    vulkan-tools
    libglvnd
  ];

  hardware = {
    nvidia = {
      package = config.boot.kernelPackages.nvidiaPackages.beta;
      open = false;
      powerManagement.enable = true;
      modesetting.enable = true;
    };
    opengl = {
      enable = true;
      driSupport = true;
      driSupport32Bit = true;
      extraPackages = with pkgs; [
        nvidia-vaapi-driver
        vaapiVdpau
        libvdpau-va-gl
      ];
    };
  };
}

Notify maintainers

@jagajaga @jonringer

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.6-xanmod1, NixOS, 24.05 (Uakari), 24.05.20240229.1536926`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.19.3`
 - nixpkgs: `/nix/store/lwyjz70qh12nq6cb7fixl85vryzxqm3c-source`

Add a :+1: reaction to issues you find important.

GameDungeon commented 6 months ago

I am trying to setup steam for the first time after installing nixos, and I have the same issue. I can provide any logs if they are needed.

YBeaugnon commented 6 months ago

Same issue for me, on nvidia with dwl. It appears the crash happen when the 'main' client open.

physics-enthusiast commented 6 months ago

Based on the logs, I wonder if this might be related to NVK being enabled in #289051?

GameDungeon commented 6 months ago

Maybe, but I get the error message in a lot of other applications too, and they still work. For example lutris.

jonringer commented 5 months ago

If you set programs.steam.enable = true; do you still have the same behavior?

xusiai commented 5 months ago

If you set programs.steam.enable = true; do you still have the same behavior?

Yes.

woojiq commented 5 months ago

This happens to me when I click on "Library" sometimes. I found a workaround to open Steam and then open the game directly using app runner (wofi in my case).

TheOnlyMrCat commented 3 months ago

I'm getting this issue too. I have Intel Alder Lake integrated graphics, so it might not necessarily be an NVK issue