]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Vulkan: Default to 1GB allocations instead of 4GB to avoid fragmentation and driver...
author0cc4m <redacted>
Tue, 18 Mar 2025 06:21:40 +0000 (07:21 +0100)
committerGeorgi Gerganov <redacted>
Thu, 27 Mar 2025 09:06:03 +0000 (11:06 +0200)
ggml/src/ggml-vulkan/ggml-vulkan.cpp

index c0ee5dadef78a346fd7af16c5cd6fe109f88b480..dd680aa52243872e8aa4a773823ecf6d9f11a896 100644 (file)
@@ -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);