Skip to content

Commit e9d29ff

Browse files
ggerganovjordankanter
authored andcommitted
metal : show compile log messages
1 parent d4a6840 commit e9d29ff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ggml-metal.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
277277
NSURL * libURL = [NSURL fileURLWithPath:libPath];
278278
GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]);
279279
ctx->library = [ctx->device newLibraryWithURL:libURL error:&error];
280+
if (error) {
281+
GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
282+
return NULL;
283+
}
280284
} else {
281285
GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);
282286

@@ -315,13 +319,12 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
315319
//[options setFastMathEnabled:false];
316320

317321
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
322+
if (error) {
323+
GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
324+
return NULL;
325+
}
318326
}
319327
}
320-
321-
if (error) {
322-
GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
323-
return NULL;
324-
}
325328
}
326329

327330
// print MTL GPU family:

0 commit comments

Comments
 (0)