I could not run Foldit on my system (current gentoo stable x86_64) without tinkering steps.
Starting ./Foldit, I get the above error message:
Foldit Error: Could not load library: libtorch_cpu.so: cannot enable executable stack as shared object requires: Invalid argument.
Inspired by https://github.com/conda-forge/pytorch-cpu-feedstock/issues/350 I tried to remove the execstack flag from cmp-binary-xxx/libtorch_cpu.so using the nowadays somewhat niche and deprecated execstack utility. With that change, Foldit runs on my system and I could complete the first 10 or so campaign levels without any issue.
As I understand it, this issue will affect all systems already running glibc 2.41.
As mentioned in that bug report, building libtorch_cpu.so with -Wl,-z,noexecstack would be a more appropriate solution/workaround for this issue; please consider implementing this change in your build process. (This is not an open source project, is it? Otherwise, please direct me at the sources and I'm happy to look into a PR/patch.)
This affects (at least) the current download I got from https://fold.it/play, as well as the updated build V50-20250918-fcf2728344-linux_x64 it then downloads.
The affected cmp-binary hashes for me were:
For me, running this command seemed to do the trick: LD_PRELOAD=~/Foldit/cmp-binary-7e8019b8a8e3e71d98b580b06df824f1/libtorch_cpu.so ./Foldit
(please note you need to change the path to your Foldit directory)
You may need to find your binary by going to the Foldit directory and typing: find ~/Foldit -name "libtorch_cpu.so"
I've also noticed that (at least on my system) SELinux doesn't really like the executable stack on some of the stuff, so you may also need to run this command if you have SELinux and all other things fail: sudo setenforce 0
I don't know why, but it seems preloading it is the only way I can get it working anymore.
I even had to preload my libstdc++.so.6 shared object to get it working because of some symbol error: Foldit Error: Could not load library: cmp-binary-8bb217fc2ccc488e28dec61feb10096c/game_library.so: undefined symbol: _ZN3c106ivalue14ConstantString6createENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.
i was having the same error but with the other link the game started
LD_PRELOAD=~/Foldit/cmp-binary-8bb217fc2ccc488e28dec61feb10096c/libtorch_cpu.so ./Foldit