Skip to content

Commit c42ca8f

Browse files
GGML_CUDA_FORCE_CUSTOM_MEMORY_POOL was added to force use only custom memory pool
1 parent bd56886 commit c42ca8f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ggml-cuda.cu

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@
108108
#define CUDA_USE_TENSOR_CORES
109109
#endif
110110

111+
#if !defined(GGML_CUDA_FORCE_CUSTOM_MEMORY_POOL)
112+
#define CUDA_USE_MEMORY_POOL
113+
#endif
114+
111115
// max batch size to use MMQ kernels when tensor cores are available
112116
#define MMQ_MAX_BATCH_SIZE 32
113117

@@ -5845,7 +5849,7 @@ void ggml_init_cublas() {
58455849
cudaDeviceProp prop;
58465850
CUDA_CHECK(cudaGetDeviceProperties(&prop, id));
58475851
fprintf(stderr, " Device %d: %s, compute capability %d.%d", id, prop.name, prop.major, prop.minor);
5848-
5852+
#if defined(CUDA_USE_MEMORY_POOL)
58495853
// configure memory pool
58505854
if (prop.memoryPoolsSupported == 1) {
58515855
cudaError_t err = cudaDeviceGetMemPool(&g_cudaMemPools[id], id);
@@ -5859,7 +5863,7 @@ void ggml_init_cublas() {
58595863
} else {
58605864
fprintf(stderr, ", CUDA memory pool is not supported\n");
58615865
}
5862-
5866+
#endif
58635867
g_tensor_split[id] = total_vram;
58645868
total_vram += prop.totalGlobalMem;
58655869
#if defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)

0 commit comments

Comments
 (0)