gamemode: PlayOnLinux: wrong ELF class: ELFCLASS64

Describe the bug My goal was to run League of Legends on Linux Mint 19.1 Cinnamon via PlayOnLinux + Wine 3.21-staging. The default install script of play on linux uses winxp + x86 arch as wine base but I also tried amd64 as the error (in my eyes) sais it needs x32 lib. During startup the following error happens

ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

To Reproduce

  1. Linux Mint 19.1 Cinnamon + PlayOnLinux 4.x
  2. Install gamemode from git (1.2 or master) (will be installed into /usr/lib/x86_64-linux-gnu)
  3. Run POL LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgamemodeauto.so.0 playonlinux
  4. The error mentioned above will appear

Expected behavior I would not see any error and game mode would work properly.

System Info (please complete the following information):

  • Linux Mint 19.1
  • GameMode 1.2 or master

Additional context If using gimp instead of playonlinux it works.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Pretty much the same issue here, with Linux Mint 21.1 Cinnamon (based on Ubuntu 22.04). The games won’t start because of the following:

Started initial process 3079658 from gamemoderun /home/mint/.local/share/lutris/runners/wine/lutris-7.2-2-x86_64/bin/wine /home/mint/Games/amazon/the-secret-of-monkey-island-special-edition/drive_c/game/MISE.exe
Start monitoring process.
ERROR: ld.so: object 'libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object 'libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
esync: up and running.
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

ERROR: ld.so: object 'libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Monitored process exited.
Initial process has exited (return code: 13568)
Exit with return code 13568

I’m unsure exactly how PlayOnLinux works, but it may be that it ends up running a mix of 32-bit and 64-bit processes. Setting LD_PRELOAD will attempt to load that library into any process, and it will only succeed for processes that match the bit-ness of the library set in LD_PRELOAD. Any others will error.

Using this (note the slash before $LIB is needed): LD_PRELOAD="/usr/\$LIB/libgamemodeauto.so.0" should make ld.so pick the appropriate 32- or 64-bit library path for each process.

If that doesn’t work, as long as the library path you’re using for preload is the right one for whether the game itself is 32- or 64-bit, things should still work. You can check that GameMode is active while you have the game running with: systemctl --user status gamemoded See the “Status” line, it should tell you whether or not it’s active.