vulkan: Add workaround for device free memory > total memory on Intel Windows (#29835)
* add workaround for Intel Windows driver issue * applying safeguard to all GPUs also a minor refactor * partial revert
This commit is contained in:
1 parent
d524bb660b
commit
cdce056a3e
1 file changed
+4
-1
@@ -15265,7 +15265,10 @@ void ggml_backend_vk_get_device_memory(int device, size_t * free, size_t * total
|
||||
*total += heap.size;
|
||||
|
||||
if (membudget_supported && i < budgetprops.heapUsage.size()) {
|
||||
*free += budgetprops.heapBudget[i] - budgetprops.heapUsage[i];
|
||||
// Driver may report heapBudget > heap.size so we add a safeguard here
|
||||
// See https://github.com/ggml-org/llama.cpp/issues/29277
|
||||
const vk::DeviceSize budget = std::min(budgetprops.heapBudget[i], heap.size);
|
||||
*free += budget > budgetprops.heapUsage[i] ? budget - budgetprops.heapUsage[i] : 0;
|
||||
} else {
|
||||
*free += heap.size;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user