Use min of maxMemoryAllocationSize and maxBufferSize for device max allocation size
This commit is contained in:
parent
f652ebfd54
commit
bcf2a4488c
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue