<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [i965] Compiler backend uses too much stack with Alien: Isolation"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=93840#c39">Comment # 39</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [i965] Compiler backend uses too much stack with Alien: Isolation"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=93840">bug 93840</a>
              from <span class="vcard"><a class="email" href="mailto:mdiluzio@feralinteractive.com" title="Marc Di Luzio <mdiluzio@feralinteractive.com>"> <span class="fn">Marc Di Luzio</span></a>
</span></b>
        <pre>(In reply to Matt Turner from <a href="show_bug.cgi?id=93840#c38">comment #38</a>)
<span class="quote">> Cc'ing Edwin Smith from Feral.

> Edwin, Alien Isolation crashes with i965 due to the i965 compiler using too
> much stack space. This is certainly something we can fix (and indeed I did
> with the patch in <a href="show_bug.cgi?id=93840#c14">comment #14</a>), but Eero identified that the game seems to
> be self-limiting the amount of stack space (See <a href="show_bug.cgi?id=93840#c21">comment #21</a>).

> Can you shed some light on why Alien Isolation calls
> pthread_attr_setstacksize() to limit its threads' stack sizes?</span >

Marc (from Feral) here, Edwin copied me in. There's a couple of things here I
can shed some light on.

To answer Darius first, for the shader warmer in AI we didn't test heavily on
Mesa as support wasn't really on the roadmap. That'll explain why this didn't
get spotted in production. We've not seen similar issues with shader warmers on
other drivers, but that's explained by...

Matt - AI is self limiting it's stack sizes for it's rendering thread, as it
does on other platforms. We didn't change that because at the time it didn't
show up with any issues in our testing. Obviously that's not the case anymore.
What's interesting is that AI stands out because on Intel it's using the same
GLX_MESA_multithread_makecurrent path that XCOM:EU used, later ditched when we
moved to our own dispatch method. This means the shader compiles will be
happening on that same limited thread, causing you folks problems.

I suspect if you disable GLX_MESA_multithread_makecurrent temporarily you'll
see the problem go away without the need for the patch, although you'll see a
change in performance.

Interestingly we have recently spotted the issue in a different game on Mesa
using a similar un-shipped non-dispatch method, so we've fixed that now
internally and have made space for the Mesa compiler.

Also, from what I can tell, our games after AI are all giving the driver almost
a full system default thread stack on our dispatch thread, so this hopefully
won't be an issue going forward.

Cheers for the fix in the mean time.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>