Add additional explanations to the pinned memory log (#1582)

This commit is contained in:
Kawrakow 2026-04-04 08:53:58 +02:00 committed by GitHub
parent fd71191b2a
commit 0147cf4837
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -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