Bug 95374 - ARK:survival of the fittest fails when GL4.3 is enabled.
Summary: ARK:survival of the fittest fails when GL4.3 is enabled.
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-13 01:27 UTC by Bas Nieuwenhuizen
Modified: 2017-02-08 13:31 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
apitrace on radeonsi (695.01 KB, application/octet-stream)
2016-05-13 01:27 UTC, Bas Nieuwenhuizen
Details

Description Bas Nieuwenhuizen 2016-05-13 01:27:01 UTC
Created attachment 123663 [details]
apitrace on radeonsi

When I enable GL4.3 in the radeonsi driver the game fails to load with a dialog containing 0-2 garbage characters.

After closing the dialog the game exits with an abort:

Thread 1 "ShooterGame" received signal SIGABRT, Aborted.
0x00007ffff65062a8 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff65062a8 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff650772a in abort () from /usr/lib/libc.so.6
#2  0x0000000000df9067 in ?? ()
#3  0x0000000000707ace in _start ()

Forcing the version to 4.3 on LLVMPIPE also exhibits the issue.

No obvious memory error detected with valgrind, only some uninitialized values in the steam libraries and xcb.

If anyone else wants to test, this variant of the game is free to play, and this happens before the launcher/menu opens.
Comment 1 Bas Nieuwenhuizen 2016-05-28 11:33:34 UTC
I managed to extract an error message from the function that create the message box:

"The global shader cache file '/mnt/extern/games/steam/steamapps/common/ARK SOTF/Engine/GlobalShaderCache-GLSL_430.bin' is missing.\n\nYou're running a version of the application built to load COOKED content only, however no COOKED content was found. Consider cooking content for this build, or build and run the UNCOOKED version of the application instead."

The string was in UTF-32 format, so I'm guessing the corrupted message might be due not the 16/32 bit difference of wchar_t on windows and linux.

The mentioned file is indeed missing while a 150 version exists.

This looks like an application bug to me. However I would like to check its behavior on amdgpu-pro first before I make this a final determination.
Comment 2 Shawn Starr 2016-05-29 01:43:19 UTC
If you use MESA_GLSL_VERSION_OVERRIDE=150 / 330 it works fine, 430 will cause it to crash.
Comment 3 Shawn Starr 2016-05-31 04:24:48 UTC
Copying the GLSL 150 shader cache to the missing file reveals the game crashes unable to find the shader.

[spstarr@segfault Engine]$ cp GlobalShaderCache-GLSL_150.bin GlobalShaderCache-GLSL_430.bin 
[spstarr@segfault Linux]$ ./ShooterGame 
Using binned.
4.5.1-0+UE4 7038 3077 402 5
Setting breakpad minidump AppID = 346110
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198199507765 [API loaded no]
LowLevelFatalError [File:C:\SVN_Ark\Engine\Source\Runtime\Engine\Private\GlobalShader.cpp] [Line: 204] 
Missing global shader TFilterVS<32>, Please make sure cooking was successful.
Comment 4 Bas Nieuwenhuizen 2016-06-01 14:06:29 UTC
I did some apitracing with radeonsi and amdgpu pro, and the difference in behavior is in what context version we return. The game asks for a 3.2 core context. Amdgpu-pro gives a 3.2 context, while radeonsi gives a 4.3 context. The game then queries the version and continues on the 4.3 render path.

The GLX_ARB_create_context_profile text states that we can return a newer version than requested if no features have been removed.
Comment 5 Ernst Sjöstrand 2016-06-01 14:24:48 UTC
I saw some instances where MESA_GLSL_VERSION_OVERRIDE=430 and actually patching mesa to return 4.3 produced different behaviors. Could that be a factor here?
Comment 6 Eero Tamminen 2016-06-01 14:41:45 UTC
I'm not sure how close "Survival Evolved" is to "Survival of the fittest", but
"ARK: Survival Evolved" game starts fine with i965 driver (which exposes GL 4.3) -> test with Intel might also give different results.

(After playing a while the game segfaults, maybe when something attacks?)
Comment 7 Eero Tamminen 2017-02-08 13:31:44 UTC
Updating status as it's relevant for drirc workaround discussion...

With current version of ARK: Survival Evolved and Mesa, there's exactly the same problem also on Intel as noted in comment 1, and the same solution.

However, while game starts to main menu with GLSL version override, starting a single player game from that will crash to some NULL pointer error after several minutes of game asset loading:
--------------------------
Exception was "SIGSEGV: invalid attempt to access memory at address 0x00000003"
...
Invalid BufferCount=0 while reading ../../../ShooterGame/Content/PrimalEarth/Effects/Materials/environment/M_FX_countdown.uasset. Pos=1886238581, Size=186863, PrecacheSize=2147483647, PrecacheOffset=1886238581 
--------------------------

(Half a year ago single player mode loaded fine, game crashed only later when actually playing.)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.