ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
635 stars 74 forks source link

[TF2][x64_linux_test] crashing at launch - illegal instruction #5441

Closed AngryPenguinPL closed 7 months ago

AngryPenguinPL commented 7 months ago

While stable 32bit TF2 works fine, new beta x64_linux_test causing game crash at launch with illegal instruction.

 /bin/sh\0-c\0/home/x/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=440 -- /home/x/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/media/x/5afea239-9232-4445-a98e-4e892b1c4e26/steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun --  '/media/x/ssd/Steam/steamapps/common/Team Fortress 2/hl2.sh' -game tf -steam\0
ressure-vessel-wrap[116425]: x86_64-linux-gnu-capsule-capture-libs: warning: libudev.so.0 has an unexpected DT_SONAME, ignoring: libudev.so.1
sty 25 19:24:15 openmandriva-cooker pressure-vessel-adverb[116507]: setlocale "pl_PL.utf8": No such file or directory

openmandriva-cooker plasmashell[116544]: SDL video target is 'x11'
sty 25 19:24:15 openmandriva-cooker plasmashell[116544]: SDL video target is 'x11'
sty 25 19:24:15 openmandriva-cooker kernel: traps: hl2_linux64[116544] trap invalid opcode ip:7f4c16bb814a sp:7fff8fb54c50 error:0 in engine.so[7f4c16b62000+440000]
sty 25 19:24:15 openmandriva-cooker systemd[1]: Started systemd-coredump@3-116551-0.service - Process Core Dump (PID 116551/UID 0).
sty 25 19:24:15 openmandriva-cooker systemd[1]: Started drkonqi-coredump-processor@3-116551-0.service - Pass systemd-coredump journal entries to relevant user for potential DrKonqi handling.
sty 25 19:24:15 openmandriva-cooker systemd-coredump[116552]: [🡕] Process 116544 (hl2_linux64) of user 1001 dumped core.

                                                              Stack trace of thread 116544:
                                                              #0  0x00007f4c16bb814a n/a (engine.so + 0x3b814a)
                                                              #1  0x00007f4c16b75c1c n/a (engine.so + 0x375c1c)
                                                              #2  0x00007f4c29db5e8e call_init (ld-linux-x86-64.so.2 + 0x4e8e)
                                                              #3  0x00007f4c29db5f74 _dl_init (ld-linux-x86-64.so.2 + 0x4f74)
                                                              #4  0x00007f4c29db2516 _dl_catch_exception (ld-linux-x86-64.so.2 + 0x1516)
                                                              #5  0x00007f4c29dbc63e dl_open_worker (ld-linux-x86-64.so.2 + 0xb63e)
                                                              #6  0x00007f4c29db2489 _dl_catch_exception (ld-linux-x86-64.so.2 + 0x1489)
                                                              #7  0x00007f4c29dbc9b8 _dl_open (ld-linux-x86-64.so.2 + 0xb9b8)
                                                              #8  0x00007f4c29b97538 n/a (/run/host/usr/lib64/libc.so.6 + 0x85538)
                                                              #9  0x62bb6c54fce3b900 n/a (n/a + 0x0)
                                                              ELF object binary architecture: AMD x86-64
sty 25 19:24:15 openmandriva-cooker plasmashell[116541]: /media/x/ssd/Steam/steamapps/common/Team Fortress 2/hl2.sh: line 81: 116544 Illegal instruction     (core dumped) ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"

Quick info: OpenMandriva Cooker RX 580 8GB (polaris10) AMD Six core Phenom II Mesa 24.0.0 rc Kernel 6.7.1 clang LLVM 17.0.6 DRM 3.56

Here is system hardware/os details: system info

dreamyukii commented 7 months ago

maybe Phenom II lack some cpu instruction that TF2 needs?,

Joshua-Ashton commented 7 months ago

The min spec should be a Core2, so SSE + SSE2 + SSE3, not sure what you are exactly hitting. SSSE3 shouldn't be required... hmm

Joshua-Ashton commented 7 months ago

Oh, Core 2 did have SSSE3, I will see if I can remove it...

Joshua-Ashton commented 7 months ago

Will hopefully be fixed in the next update to the branch. Thanks for reporting.

Ristovski commented 7 months ago

Given the status quo of having to support quite old CPUs and thus not being able to optimize for a more recent baseline, the best solution might be to switch the compiler flags to -march=core2 -mno-ssse3 -mtune=haswell.

This actually differs from simply specifying nocona, as core2 also sets -maccumulate-outgoing-args=disabled and -mbranch-cost=3 (check gcc -march=core2 -mno-ssse3 -Q --help=target).

Additionally, specifying -mtune=haswell or something equally recent would make gcc emit instructions compatible with core2 CPUs while using a better instruction scheduling model suited for more recent processors (and frankly, the majority of CPUs that TF2 is played on).

AngryPenguinPL commented 7 months ago

Will hopefully be fixed in the next update to the branch. Thanks for reporting.

@Joshua-Ashton Thanks. Last update fixing this, now game works fine.

BTW. a similar error has persisted in CS2 since its release https://github.com/ValveSoftware/csgo-osx-linux/issues/3394 As I understand it, there is no chance to run the game on an older CPU?

kisak-valve commented 7 months ago

Closing per the last comment.

jombo23 commented 7 months ago

Given the status quo of having to support quite old CPUs and thus not being able to optimize for a more recent baseline, the best solution might be to switch the compiler flags to -march=core2 -mno-ssse3 -mtune=haswell.

This actually differs from simply specifying nocona, as core2 also sets -maccumulate-outgoing-args=disabled and -mbranch-cost=3 (check gcc -march=core2 -mno-ssse3 -Q --help=target).

Additionally, specifying -mtune=haswell or something equally recent would make gcc emit instructions compatible with core2 CPUs while using a better instruction scheduling model suited for more recent processors (and frankly, the majority of CPUs that TF2 is played on).

This seems like an extremely reasonable idea. Incredibly easy to do, and almost as easy to benchmark. Figure the core2 arch still had a flipping FSB, so it probably generates abysmal code paths for modern archs for zero reason whatsoever.

Also, @AngryPenguinPL, make sure the smithsonian gets their ancient artifact back