<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - BRW allocates too much heap memory"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103274">103274</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>BRW allocates too much heap memory
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86 (IA32)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/DRI/i965
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fvogt@suse.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>With current mesa git it is not possible to play various 32bit games with wine,
as the d3d hlsl to glsl translator generates many non-trivial shaders.
For unity games like "Ori and the blind forest", they just crash after the
whole 4 GiB address space is exhausted and malloc cannot return any more space.
The vast majority of the allocation calls are caused by ralloc_size called from
brw_* and other shader related functions.

As a workaround I built i965_dri.so from
<a href="https://cgit.freedesktop.org/~jljusten/mesa/commit/?h=i965-shader-cache">https://cgit.freedesktop.org/~jljusten/mesa/commit/?h=i965-shader-cache</a> and I
was able to run the game by letting it compile the shaders until it runs out of
memory, repeated until the shader cache is sufficiently filled so that
subsequent starts do not run out of memory anymore. Now the game uses barely
more than 1GiB after startup. The ~/.cache/mesa directory contains 26MiB, which
indicates (AFAICT) that some stage in the shader compilation process does not
free its resources correctly.

So it's likely a memory leak somewhere, but I don't know how to debug that to
provide more information.</pre>
        </div>
      </p>


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

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