mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-07-02 14:15:43 +00:00
metal : return null instead of exit(1) (#2573)
This commit is contained in:
@ -3337,6 +3337,12 @@ struct llama_context * llama_new_context_with_model(
|
||||
// this allocates all Metal resources and memory buffers
|
||||
ctx->ctx_metal = ggml_metal_init(1);
|
||||
|
||||
if (!ctx->ctx_metal) {
|
||||
LLAMA_LOG_ERROR("%s: ggml_metal_init() failed\n", __func__);
|
||||
llama_free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void * data_ptr = NULL;
|
||||
size_t data_size = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user