[Bug 93840] [i965] Compiler backend uses too much stack with Alien: Isolation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 17 13:52:42 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=93840

--- Comment #40 from Eero Tamminen <eero.t.tamminen at intel.com> ---
To summarize the earlier discussion & analysis...

* the crash

This is due to game setting ridiculously small (<400kB instead of default 8MB)
stack for the compiler thread.  

It's bug in game.  Changing stack size is unnecessary because:
- Linux uses overcommit, i.e. unused mappings don't take real memory
- game uses so few threads, and it's 64-bit one so that even without overcommit
the default (8MB) thread sizes won't be any problem

On Mesa side, for HSW the issue could be worked around by allocating one
compiler array from heap instead of stack (Matt's patch), but that isn't enough
for newer HW.


* slow startup

This is related to above, the stack usage comes from few huge compute shaders,
which register-spill badly, especially on BDW+ where HW requires compiling it
in SIMD32 mode for the requested workgroup size (on HSW they can be compiled
with SIMD16 mode).

If those heavy compute shaders are actually used in the game (with the user
selected GFX quality level)[1], this is Mesa i965 backend problem instead of
game issue:
- i965 register allocation and spill handling needs to be improved to speed up
compilation
- With shader cache, compilation could be skipped after this (game compiles
these shader before getting to main menu, *and* after the game is started from
the menu), but that's not yet enabled for Intel

[1] After disabling the shader warmer, none of these heavy compute shaders seem
to be used early in the game (neither in story, nor survival mode).


Threaded shader compilation could help both of these issues (separate thread
would have full stack), but e.g. ARB_parallel_shader_compile extension isn't
supported by Mesa yet, and would require game to utilize it.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20170317/2fddf7bd/attachment.html>


More information about the intel-3d-bugs mailing list