From 0147cf4837a2561f5e75b330e05cc4743abaa572 Mon Sep 17 00:00:00 2001 From: Kawrakow Date: Sat, 4 Apr 2026 08:53:58 +0200 Subject: [PATCH] Add additional explanations to the pinned memory log (#1582) --- ggml/src/ggml-cuda.cu | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-cuda.cu b/ggml/src/ggml-cuda.cu index 5347ef30..3cba2628 100644 --- a/ggml/src/ggml-cuda.cu +++ b/ggml/src/ggml-cuda.cu @@ -1267,12 +1267,15 @@ static void * ggml_cuda_host_malloc(size_t size) { double size_GiB = size/(1024.*1024.*1024.); auto tim1 = ggml_time_us(); if (size_GiB > k_warn_limit) { - GGML_CUDA_LOG_INFO("Allocating %.2f GiB of pinned host memory, this can take a while...\n", size_GiB); + GGML_CUDA_LOG_INFO("\n\nAllocating %.2f GiB of pinned host memory, this may take a while.\n", size_GiB); + GGML_CUDA_LOG_INFO("Using pinned host memory improves PP performance by a significant margin.\n"); + GGML_CUDA_LOG_INFO("But if it takes too long for your model and amount of patience, kill the process and run using\n\n"); + GGML_CUDA_LOG_INFO("GGML_CUDA_NO_PINNED=1 your_command_goes_here\n"); } cudaError_t err = cudaMallocHost((void **) &ptr, size); if (size_GiB > k_warn_limit) { auto tim2 = ggml_time_us(); - GGML_CUDA_LOG_INFO(" done allocating %.2f GiB in %.1f ms\n", size_GiB, 1e-3*(tim2-tim1)); + GGML_CUDA_LOG_INFO(" done allocating %.2f GiB in %.1f ms\n\n", size_GiB, 1e-3*(tim2-tim1)); } if (err != cudaSuccess) { // clear the error