Skip to content

[Question] executeCommandLists Race Condition #113

@jambuttenshaw

Description

@jambuttenshaw

Hello,

I have a simple application with two threads, one will be doing simulation work and another graphics work. Both are submitting work to the graphics queue (I just want the simulation work to be performed at fixed intervals, rather than it being necessarily asynchronous).

However, I seem to be hitting what seems to be some race condition when submitting work. The application crashes with the following message:
D3D12 ERROR: ID3D12CommandQueue1::ExecuteCommandLists: Failed to execute a command list 0x000001F62CFD8C40:'Unnamed ID3D12GraphicsCommandList Object' because the command queue fence has not advanced past previous executions of the command list. [ EXECUTION ERROR #553: COMMAND_LIST_SYNC]
Introducing an EventQuery to stall the simulation thread until recording more commands (and even introducing an WaitUntilIdle) did not prevent the crash, however guarding calls to executeCommandLists with a mutex does prevent the crash.

I wanted to ask if it is known that executeCommandLists is not thread-safe and should be guarded with a mutex, or if this is unexpected behaviour and I have another issue in my application.

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