mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-09 19:54:34 +00:00
reserve 200 mib for internal gpu usage
This commit is contained in:
parent
1ca9e7974b
commit
2934cf3e8e
2 changed files with 5 additions and 8 deletions
|
@ -1201,8 +1201,7 @@ static bool assign_layers_to_device(
|
|||
}
|
||||
|
||||
if (dev_gpu[m]) {
|
||||
float reserved_mem = 0.1f; // reserved shared memory to avoid potential OOM, set to 100 MiB by default
|
||||
vec_z_gpu[m] = (double)((dev.gpu_props.memory_free - reserved_mem) * GIGABYTE - c_gpu[m]) / (double)(n_layer * b_prime);
|
||||
vec_z_gpu[m] = (double)(dev.gpu_props.memory_free * GIGABYTE - c_gpu[m]) / (double)(n_layer * b_prime);
|
||||
if (dev.gpu_support.metal && m == 0 && cparams.keep_out_in_metal) {
|
||||
vec_z_gpu[m] -= (double)bo / (double)(n_layer * b_prime);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue