ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.19k stars 174 forks source link

Games take forever to launch #10139

Open octopoulpe opened 10 months ago

octopoulpe commented 10 months ago

Your system information

Please describe your issue in as much detail as possible:

When launching a game (any game, proton or linux native), it takes several minutes for the game to start. In the Steam UI, the game is in "Running" state but the game process is not started yet. During this time, my ~/.local/share/Steam/ubuntu12_32/steam process is at 100% of 1 CPU core (no cpu problems at any other times).

On the console I don't get anything suspicious :

Fossilize INFO: Setting autogroup scheduling.
/bin/sh\0-c\0/home/poulpe/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=200710 -- /home/poulpe/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/databig/games/SteamLibrary/steamapps/common/Torchlight II/ModLauncher.bin.x86_64'\0
chdir "/databig/games/SteamLibrary/steamapps/common/Torchlight II"

When I strace the ~/.local/share/Steam/ubuntu12_32/steam process, I can see it tries to open countless file descriptors.

fcntl64(657410824, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410825, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410826, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410827, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410828, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410829, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410830, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410831, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410832, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410833, F_GETFD)             = -1 EBADF (Bad file descriptor)
fcntl64(657410834, F_GETFD)             = -1 EBADF (Bad file descriptor)

It increments up until 1073741815 every time (which is really close to 2^30 but not exactly, not sure if it's useful).

fcntl64(1073741813, F_GETFD)            = -1 EBADF (Bad file descriptor)
fcntl64(1073741814, F_GETFD)            = -1 EBADF (Bad file descriptor)
fcntl64(1073741815, F_GETFD)            = -1 EBADF (Bad file descriptor)
rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
execve("/bin/sh", ["/bin/sh", "-c", "/home/poulpe/.local/share/Steam/"...], 0x58afb900 /* 100 vars */) = 0

Here the real game process starts.

Steps for reproducing this issue:

  1. Launch any game
  2. Wait
  3. Wait
  4. Wait
  5. Wait
  6. The game starts

I tried tweaking almost every option available in steam for months without any success. Never heard of anyone having the same problem.

kisak-valve commented 10 months ago

Hello @octopoulpe, this issue report reminds me of #7970. Can you share the output of ulimit -Sn? (1024 is common and expected, but it's user configurable.)

octopoulpe commented 10 months ago
$ ulimit -Sn
1073741816

You got it @kisak-valve :clap:

Adam-S-Gibson commented 1 month ago

@octopoulpe did you ever find a solution/cause?

kisak-valve commented 1 month ago

Hello @Adam-S-Gibson, if your system is configured similarly to @octopoulpe's with a high soft file limit, the performance adjustment would be to change it to a value closer to the 1024 common default.

mwheeler commented 1 month ago

Just chiming in with a +1, experiencing identical issue (but debian, and AMD GPU (mesa/RADV)), with a soft limit of 1024 fds - starting any game can take 3 to 4 minutes, and I can see similar behaviour from steam trying to open hundreds of thousands of files... before finally launching.