Преглед изворни кода

increase minimum overhead to 1024MiB (#2114)

Jeffrey Morgan пре 1 година
родитељ
комит
f32ea81b21
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      gpu/gpu.go

+ 3 - 3
gpu/gpu.go

@@ -191,11 +191,11 @@ func getCPUMem() (memInfo, error) {
 func CheckVRAM() (int64, error) {
 func CheckVRAM() (int64, error) {
 	gpuInfo := GetGPUInfo()
 	gpuInfo := GetGPUInfo()
 	if gpuInfo.FreeMemory > 0 && (gpuInfo.Library == "cuda" || gpuInfo.Library == "rocm") {
 	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
 		overhead := gpuInfo.FreeMemory / 10
 		gpus := uint64(gpuInfo.DeviceCount)
 		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
 		return int64(gpuInfo.FreeMemory - overhead), nil
 	}
 	}