warm: pipeline preparation hangs above 12 jobs on a 24-thread CPU (oversubscription) #325

Closed
opened 2026-12-03 14:19:46 +00:00 by github-bot · 2 comments
Owner

@⁠wrz1911 on GitHub · 2026-12-03 14:13 UTC · original

What

victory warm (VICTORY_WARM_JOBS) hangs on this machine above 12 processes: workers start, then all stop making progress; unresponsive for 45 s lines are added to warm-bad.txt and warm-done.txt stays at zero. 12 processes compiles at ~44 pipelines/s (126/s bursts); 14/16/24 do not compile at all.

Environment

  • CPU: Intel Core Ultra 7 270K Plus (Arrow Lake, 24 logical cores: 8 P + 16 E)
  • GPU: AMD Radeon RX 9070 XT 16 GB, RADV GFX1201, mesa-gta6 26.3.1 with the xmem patches
  • RAM: 31 GiB (29.7 GiB usable), no swap pressure
  • OS: Arch Linux, Btrfs (compress=zstd:3) for / and /mnt/data (game on /mnt/data, same Btrfs)
  • xmem: HEAD 842767a, release build, rustflags -C target-cpu=x86-64-v3
  • Wine: system 11.23 (NTSYNC up)
  • Game: GTA VI Xbox build 930.048.020: 94,419 pipelines known, 25,761 shaders
  • Switches: VICTORY_WARM=1, VICTORY_SKIP_INTRO=1

Measurements (log lines "N of 94365, T s")

VICTORY_WARM_JOBS Result
12 OK: 68 of 93718, 48 s early, later ~44 pipelines/s average (126/s bursts)
14 hangs: no progress, warm-bad grows 701 -> 717
16 hangs: no progress (0 done)
24 hangs: no progress (0 done)

When hanging: victory.exe overall CPU ~0.3-1.7% (main thread in ntsync_schedule; worker processes come and go), no new warm-done lines, warm-bad.txt gains unresponsive for 45 s lines. dmesg shows no amdgpu errors (no GPU hang/reset/fault). GTT 15.9 GB / VRAM 16.3 GB, ttm.pages_limit 4070713 (= 15.5 GiB).

Hypothesis

Each warm worker seems to use ~2 CPU threads (top shows 100-200% per worker process). 12 workers x 2 = 24 threads = the logical core count here; 14 x 2 = 28 = oversubscribed, and the workers then stop making progress. The default jobs() in crates/victory-gpu/src/pipeline/prepared.rs is memory.min(cpus * 2 / 3).clamp(1, 16) -> 16 on a 24-thread CPU, which oversubscribes here.

Suggestions: cap the default to (logical cores / per-worker threads), or detect "no progress for N seconds" and reduce jobs automatically; and document that over-subscription can hang the compiler rather than just slow it down.

Note

Same effect at 16 (current default) and 24; VICTORY_WARM_JOBS=10 works fine and is what we use now.

**@⁠wrz1911** on GitHub · 2026-12-03 14:13 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/325) ## What `victory warm` (VICTORY_WARM_JOBS) hangs on this machine above 12 processes: workers start, then all stop making progress; `unresponsive for 45 s` lines are added to `warm-bad.txt` and `warm-done.txt` stays at zero. 12 processes compiles at ~44 pipelines/s (126/s bursts); 14/16/24 do not compile at all. ## Environment - CPU: Intel Core Ultra 7 270K Plus (Arrow Lake, 24 logical cores: 8 P + 16 E) - GPU: AMD Radeon RX 9070 XT 16 GB, RADV GFX1201, mesa-gta6 26.3.1 with the xmem patches - RAM: 31 GiB (29.7 GiB usable), no swap pressure - OS: Arch Linux, Btrfs (compress=zstd:3) for / and /mnt/data (game on /mnt/data, same Btrfs) - xmem: HEAD 842767a, release build, rustflags `-C target-cpu=x86-64-v3` - Wine: system 11.23 (NTSYNC up) - Game: GTA VI Xbox build 930.048.020: 94,419 pipelines known, 25,761 shaders - Switches: VICTORY_WARM=1, VICTORY_SKIP_INTRO=1 ## Measurements (log lines "N of 94365, T s") | VICTORY_WARM_JOBS | Result | |---|---| | 12 | OK: `68 of 93718, 48 s` early, later ~44 pipelines/s average (126/s bursts) | | 14 | hangs: no progress, warm-bad grows 701 -> 717 | | 16 | hangs: no progress (0 done) | | 24 | hangs: no progress (0 done) | When hanging: victory.exe overall CPU ~0.3-1.7% (main thread in `ntsync_schedule`; worker processes come and go), no new warm-done lines, warm-bad.txt gains `unresponsive for 45 s` lines. dmesg shows no amdgpu errors (no GPU hang/reset/fault). GTT 15.9 GB / VRAM 16.3 GB, ttm.pages_limit 4070713 (= 15.5 GiB). ## Hypothesis Each warm worker seems to use ~2 CPU threads (top shows 100-200% per worker process). 12 workers x 2 = 24 threads = the logical core count here; 14 x 2 = 28 = oversubscribed, and the workers then stop making progress. The default `jobs()` in `crates/victory-gpu/src/pipeline/prepared.rs` is `memory.min(cpus * 2 / 3).clamp(1, 16)` -> 16 on a 24-thread CPU, which oversubscribes here. Suggestions: cap the default to (logical cores / per-worker threads), or detect "no progress for N seconds" and reduce jobs automatically; and document that over-subscription can hang the compiler rather than just slow it down. ## Note Same effect at 16 (current default) and 24; VICTORY_WARM_JOBS=10 works fine and is what we use now.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 14:19:47 +00:00
Author
Owner

@⁠wrz1911 on GitHub · 2026-12-03 14:18 UTC · original

One more factor: this CPU has no SMT

Our CPU (Intel Core Ultra 7 270K Plus, Arrow Lake) has 24 physical cores and 24 logical threads — no SMT. The 7800X3D in the #270 measurements has 8 cores / 16 threads (SMT).

If a warm compile path spins/busy-waits while waiting (spinlock, GPU poll), over-subscribed workers on a no-SMT CPU can starve each other (livelock) — there is no SMT interleaving to guarantee forward progress. This would also explain why 12 jobs (12 x ~2 threads = 24 = physical core count) sits exactly on the boundary, and why machines with SMT (the author test box and most reporters) do not hit it at 32 jobs.

Not a firm conclusion — just a plausible mechanism worth checking in the compile/wait code paths (does anything spin rather than block?). Happy to test patches.

**@⁠wrz1911** on GitHub · 2026-12-03 14:18 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/325#issuecomment-7381237517) ## One more factor: this CPU has no SMT Our CPU (Intel Core Ultra 7 270K Plus, Arrow Lake) has **24 physical cores and 24 logical threads — no SMT**. The 7800X3D in the #270 measurements has 8 cores / 16 threads (SMT). If a warm compile path spins/busy-waits while waiting (spinlock, GPU poll), over-subscribed workers on a no-SMT CPU can starve each other (livelock) — there is no SMT interleaving to guarantee forward progress. This would also explain why 12 jobs (12 x ~2 threads = 24 = physical core count) sits exactly on the boundary, and why machines with SMT (the author test box and most reporters) do not hit it at 32 jobs. Not a firm conclusion — just a plausible mechanism worth checking in the compile/wait code paths (does anything spin rather than block?). Happy to test patches.
Author
Owner

@⁠GreemSC on GitHub · 2026-12-03 21:19 UTC · original

I saw the same stall on a second machine, on a tree with #336.

Machine: i7-12700K (20 logical threads), RX 7900 XT, Linux, Proton-CachyOS Wine. The warm ran in a cgroup limited to 16 CPUs (AllowedCPUs=4-19).

With 12 processes (--jobs 12, explicit), on 99,831 known pipelines:

  • in about 1 minute, 65 lines unresponsive for 45 s went into warm-bad.txt;
  • only ~19 pipelines were written;
  • warm-done.txt stayed empty and the load average went up to 69.

With 1 process, the same pipelines compiled normally. The slowest ones take 22–42 s each, per slow-pipelines.txt. That is close to the 45 s watchdog even on an idle machine.

With 8 processes, it made ~2,000–3,300 pipelines/min with 0 bad, and all 99,831 were done in ~35 min.

So 12 × ~2 threads on 16 CPUs stalls here too, which fits the hypothesis above.

One side effect is worth knowing: the pipelines marked bad during the stall stay in warm-bad.txt and are skipped by later warms. We had to move that file away for them to be made. Perhaps an unresponsive entry could be retried once, at a lower job count, before it is kept as bad?

**@⁠GreemSC** on GitHub · 2026-12-03 21:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/325#issuecomment-7392628231) I saw the same stall on a second machine, on a tree with #336. **Machine:** i7-12700K (20 logical threads), RX 7900 XT, Linux, Proton-CachyOS Wine. The warm ran in a cgroup limited to 16 CPUs (`AllowedCPUs=4-19`). **With 12 processes** (`--jobs 12`, explicit), on 99,831 known pipelines: - in about 1 minute, 65 lines `unresponsive for 45 s` went into `warm-bad.txt`; - only ~19 pipelines were written; - `warm-done.txt` stayed empty and the load average went up to 69. **With 1 process**, the same pipelines compiled normally. The slowest ones take 22–42 s each, per `slow-pipelines.txt`. That is close to the 45 s watchdog even on an idle machine. **With 8 processes**, it made ~2,000–3,300 pipelines/min with 0 bad, and all 99,831 were done in ~35 min. So 12 × ~2 threads on 16 CPUs stalls here too, which fits the hypothesis above. One side effect is worth knowing: the pipelines marked bad during the stall stay in `warm-bad.txt` and are skipped by later warms. We had to move that file away for them to be made. Perhaps an `unresponsive` entry could be retried once, at a lower job count, before it is kept as bad?
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/lobomfz--VIctory-xmem#325
No description provided.