Skip to content

Commit

Permalink
Use min of maxMemoryAllocationSize and maxBufferSize for device max a…
Browse files Browse the repository at this point in the history
…llocation size
  • Loading branch information
0cc4m committed Jan 22, 2024
1 parent f652ebf commit bcf2a44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ggml-vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,11 +975,13 @@ std::cerr << "ggml_vulkan: Validation layers enabled" << std::endl;
vk_device.physical_device = vk_instance.enumeratePhysicalDevices()[dev_num];
vk::PhysicalDeviceProperties2 props2;
vk::PhysicalDeviceMaintenance3Properties props3;
props3.pNext = nullptr;
vk::PhysicalDeviceMaintenance4Properties props4;
props2.pNext = &props3;
props3.pNext = &props4;
props4.pNext = nullptr;
vk_device.physical_device.getProperties2(&props2);
vk_device.properties = props2.properties;
vk_device.max_memory_allocation_size = props3.maxMemoryAllocationSize;
vk_device.max_memory_allocation_size = std::min(props3.maxMemoryAllocationSize, props4.maxBufferSize);

std::cerr << "ggml_vulkan: Using " << vk_device.properties.deviceName << std::endl;

Expand Down

0 comments on commit bcf2a44

Please sign in to comment.