Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stefanocoding/ec7d54116559781455d67019439e4ae5 to your computer and use it in GitHub Desktop.
Save stefanocoding/ec7d54116559781455d67019439e4ae5 to your computer and use it in GitHub Desktop.

Solution to copy & paste on the Terminal

flatpak override --user --env=PROTON_NO_ESYNC=1 com.valvesoftware.Steam

Explanation

I tried to play World of Warships on Clear Linux using the flatpak of Steam, but the game never started. So, I ran flatpak run com.valvesoftware.Steam on the Terminal to see if there was any useful information. The error that called my attention was eventfd: Too many open files. I did a google search and found some mention about setting PROTON_NO_ESYNC=1 as an environment variable. So, I ran flatpak override --user --env=PROTON_NO_ESYNC=1 com.valvesoftware.Steam on the Terminal, to set the environment variable PROTON_NO_ESYNC=1 for com.valvesoftware.Steam. I tried again and it worked.

@smcv
Copy link

smcv commented Mar 30, 2021

A better solution to this is to set a reasonably high hard limit on the number of open files per process, rather than disabling eventfd-based synchronization.

Proton uses a modified version of Proton that uses eventfd-based synchronization ("esync") by default. https://github.com/zfigura/wine/blob/esync/README.esync recommends a soft limit of 1024 and a hard limit of around a million (actually 1024×1024).

systemd >= 234 sets those limits by default, so many newer distributions (e.g. Debian 11) will already have them. A limit of 512×1024 has been seen elsewhere and is probably enough.

Previous versions of that document recommended also raising the soft limit, but that turned out to be harmful to other software (in particular Java and anything that calls select()) so that's probably a bad idea. Programs like Wine that know they can benefit from, and cope with, a higher soft limit can raise their soft limit to any value <= their hard limit.

@stefanocoding
Copy link
Author

stefanocoding commented Apr 2, 2021

Thanks, @smcv. I appreciate the comment.
It's been a while since I used Steam, but I don't remember why I didn't choose the solution you mention which I remember it was suggested somewhere. Maybe I read about the suggestion of the soft limit instead of the hard limit, I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment