Quellcode durchsuchen

metal : fix failure to load model (#1817)

The number of buffers in the ggml context was left unitialized.
This leads to sporadic failures to load the model on
startup. It is actually strange that the failure occurred so
infrequantly.

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Kawrakow vor 2 Jahren
Ursprung
Commit
8c0a10e64d
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      ggml-metal.m

+ 1 - 0
ggml-metal.m

@@ -86,6 +86,7 @@ struct ggml_metal_context * ggml_metal_init(void) {
 
     ctx->device = MTLCreateSystemDefaultDevice();
     ctx->queue  = [ctx->device newCommandQueue];
+    ctx->n_buffers = 0;
 
     // determine if we can use MPS
     if (MPSSupportsMTLDevice(ctx->device)) {