Open alimysoyang opened 1 week ago
Similar crash happend to me. On iPhone 16 Pro.
I was not interested in metal, but only in coreml, so I disabled metal according to the readme and then it worked properly. Core ml was much faster then without it (20X?).
Also was a bit confusing to understand how to use coreml and how to change the model from base.en to another one, so I opened a PR with updates to the readme here - https://github.com/ggerganov/whisper.cpp/pull/2569
A bit more info on my original crash using metal -
I crashed on this line if (ctx->mtl_device == nil) {
because ctx was NULL. For some reason the assert was not triggering the crash.
static id<MTLDevice> ggml_backend_metal_device_acq(struct ggml_backend_metal_device_context * ctx) {
assert(ctx != NULL);
if (ctx->mtl_device == nil) {
ctx->mtl_device = MTLCreateSystemDefaultDevice();
I was not interested in metal, but only in coreml, so I disabled metal according to the readme and then it worked properly. Core ml was much faster then without it (20X?).
Thanks, removing the -DGGML_USE_METAL parameter indeed fixed this error. Performance appears to be the same as before upgrading to the latest Whisper.cpp release (1.7.2) that introduced this error. I was previously using 1.7.1. Tested on iPhone X and 12.
Crash Log: Assertion failed: (ctx != NULL), function ggml_backend_metal_device_acq, file ggml-metal.m, line 53.
Input Data, ViewController.m(Line 70):