Fix MPS/Metal crash: embed Metal library at build time + add comfy-action CI#8
Draft
Fix MPS/Metal crash: embed Metal library at build time + add comfy-action CI#8
Conversation
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix execution failure on MPS with acestep.cpp
Fix MPS execution failure: embed Metal library at build time + add comfy-action CI
Mar 1, 2026
Copilot
AI
changed the title
Fix MPS execution failure: embed Metal library at build time + add comfy-action CI
Fix MPS/Metal crash: embed Metal library at build time + add comfy-action CI
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS Apple Silicon,
ace-qwen3aborts immediately (exit -6 / SIGABRT) because ggml JIT-compiles embedded Metal shader source at runtime vianewLibraryWithSource:, and certain macOS/Xcode SDK combinations reject that source withMTLLibraryErrorDomaintemplate type-mismatch errors inkernel_col2im_1d/kernel_snake— before any model file is touched.Fix
-DGGML_METAL_EMBED_LIBRARY=ONadded to cmake Metal flags (bothnodes.pyandinstall.py):ggml then compiles the Metal shaders at cmake build time (
xcrun metal) and embeds the resulting binary.metallibdirectly in the executable — no runtime JIT, no runtime shader errors.Additional changes
ace-qwen3fails on macOS and stderr containsMTLLibraryErrorDomain,generate()now appends a targeted message explaining the cause and directing the user to rebuild or switch tobackend=cpu..github/workflows/ci-mps.yml) usingComfy-Org/comfy-action@mainonmacos-latest(GitHub-hosted Apple Silicon runner):comfy-cliinto the workspace root (required forcomfy-action'spython main.py)custom_nodes/and builds binaries with the embed flagace-qwen3at startup against a nonexistent model; exit 134 (SIGABRT) means Metal JIT failed, catches the regression without any model downloadsacestep-cpp-text2music.jsonend-to-end viaComfy-Org/comfy-action— a full workflow failure would have been the first visible symptom of the original bug💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.