You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is Timestamp Query not supported on Apple M1? #1956
Timestamp query run with the error on Apple M1 with macOS 11.4:
-[AGXM1FamilyBlitContext sampleCountersInBuffer:atSampleIndex:withBarrier:]:325: failed assertion `MTLBlitCommandEncoder:sampleCountersInBuffer:atSampleIndex:withBarrier not supported on this device'
But checking supportsCounterSampling on MTLDevice, we get that: MTLCounterSamplingPointAtBlitBoundary is unsupported, MTLCounterSamplingPointAtDispatchBoundary is unsupported, MTLCounterSamplingPointAtDrawBoundary is unsupported, MTLCounterSamplingPointAtStageBoundary is supported, MTLCounterSamplingPointAtTileDispatchBoundary is unsupported.
Does it mean we just can sample the supported counter at stage boundary (the start and end of a render pass’s vertex and fragment stages, and the start and end of compute and blit passes) on Apple M1?
Counter sampling is allowed at the start and end of a render pass’s vertex and fragment stages, and at the start and end of compute and blit passes.
So technically a WebGPU implementation could choose to split encoders at these points (and push timestamps in render passes at the start or end of the pass). But it could also choose to not bother and not expose the extension on such hardware.
Why ? Splitting encoders other than render encoders is okay-ish. And
implementations can just choose to not support the extension if they think
it's not worth it.
Spliting encoders at these points may works, but how do we define whether the extension is supported? On other GPUs, the counter sampling may be allowed at blit boundary, draw boundary and dispatch boundary, but disallowed at stage boundary. We need to tell users which points it supports.
The timestamp-query has no guarantee that the values returned are exact (sampling timestamps inside render passes doesn't mean much for tiler GPUs anyway) so I think it's ok for implementations to make choices.
Activity
haoxli commentedon Jul 16, 2021
@litherum Would you like to check if the timestamp query is really not supported on M1?
Kangz commentedon Jul 16, 2021
MTLCounterSamplingPointAtStageBoundary means:
So technically a WebGPU implementation could choose to split encoders at these points (and push timestamps in render passes at the start or end of the pass). But it could also choose to not bother and not expose the extension on such hardware.
kvark commentedon Jul 16, 2021
Please no splitting encoders PLEASE
Kangz commentedon Jul 16, 2021
kvark commentedon Jul 16, 2021
Ah we aren't talking about render encoders, phew!
haoxli commentedon Jul 19, 2021
Spliting encoders at these points may works, but how do we define whether the extension is supported? On other GPUs, the counter sampling may be allowed at blit boundary, draw boundary and dispatch boundary, but disallowed at stage boundary. We need to tell users which points it supports.
Kangz commentedon Jul 19, 2021
The
timestamp-queryhas no guarantee that the values returned are exact (sampling timestamps inside render passes doesn't mean much for tiler GPUs anyway) so I think it's ok for implementations to make choices.haoxli commentedon Jul 20, 2021
OK, let's disable timestamp query on Apple M1.
Kangz commentedon Sep 2, 2021
Closing in favor of #2046