Repository navigation
GPU: cap default pipeline worker count on <=24 GiB RAM hosts - #2944
alexandruiulian201-bot wants to merge 1 commit into
Conversation
pipeline::make::queue previously spawned (cores / 2).clamp(2, 8) workers regardless of installed RAM. On 16 GiB systems with 8-16 logical threads, 4-8 concurrent shader translations and driver PSO compiles can exhaust Windows commit memory and trigger E_OUTOFMEMORY. Query GlobalMemoryStatusEx (Win32_System_SystemInformation is already enabled in victory-gpu) to cap the automatic default at 2 workers for <=18 GiB RAM and 4 workers for <=26 GiB RAM, leaving 32+ GiB hosts and failed queries unchanged at (cores / 2).clamp(2, 8). Complements Marvisak#2250 (manual VICTORY_PIPELINE_THREADS override).
|
Code review and RTX 5090 + WARP verification at head
LGTM. |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64:
cargo test -p victory-gpu --lib pipeline::make::tests: 4 passed, 0 failed (including newdefault_workers_scales_with_physical_memoryandtotal_physical_memory_reports_nonzero_ram).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Capping default pipeline workers to 2 on <= 18 GiB and 4 on <= 26 GiB while keeping 2..=8 on 32+ GiB hosts is clean and well-tested.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
kotekompotek
left a comment
There was a problem hiding this comment.
Verified: the memory-based cap keeps the old (cores/2).clamp(2,8) behaviour on 32+ GiB hosts, so this only reduces concurrency where RAM is tight. GlobalMemoryStatusEx use is correct (dwLength set, bool checked). Boundary tests cover both the RAM tiers and the core scaling. One thing worth a sentence in the PR body: on a <=18 GiB 32-core host this drops 8->2 workers, which trades pipeline-warmup latency for commit headroom — intended, but reviewers on large-RAM machines won't see the difference.
|
Automated triage for the maintainers. Needs work. This caps the background pipeline worker count in CI: passing. Generated by Claude Code |
|
Following up on the triage feedback, I measured peak commit per pipeline worker directly on this 15.89 GiB RAM host (Windows 11, i7-7700HQ 4C/8T, NVIDIA GTX 1070 8 GB): 1. Concurrent shader translation + D3D12 PSO creation (
( 2.
Re-checking earlier The triage feedback is right: the 12–15 GiB commit footprint on a 16 GiB host comes from title and host GPU memory, not pipeline worker threads, so capping default workers to 2 on |
Problem
pipeline::make::queue currently spawns (cores / 2).clamp(2, 8) background pipeline workers regardless of installed physical RAM. On 16 GiB RAM systems with 8–16 logical processors, 4–8 concurrent victory-shader translations and driver PSO compiles can exhaust Windows commit memory and trigger E_OUTOFMEMORY during world loading.
Fix
Query installed physical memory via GlobalMemoryStatusEx (Win32_System_SystemInformation is already enabled in crates/victory-gpu/Cargo.toml, so no manifest or lockfile changes are needed) and bound the automatic default via default_workers(cores, total_phys):
<= 18 GiB RAM: cap at 2 workers
<= 26 GiB RAM: cap at 4 workers
This complements #2250 (VICTORY_PIPELINE_THREADS manual override) by making the out-of-the-box default safe on 16–24 GiB machines without changing behavior on 32+ GiB hosts.
Verification
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default and --all-features): clean
cargo test -p xtask --locked: 6/6 passed (repository_passes_policy ok)
cargo test -p victory-gpu --lib --locked -- pipeline::make::tests:: on GTX 1070: 4/4 passed (default) and 5/5 passed (--features diagnostics)
VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --lib --features diagnostics --locked -- pipeline::make::tests::: 5/5 passed
VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1: 248/248 passed (1 ignored)