Skip to content

VK_ERROR_OUT_OF_DEVICE_MEMORY when using device address buffer with indirect draw/dispatch on MoltenVK #2696

@ilyxa-banchichi

Description

@ilyxa-banchichi

On my system (Apple M1 Pro, macOS 26.3, Vulkan SDK 1.4.341.1), I encounter a crash when using a buffer allocated for VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT in combination with indirect draw or dispatch calls.

Steps to reproduce:

  1. Create a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT and retrieve its device address.
  2. Use vkCmdDrawIndirect or vkCmdDispatchIndirect to read data from this buffer in the shader via device address intrinsics.
  3. Submit the command buffer.

Observed behavior:
Immediately after the indirect draw/dispatch, MoltenVK reports:

[mvk-error] VK_ERROR_OUT_OF_DEVICE_MEMORY: Lost VkDevice after MTLCommandBuffer "vkQueuePresentKHR MTLCommandBuffer on Queue 0-0" execution failed (code 9): Invalid Resource (00000009:kIOGPUCommandBufferCallbackErrorInvalidResource)

The crash does not occur if I:

  • Use direct draw/dispatch (no indirect), or
  • Wait for a few frames after buffer creation before issuing indirect calls.

Notes:

  • Reading the buffer via device address in a regular (non-indirect) draw or dispatch works correctly.
  • The issue appears specific to indirect calls combined with device address reads.

Expected behavior:
It should be possible to read from a device address buffer in an indirect draw/dispatch without crashing, similar to how it works in direct draws/dispatches.

Environment:

  • GPU: Apple M1 Pro
  • OS: macOS 26.3
  • Vulkan SDK: 1.4.341.1 (and 1.4.313.1)
  • MoltenVK version: shipped with the Vulkan SDK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions