[Mesa-dev] [PATCH 00/16] anv: Handle out of memory situations better
Pohjolainen, Topi
topi.pohjolainen at gmail.com
Tue Mar 7 08:31:44 UTC 2017
On Tue, Mar 07, 2017 at 08:15:45AM +0100, Iago Toral Quiroga wrote:
> There are a number of work-in-progress CTS tests that check OOM handling
> and raised a number of issues that this series addresses.
>
> Particularly noteworthy is the case of command buffer recording: since the
> various vkCmd*() functions do not return errors, it is expected
> that drivers survive until vkEndCommanBuffer() and report any errors
> at that point. This requires that we are particularly careful with out of
> memory scenarios, since we need to make sure that vkCmd*() commands do not
> attempt to access memory that we have failed to allocate in a previous step.
> We achieve this by tracking errors generated during command buffer recording
> into the command buffer object and, generally, avoiding to execute new
> vkCmd*() functions if the command buffer recording has generated an error
> before. In general, I tried to only guard execution of vkCmd*() commands that
> the tests showed needed to be guarded since most of the vkCmd*() commands are
> safe to execute in any scenario.
>
> This series fixes all the issues raised with the new tests and a few more that
> I found by inspection but I am sure we could do better in more places.
> It is a first step though and the tests are still in development.
>
> Iago Toral Quiroga (16):
> blorp: handle out of memory in blorp_emitn()
> blorp: handle out of memory without crashing in various batch
> emissions
These two go sort of half way - blorp_exec() still ignores the return
values of blorp_emit_vertex_buffers() and blorp_emit_vertex_elements().
Neither does blorp_emit_depth_stencil_state() returning zero make
blorp_exec() to take any further action.
> anv: don't crash if we fail to grow the reloc list
> anv: handle out of memory situations in anv_batch_emit_dwords()
> anv: do not try to ref/unref NULL shaders
> anv/blorp: return early if we failed to create the shader binary
> anv/cmd_buffer: return a VkResult in cmd_buffer_setup_attachments
> anv/cmd_buffer: track error scenarios during command buffer recording
> anv: handle out of memory scenarios in anv_batch_emit_batch()
> anv/cmd_buffer: handle out of memory during vkCmdPushConstants
> anv: handle out of memory situations during queue submissions
> anv: ensure that we don't ever try to adjust relocations more than
> once
> anv/cmd_buffer: skip vkCmdDraw*() on broken command buffers
> anv/cmd_buffer: skip vkCmdDispatch() on broken command buffers
> anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffers
> anv/cmd_buffer: handle out of device memory during binding table
> emission
>
> src/intel/blorp/blorp_genX_exec.h | 25 ++++++++++-----
> src/intel/vulkan/anv_batch_chain.c | 45 +++++++++++++++++++--------
> src/intel/vulkan/anv_blorp.c | 3 ++
> src/intel/vulkan/anv_cmd_buffer.c | 21 +++++++++++--
> src/intel/vulkan/anv_private.h | 19 ++++++++++++
> src/intel/vulkan/genX_cmd_buffer.c | 63 ++++++++++++++++++++++++++++++++------
> 6 files changed, 142 insertions(+), 34 deletions(-)
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list