From 6f23ba5ee235cbcb1eedd63b98422dd8d4392a78 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Thu, 30 Mar 2023 01:53:36 -0700 Subject: Ensure --mlock works properly with mmap() support --- llama.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llama.cpp') diff --git a/llama.cpp b/llama.cpp index b00e065..28e885c 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1595,7 +1595,10 @@ struct llama_context * llama_init_from_file( if (params.use_mlock) { char *err; - if (!ggml_mlock(ctx->model.ctx, &err)) { + if (!ggml_mlock(ctx->model.ctx, + ctx->model.mm_addr, + ctx->model.mm_length, + &err)) { fprintf(stderr, "%s\n", err); free(err); llama_free(ctx); -- cgit v1.2.3