Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Treat localized Windows commit exhaustion as a host memory failure

Bowen Xue8d7685158beb
diff --git a/freevideo_engine/adaptive.py b/freevideo_engine/adaptive.py
index ddd3dfb..ea166ea 100644
--- a/freevideo_engine/adaptive.py
+++ b/freevideo_engine/adaptive.py
@@ -36,6 +36,11 @@ def cuda_runtime_error(error):
return False
+def commit_exhausted(error):
+ from .diagnostic_resources import commit_exhausted as found
+ return found(error)
+
+
def classify_failure(error, metrics=None):
"""Only positively identified resource failures are retriable.
@@ -63,7 +68,7 @@ def classify_failure(error, metrics=None):
kind, outcome, retry = 'timeout', 'cancelled', False
elif details.get('kind') == 'gpu_oom' or 'cuda out of memory' in text or 'cuda error: out of memory' in text:
kind, outcome, retry = 'gpu_oom', 'resource_failure', True
- elif isinstance(error, MemoryError) or details.get('kind') == 'ram_pressure':
+ elif isinstance(error, MemoryError) or details.get('kind') == 'ram_pressure' or commit_exhausted(error):
kind, outcome, retry = 'ram_pressure', 'resource_failure', True
elif isinstance(error, WorkerExit) and not (metrics or {}).get('error'):
kind, outcome, retry = 'unknown_worker_exit', 'discarded', False
diff --git a/freevideo_engine/diagnostic_resources.py b/freevideo_engine/diagnostic_resources.py
index d6bad2b..495137c 100644
--- a/freevideo_engine/diagnostic_resources.py
+++ b/freevideo_engine/diagnostic_resources.py
@@ -47,6 +47,21 @@ ENCODER_DTYPES = ('uint8', 'int8', 'int16', 'int32', 'int64', 'float16', 'bfloat
TENSOR_VARIABLES = ('input', 'output', 'x', 'q', 'scale', 'indices', 'qdata', 'weight', 'mat1', 'mat2')
+def commit_exhausted(error):
+ """Windows error 1455 anywhere in the chain: the system commit limit is spent.
+
+ Rust-backed file readers raise a plain OSError carrying only the localized
+ system message plus "(os error 1455)", so the numeric attributes are unset.
+ """
+ seen = set()
+ while isinstance(error, BaseException) and id(error) not in seen:
+ seen.add(id(error))
+ if getattr(error, 'winerror', None) == 1455 or re.search(r'(?:os error|winerror)\s*1455\b', str(error), re.I):
+ return True
+ error = error.__cause__ or error.__context__
+ return False
+
+
def error_details(error):
"""Extract fixed classifications and numbers, never the exception message.
@@ -59,7 +74,7 @@ def error_details(error):
result.update(category='cuda_out_of_memory', error_code=2)
elif 'CUDA out of memory' in message:
result['category'] = 'torch_allocator_out_of_memory'
- elif isinstance(error, MemoryError) or getattr(error, 'winerror', None) == 1455:
+ elif isinstance(error, MemoryError) or commit_exhausted(error):
result['category'] = 'host_memory_allocation'
elif 'CUDA error:' in message:
result['category'] = 'cuda_error'
diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.py
index 13bc523..bc5d26b 100644
--- a/freevideo_engine/failure_details.py
+++ b/freevideo_engine/failure_details.py
@@ -581,7 +581,7 @@ def launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_rep
('Click Repair to reinstall a complete copy of PyTorch. Models and videos are kept.',
'请点“修复”,FreeVideo 会重新安装运行组件,模型和视频都会保留。')),
(r'ModuleNotFoundError|No module named|DLL load failed', 'dependencies', *DEPENDENCIES),
- (r'CUDA (?:error: )?out of memory|torch\.OutOfMemoryError|Insufficient currently available memory|crossed its RAM budget|paging file is too small|WinError 1455', 'memory',
+ (r'CUDA (?:error: )?out of memory|torch\.OutOfMemoryError|Insufficient currently available memory|crossed its RAM budget|paging file is too small|WinError 1455|os error 1455', 'memory',
('Memory is unavailable for this step', '这一步可用内存不足'),
('Close other memory-heavy applications and retry. Copy the details if it continues.', '关闭占用内存较多的程序后重试;仍失败时可复制详情反馈。')),
)
diff --git a/freevideo_engine/resident_worker.py b/freevideo_engine/resident_worker.py
index ebba34f..1419267 100644
--- a/freevideo_engine/resident_worker.py
+++ b/freevideo_engine/resident_worker.py
@@ -79,7 +79,7 @@ def main():
if diagnostics is not None:
diagnostics.finish(False)
traceback.print_exc()
- from .adaptive import classify_failure, cuda_runtime_error
+ from .adaptive import classify_failure, commit_exhausted, cuda_runtime_error
failure = classify_failure(error)
if request.get('metrics'):
from .monitoring import save
@@ -112,6 +112,13 @@ def main():
if failure['kind'] == 'cuda_error' or cuda_runtime_error(error):
log.flush()
os._exit(74)
+ # An exhausted Windows commit limit includes what this process
+ # still holds, notably resident models charged by WDDM. Cleanup
+ # cannot be trusted to return it, and every later request would
+ # fail the same way. A fresh worker starts from zero.
+ if commit_exhausted(error):
+ log.flush()
+ os._exit(75)
failed_error = error
# ModelBank cannot own tensors held by an exception's traceback.
diff --git a/web/error_panel.js b/web/error_panel.js
index 2c23dad..a3a4c77 100644
--- a/web/error_panel.js
+++ b/web/error_panel.js
@@ -318,7 +318,7 @@ export function failureAdvice(value, t, known = knownError(value)) {
['Generation did not start because there is not enough available RAM or GPU memory.', '可用内存或显存不足,本次生成未开始。'],
['Close memory-heavy applications, or lower the resolution or duration, then retry.', '可关闭占用内存较多的程序,或调低分辨率、缩短时长后重试。']);
}
- if (/commit headroom exhausted|paging file is too small|WinError 1455/i.test(text))
+ if (/commit headroom exhausted|paging file is too small|WinError 1455|os error 1455/i.test(text))
return row('commit', ['Not enough Windows memory', 'Windows 内存不足'],
['Windows cannot provide enough memory for generation right now.', 'Windows 暂时无法提供生成所需的内存。'],
['Close memory-heavy applications and retry. In Windows virtual memory settings, use a system-managed paging file on a drive with free space.', '关闭占用内存较多的程序后重试。在 Windows 虚拟内存设置中,使用系统管理的分页文件,并确保所在磁盘有空闲空间。']);