From: 0cc4m Date: Tue, 18 Mar 2025 06:21:40 +0000 (+0100) Subject: Vulkan: Default to 1GB allocations instead of 4GB to avoid fragmentation and driver... X-Git-Tag: upstream/0.0.5028~119 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=fd123cfead49eb32e386e26b8ef7a6d41554dda5;p=pkg%2Fggml%2Fsources%2Fllama.cpp Vulkan: Default to 1GB allocations instead of 4GB to avoid fragmentation and driver issues (#12434) --- diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index c0ee5dad..dd680aa5 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -2524,13 +2524,9 @@ static vk_device ggml_vk_get_device(size_t idx) { if (GGML_VK_SUBALLOCATION_BLOCK_SIZE != nullptr) { device->suballocation_block_size = std::stoul(GGML_VK_SUBALLOCATION_BLOCK_SIZE); -#if defined(_WIN32) - } else if (device->vendor_id == VK_VENDOR_ID_NVIDIA) { + } else { // Limit batching of allocations to 1GB by default to avoid fragmentation issues device->suballocation_block_size = 1024*1024*1024; -#endif - } else { - device->suballocation_block_size = device->max_memory_allocation_size; } device->suballocation_block_size = std::min(device->suballocation_block_size, device->max_memory_allocation_size);