Skip to content

Commit 5aa49f0

Browse files
committed
GPU Metal: report command buffers that failed on the device
DrainStream waited for the submitted command buffers but never looked at their status, so a kernel that faulted or hung only showed up as missing output. Print the Metal error of a failed buffer.
1 parent e31ce90 commit 5aa49f0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎GPU/GPUTracking/Base/metal/GPUReconstructionMetal.mm‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ MetalMemRef metalResolve(const GPUReconstructionMetalInternals* internals, const
327327
// committed, so it never completes. Only what was submitted can be waited for.
328328
for (id<MTLCommandBuffer> cb : mInternals->submittedBuffers[stream]) {
329329
[cb waitUntilCompleted];
330+
if (cb.status == MTLCommandBufferStatusError) {
331+
GPUError("Metal command buffer on stream %d failed: %s", stream, [[cb.error description] UTF8String]);
332+
}
330333
[cb release];
331334
}
332335
mInternals->submittedBuffers[stream].clear();

0 commit comments

Comments
 (0)