mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-10 04:54:34 +00:00
fix compute_buffer estimate: add context GPU usage
This commit is contained in:
parent
c926088d6a
commit
16ba3564ce
2 changed files with 16 additions and 12 deletions
|
@ -986,7 +986,7 @@ static bool assign_layers_to_device(
|
|||
if ((is_macos && !dev.gpu_support.metal) || is_linux) {
|
||||
mem_budget[m] = dev.memory.available_physical;
|
||||
} else if (is_macos && dev.gpu_support.metal) {
|
||||
mem_budget[m] = dev.gpu_props.memory_free;
|
||||
mem_budget[m] = dev.gpu_props.memory_free + 1e-4; // to avoid division by zero
|
||||
} else if (is_android) {
|
||||
mem_budget[m] = dev.memory.available_physical + dev.memory.used_can_swap;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue