mirror of
https://github.com/hacksider/Deep-Live-Cam.git
synced 2026-04-22 15:57:20 +08:00
Fix CUDA VRAM exhaustion during video processing (#1721)
This commit is contained in:
+1
-2
@@ -143,8 +143,7 @@ def suggest_execution_threads() -> int:
|
||||
if 'ROCMExecutionProvider' in modules.globals.execution_providers:
|
||||
return 1
|
||||
if 'CUDAExecutionProvider' in modules.globals.execution_providers:
|
||||
# For CUDA, use more threads for parallel frame processing
|
||||
return min(cpu_count, 16)
|
||||
return 2
|
||||
|
||||
# For CPU execution, use most cores but leave some for system
|
||||
return max(4, min(cpu_count - 2, 16))
|
||||
|
||||
@@ -108,6 +108,14 @@ def get_face_swapper() -> Any:
|
||||
"MaximumCacheSize": 1024 * 1024 * 512, # 512MB cache
|
||||
}
|
||||
))
|
||||
elif p == "CUDAExecutionProvider":
|
||||
providers_config.append((
|
||||
"CUDAExecutionProvider",
|
||||
{
|
||||
"arena_extend_strategy": "kSameAsRequested",
|
||||
"cudnn_conv_algo_search": "DEFAULT",
|
||||
}
|
||||
))
|
||||
else:
|
||||
providers_config.append(p)
|
||||
FACE_SWAPPER = insightface.model_zoo.get_model(
|
||||
|
||||
Reference in New Issue
Block a user