Files
workinf_Blender_Wasm/docs/status/GPU-VULKAN-CRASH-FIX.md
mes123456 5976c3dd7c fix(web): stop the transfer-FBO leak and the canvas-freeze resize churn
- renderer: release_transfer_images() deletes the transfer framebuffer instead
  of only zeroing the name; the leak exhausted VRAM and killed the GPU process
  under Vulkan after ~3-7 minutes
- canvas: status notices are absolute overlays, so they no longer resize the
  native surface (each show/hide freed and recreated region draw buffers and
  eventually froze the main regions)
- compute: bounded shader/layout/pipeline caches, staging pool, device-lost
  error propagation, dev-only ?glStats / ?computeFault / ?compute hooks
- headed tools: soak/probe/smoke assets and docs
- evidence: 20-minute Vulkan soak STABLE (GPU-SOAK-20261205-161007),
  SwiftShader control STABLE (GPU-SOAK-20261205-162105), Clip 28/28
  NOT_CLAIMED (CLIP-HEADED-20261205-162214)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-05 16:29:26 +08:00

3.4 KiB
Raw Blame History

GPU 进程崩溃修复与原生画布冻结(交接记录)

断点

  • 源码改动已全部落盘:引擎 webgl_backend.cc、web/app/src 的 compute/canvas 改动、文档。
  • 剩余工作:完整验证矩阵(Vulkan 20 分钟 soak、SwiftShader 10 分钟对照、Clip 28 例)与提交。

已完成

  1. 崩溃根因(已修复):WebGLFrameBuffer::release_transfer_images() 只把 transfer_id_ 清零,没有 glDeleteFramebuffers,每次 clear/copy/blit/readback 泄漏一个 FBO。 ?glStats=1 显示 53 秒空闲交互净增约 1.1 万个 framebuffer(创建 20806 / 删除 9458); 空闲显存 488 MiB → ~7.7 GiB(约 65 秒)后 GPU 进程被杀 (vkCreateSwapchainKHR failed,exit 133)。
  2. 修复:release_transfer_images() 在清零前调用 glDeleteFramebuffers(1, &transfer_id_)。增量构建 web_engine 并用 node tools/web/sync-web-engine-runtime.mjs 同步,产物 SHA-256 74736b019744a148cc272607344190c95ee189d11cbd5e9f03b0469505021fc8。
  3. 修复后证据:20 分钟 Vulkan 交互 soak 0 次 GPU 进程崩溃 (tests/golden/GPU-SOAK-20261205-144451/report.json,判定 CANVAS_STALL), 空闲显存稳定在 ~700 MiB。
  4. 画布冻结(既有缺口,已修触发机制):约 5 分钟后原生画布的主区域 (视口/大纲/属性)停止绘出并变空白,页面、合成器、DOM HUD 仍存活;冻结后原生算子 仍生效(探针四:点击 Add Monkey 后状态栏变为 Active CUBE · Objects 5,画布哈希变化), 说明引擎与呈现仍在,坏在 wm_draw.cc 的 Browser region draw buffer 恢复路径。 触发机制:操作提示条以流内元素渲染,每次出现/消失都把原生画布在 1440x900/1440x882 之间 resize,反复释放/重建 region draw buffer。 修复:WasmGPUCanvas 的 grabNotice / operationNotice 改为绝对定位覆盖层,不再占布局。 A/B:改前同一探针约 5 分钟冻结;改后 12 分钟 222 轮画布区域零冻结。修复后的正式 20 分钟 Vulkan soak 判 STABLE(tests/golden/GPU-SOAK-20261205-161007/:351 轮、画布全程存活、 0 次 GPU 进程崩溃);SwiftShader 10 分钟对照同样 STABLE (tests/golden/GPU-SOAK-20261205-162105/:172 轮、0 崩溃)。
  5. A2/A3/A4/A5 排查结论:shader/layout/pipeline 缓存(A2)与 staging 池(A3)保留, 统计显示 1751 次运行只建 3 条 pipeline、12962 次复用;device-lost 错误码与开发期故障注入 (?computeFault=destroy-after-N)保留,自动重挂载在注入探针中仍为部分完成; preserveDrawingBuffer=false(A5)不稳定,已完整回退并记为排除项。

残余

  • Clip 套件 28 例已通过(tests/golden/CLIP-HEADED-20261205-162214/,acceptance NOT_CLAIMED, 候选绑定 wasm SHA-256 74736b01…)。
  • A4 的 COMPUTE_DEVICE_LOST 后自动重挂载仍为部分完成,注入故障的 3 分钟 soak 判 CANVAS_STALL (该回执早于提示条覆盖层修复)。
  • 选择失败着色器(overlay_*_selectable)仍不可构建,属既有缺口,不在本批范围。

下一动作

  • 跑 SwiftShader soak 与 Clip 套件并绑定构件哈希。
  • 更新 docs/web/KNOWN_LIMITATIONS.md、docs/web/HEADED-TOOLS.md 的最终措辞。
  • 提交到 web/mesh-decimate,不自动合并。