From f32ea81b21f5a92cebcae44aae86d3248f05df13 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 20 Jan 2024 17:11:38 -0500 Subject: [PATCH] increase minimum overhead to 1024MiB (#2114) --- gpu/gpu.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpu/gpu.go b/gpu/gpu.go index 67bd8352..b4124f35 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -191,11 +191,11 @@ func getCPUMem() (memInfo, error) { func CheckVRAM() (int64, error) { gpuInfo := GetGPUInfo() if gpuInfo.FreeMemory > 0 && (gpuInfo.Library == "cuda" || gpuInfo.Library == "rocm") { - // leave 10% or 512MiB of VRAM free per GPU to handle unaccounted for overhead + // leave 10% or 1024MiB of VRAM free per GPU to handle unaccounted for overhead overhead := gpuInfo.FreeMemory / 10 gpus := uint64(gpuInfo.DeviceCount) - if overhead < gpus*512*1024*1024 { - overhead = gpus * 512 * 1024 * 1024 + if overhead < gpus*1024*1024*1024 { + overhead = gpus * 1024 * 1024 * 1024 } return int64(gpuInfo.FreeMemory - overhead), nil }