WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
289147
[WebGPU] Memory barriers in vertex shader validation routines are problematic on M1
https://bugs.webkit.org/show_bug.cgi?id=289147
Summary
[WebGPU] Memory barriers in vertex shader validation routines are problematic...
Mike Wyrzykowski
Reported
2025-03-04 22:54:51 PST
[WebGPU] Visual difference on some sites between M1 and M2 Macs
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-03-04 22:55:07 PST
<
rdar://problem/146219177
>
Mike Wyrzykowski
Comment 2
2025-03-04 23:01:42 PST
M1s are triggering a context lost due to MTLCommandBuffer failure: error 23:00:40.699875-0800 com.apple.WebKit.GPU -[_MTLCommandBuffer didScheduleWithStartTime:endTime:error:], line 1020: error 'Execution of the command buffer was aborted due to an error during execution. Internal Error (00000100:Internal Error)' error 23:00:40.699908-0800 com.apple.WebKit.GPU Execution of the command buffer was aborted due to an error during execution. Internal Error (00000100:Internal Error) default 23:00:40.719243-0800 com.apple.WebKit.GPU Encountered fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x7067adcb0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"
Mike Wyrzykowski
Comment 3
2025-03-05 14:58:57 PST
If we ignore this error on M1s the page works as expected, need to figure out what error code 256 is ``` Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x42dd31fb0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x43510cb00 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x42ddf50e0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x142c9c810 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x436b94e40 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 "Internal Error (00000100:Internal Error)" UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x142ca24f0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)"}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 "(null)" com.apple.WebKit.GPU.Development(40094) MallocStackLogging: msl_handle_memory_pressure_event: approaching memory limit. Starting stack-logging. ```
Mike Wyrzykowski
Comment 4
2025-03-06 10:57:07 PST
Ok great I root caused it. Too many completion handlers are being added to the MTLCommandBuffer, which appears to be exhausting some driver / kernel resource. WebKit can manage this ourselves quite easily, I will change that
Mike Wyrzykowski
Comment 5
2025-03-06 16:29:18 PST
Further analysis indicates this is not due to the total number of completion handlers, but rather the way we are using memory barriers does not seem to work on M1 Macs. We could split passes on M1s as this is not a codepath which should not be regularly triggered
Mike Wyrzykowski
Comment 6
2025-03-06 16:45:29 PST
Splitting render passes to validate like we do for Intel appears to resolve the issue.
Mike Wyrzykowski
Comment 7
2025-03-06 21:30:04 PST
Splitting the render passes is not needed, there is a simpler solution, I will implement that instead
Mike Wyrzykowski
Comment 8
2025-03-06 21:48:03 PST
Pull request:
https://github.com/WebKit/WebKit/pull/42069
EWS
Comment 9
2025-03-10 08:27:50 PDT
Committed
291897@main
(8f1919db1fce): <
https://commits.webkit.org/291897@main
> Reviewed commits have been landed. Closing PR #42069 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug