Metal GPU timeout at about 53 s stops presents #2

Closed
opened 2026-11-26 14:42:18 +00:00 by github-bot · 5 comments
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 06:57 UTC · original

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** on GitHub · 2026-11-26 06:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:42:18 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 10:53 UTC · original

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** on GitHub · 2026-11-26 10:53 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7189979488) 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.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 13:28 UTC · original

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.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 13:28 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7193404384) 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.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 15:56 UTC · original

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.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 15:56 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7196967158) 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.
Author
Owner

@⁠derz92 on GitHub · 2026-11-26 16:23 UTC · original

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.

**@⁠derz92** on GitHub · 2026-11-26 16:23 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7197579619) 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.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 17:13 UTC · original

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).

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 17:13 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/2#issuecomment-7198680498) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.