Skip to content

GPU Metal: reconstruction on Metal bringup - #16052

Merged
ktf merged 5 commits into
AliceO2Group:devfrom
ktf:pr16052
Nov 5, 2026
Merged

ktf merged 5 commits into
AliceO2Group:devfrom
ktf:pr16052

Conversation

@ktf

@ktf ktf commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

No description provided.

ktf added 5 commits November 5, 2026 15:50
Pass the tuned thread count as maxTotalThreadsPerThreadgroup, the Metal
equivalent of __launch_bounds__. Without it the register allocation can
leave room for fewer threads than the tuning table assumes, and the
launch was clamped: on an M1 Max (applegpu_g13s) the two TRD tracker
kernels got 384 instead of 512, and the TPC compression gather kernel
832 instead of 1024, which breaks its block-wide scans.
The GPUMemClean16 blit committed its command buffer directly, so the
stream kept the committed buffer as its open one, and the next encoder on
that stream aborted with "failed assertion _status <
MTLCommandBufferStatusCommitted". The clear was also never waited for.
The event slots were only placement-constructed as nil ids, so the first
StreamWaitForEvents threw "object cannot be nil" from encodeWaitForEvent.
Create an MTLSharedEvent per slot, as the CUDA backend creates its
events, and release them on exit.
The events signalled and waited for the fixed value 1, and ReleaseEvent
reset them to 0, so a wait issued after a release, or for an event not
recorded yet, never completed: the GPU watchdog killed each such command
buffer after about 10 s, and the queue then dropped all later work. On a
5-event pp time frame this made the TPC reconstruction take 80 s and
return nothing. Count up per event instead: RecordMarker signals the next
value, a wait asks for the last recorded one and is a no-op if there is
none, as cudaStreamWaitEvent is, and ReleaseEvent does nothing, as in
CUDA.
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.
@ktf
ktf requested a review from davidrohr as a code owner November 5, 2026 14:54
@ktf ktf changed the title GPU Metal: report command buffers that failed on the device GPU Metal: various changes while trying to get the reconstruction on metal to run Nov 5, 2026
@ktf ktf changed the title GPU Metal: various changes while trying to get the reconstruction on metal to run GPU Metal: reconstruction on Metal bringup Nov 5, 2026
@ktf

ktf commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Compiles, does not touch anything outside the right now disabled metal folder.

@ktf
ktf merged commit d670d3a into AliceO2Group:dev Nov 5, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant