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.
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.