From bd56886fd64ef5b14c6e81d97c385e88855b5724 Mon Sep 17 00:00:00 2001 From: Oleksii Maryshchenko Date: Fri, 3 Nov 2023 13:46:14 +0100 Subject: [PATCH] set nullptr to memory pool element if it failed during initialization. --- ggml-cuda.cu | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index 4ea2c9450..e65f7e95b 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -5853,6 +5853,8 @@ void ggml_init_cublas() { size_t treshold = UINT64_MAX; CUDA_CHECK(cudaMemPoolSetAttribute(g_cudaMemPools[id], cudaMemPoolAttrReleaseThreshold, &treshold)); fprintf(stderr, ", CUDA memory pool is supported\n"); + } else { + g_cudaMemPools[id] = nullptr; } } else { fprintf(stderr, ", CUDA memory pool is not supported\n");