directxdirectx-11directcompute

There can be at most 65535 Thread Groups in each dimension of a Dispatch call


I have a DirectCompute application making computation on images (Like computing average pixel value, applying a filter and much more). For some computation, I simply treat the image as an array of integer and dispatch a computer shader like this:

FImmediateContext.Dispatch(PixelCount, 1, 1);

The result is exactly the expected value, so the comptation is correct. Nevertheless, at runt time, I see in the debug log the following message:

D3D11 ERROR: ID3D11DeviceContext::Dispatch: There can be at most 65535 Thread Groups in each dimension of a Dispatch call.  One of the following is too high: ThreadGroupCountX (3762013), ThreadGroupCountY (1), ThreadGroupCountZ (1) [ EXECUTION ERROR #2097390: DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW]

This error is shown only in the debug log, everything else is correct, including the computation result. This makes me thinking that the GPU somehow manage the very large thread group, probably breaking it to smaller groups sequentially executed.

My question is: should I care about this error or is it OK to keep it and letting the GPU do the work for me?

Thx.


Solution

  • If you only care about it working on your particular piece of hardware and driver, then it's fine. If you care about it working on all Direct3D Feature Level 11.0 cards, then it's not fine as there's no guarantee it will work on any other driver or device.

    See Microsoft Docs for details on the limits for DirectCompute.

    If you care about robust behavior, it's important to test DirectCompute applications across a selection of cards & drivers. The same is true of basically any use of DirectX 12. Much of the correctness behavior is left up to the application code.