mirror of
https://github.com/hacksider/Deep-Live-Cam.git
synced 2026-09-01 21:40:52 +02:00
fix: skip setrlimit(RLIMIT_DATA) on macOS (#1849)
setrlimit(RLIMIT_DATA) is rejected by the macOS kernel for the values used here, crashing the app during startup. Since --max-memory defaults to suggest_max_memory() (4 on Darwin), max_memory is always set on macOS and every launch reached this call. Fixes #1848.
This commit is contained in:
@@ -178,6 +178,10 @@ def limit_resources() -> None:
|
||||
tensorflow.config.experimental.set_memory_growth(gpu, True)
|
||||
# limit memory usage
|
||||
if modules.globals.max_memory:
|
||||
# setrlimit(RLIMIT_DATA) fails with EINVAL on macOS, crashing on launch.
|
||||
# See https://github.com/hacksider/Deep-Live-Cam/issues/1848
|
||||
if platform.system().lower() == 'darwin':
|
||||
return
|
||||
memory = modules.globals.max_memory * 1024 ** 3
|
||||
if platform.system().lower() == 'windows':
|
||||
import ctypes
|
||||
|
||||
Reference in New Issue
Block a user