Metal GPU timeout at about 53 s stops presents #2

Closed
opened 2026-11-26 06:57:17 +00:00 by LakshanSivakumar · 5 comments
LakshanSivakumar commented 2026-11-26 06:57:17 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T06:57:17Z.


At about 1,400 frames a Metal command buffer fails with kIOGPUCommandBufferCallbackErrorTimeout; a fence is left behind (signal 2836, GPU at 2832) and presents stop. Not investigated yet. See docs/ROADMAP.md section 2. Attach a run-native.sh log if you hit it.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6621293327 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T06:57:17Z. --- At about 1,400 frames a Metal command buffer fails with kIOGPUCommandBufferCallbackErrorTimeout; a fence is left behind (signal 2836, GPU at 2832) and presents stop. Not investigated yet. See docs/ROADMAP.md section 2. Attach a run-native.sh log if you hit it.
LakshanSivakumar commented 2026-11-26 10:53:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T10:53:39Z.


Triage note: two recent tester reports passed the 53 s / 1,400-frame mark with no Metal GPU timeout:

  • #13 (Apple M5, 24 GB, macOS 26.5.1): 7 runs up to 237 s / 6,848 frames, zero timeouts.
  • #26 (Apple M2 Pro, 32 GB, macOS 27.2.1): 120 s / 3,200 frames, zero timeouts.

Keeping #2 open until we confirm whether the timeout still reproduces on current main (or only on specific scenes/hardware). If anyone hits kIOGPUCommandBufferCallbackErrorTimeout on latest main, please attach the log here.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7189979488 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7189979488). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T10:53:39Z. --- Triage note: two recent tester reports passed the 53 s / 1,400-frame mark with no Metal GPU timeout: - #13 (Apple M5, 24 GB, macOS 26.5.1): 7 runs up to 237 s / 6,848 frames, zero timeouts. - #26 (Apple M2 Pro, 32 GB, macOS 27.2.1): 120 s / 3,200 frames, zero timeouts. Keeping #2 open until we confirm whether the timeout still reproduces on current `main` (or only on specific scenes/hardware). If anyone hits `kIOGPUCommandBufferCallbackErrorTimeout` on latest `main`, please attach the log here.
LakshanSivakumar commented 2026-11-26 13:28:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T13:28:39Z.


Update: #60 has merged to main, keeping all unsatisfied queue Waits on the CPU pump until observed backend completion (avoiding the ~5 s MTLSharedEvent wait timeout) and preserving Present ordering behind held work. Keeping #2 open until confirmed on a live run.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7193404384 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7193404384). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T13:28:39Z. --- Update: #60 has merged to `main`, keeping all unsatisfied queue `Wait`s on the CPU pump until observed backend completion (avoiding the ~5 s `MTLSharedEvent` wait timeout) and preserving `Present` ordering behind held work. Keeping #2 open until confirmed on a live run.
LakshanSivakumar commented 2026-11-26 15:56:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:56:50Z.


Status: #60 is merged (no more unsignalled waits). Still open until a live run past ~1,400 frames confirms no timeout; the later timeouts are tracked in #79. Needed: a run on current main.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7196967158 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7196967158). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T15:56:50Z. --- Status: #60 is merged (no more unsignalled waits). Still open until a live run past ~1,400 frames confirms no timeout; the later timeouts are tracked in #79. Needed: a run on current main.
derz92 commented 2026-11-26 16:23:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-26T16:23:21Z.


Live runs on current main (3fd73fd, which includes #60): no Metal command buffer timeout on this Mac.

Setup: Apple M5 Max, 36 GB, macOS 26.5, windowed, --console series-x, VICTORY_GUESS_GRAPHICS=1, the default run-native.sh Enter presses. Two local changes that don't touch the GPU path: one zeroes the CoreAudio buffers, and one moves the window to another screen. Caveat: another GPU-heavy process (a second game) was running on the same GPU during both runs, so frame rates are lower than they would be alone.

Run Length Frames command buffer failed / kIOGPUCommandBufferCallbackErrorTimeout Ended by
1, fresh data dir (setup screens) 122 s 2,880 0 my 120 s cap, during the story000 load
2, setup already saved 141 s 2,211 0 the story-load crash from #15

Both runs went well past the old stop at about 53 s and 1,400 frames. In run 1 native draws so far ends with recorded=53856 encoded=53856. Run 2 ended the way #15 describes: the watchdog's write to 0 at image+0x23cf683, then the unhandled fault at image+0x55e56f8, about 25 s into the story000 load.

From this Mac, the 53 s timeout no longer reproduces on main. I'll keep watching for it in longer runs and will post here if it comes back.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7197579619 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7197579619). Originally posted by [derz92](https://github.com/derz92) on 2026-11-26T16:23:21Z. --- Live runs on current `main` (3fd73fd, which includes #60): no Metal command buffer timeout on this Mac. Setup: Apple M5 Max, 36 GB, macOS 26.5, windowed, `--console series-x`, `VICTORY_GUESS_GRAPHICS=1`, the default `run-native.sh` Enter presses. Two local changes that don't touch the GPU path: one zeroes the CoreAudio buffers, and one moves the window to another screen. Caveat: another GPU-heavy process (a second game) was running on the same GPU during both runs, so frame rates are lower than they would be alone. | Run | Length | Frames | `command buffer failed` / `kIOGPUCommandBufferCallbackErrorTimeout` | Ended by | |---|---|---|---|---| | 1, fresh data dir (setup screens) | 122 s | 2,880 | 0 | my 120 s cap, during the story000 load | | 2, setup already saved | 141 s | 2,211 | 0 | the story-load crash from #15 | Both runs went well past the old stop at about 53 s and 1,400 frames. In run 1 `native draws so far` ends with `recorded=53856 encoded=53856`. Run 2 ended the way #15 describes: the watchdog's write to 0 at `image+0x23cf683`, then the unhandled fault at `image+0x55e56f8`, about 25 s into the story000 load. From this Mac, the 53 s timeout no longer reproduces on `main`. I'll keep watching for it in longer runs and will post here if it comes back.
LakshanSivakumar commented 2026-11-26 17:13:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T17:13:38Z.


Thanks @derz92. #110 shows the same on two more Macs: on current main nothing stops at ~53 s anymore. The later command-buffer failures are tracked in #79 (memory) and #80 (lost fence signals).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7198680498 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7198680498). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T17:13:38Z. --- Thanks @derz92. #110 shows the same on two more Macs: on current main nothing stops at ~53 s anymore. The later command-buffer failures are tracked in #79 (memory) and #80 (lost fence signals).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#2
No description provided.