Skip to content

Wait 500 ms per frame for host pipelines under Wine/Proton (Linux only) - #28

Open
luniiya wants to merge 1 commit into
DexNom:mainfrom
luniiya:linux-proton-pipeline-wait
Open

luniiya wants to merge 1 commit into
DexNom:mainfrom
luniiya:linux-proton-pipeline-wait

Conversation

@luniiya

@luniiya luniiya commented Nov 25, 2026

Copy link
Copy Markdown

Linux/Proton only. Windows is unaffected.

Problem

Under Wine/Proton, vkd3d-proton holds a few host pipelines for good: they never finish. The per-frame host pipeline wait budget (DEFAULT_WAIT_MS, 12 s) was spent waiting on them in every frame, and their draws were dropped anyway. That's how the game ended up at 0.1 fps.

Stack dumps (VICTORY_STACKS) show the chain. The main thread waits on the frame semaphore, the render thread waits on its workers, and a worker waits in draw::State::run_indirect → pipeline::host_pipeline → make::ready → make::wait. Every frame waited exactly 12,000 ms.

Change

wait_budget now defaults to 500 ms (WINE_WAIT_MS) when running under Wine, detected by ntdll exporting wine_get_version. Nothing else changes:

  • On Windows, on_wine() is false and the default stays 12 s.
  • VICTORY_PIPELINE_WAIT_MS still overrides the default everywhere.
  • On non-Windows builds, on_wine() is false.

Results

Linux, GE-Proton + vkd3d-proton + RADV, same save, steady gameplay frames:

budget fps ms/frame draws/frame dropped/frame
before 12,000 ms 0.1 ~12,200 (worst 24,163) ~5,000 420–600
after 500 ms (picked automatically, no env var set) 3.3–3.4 ~300 ~5,000–5,100 ~330–380

Before, 402 s were spent waiting on pipelines over 56 frames. With a manual 500 ms override the total was 16.6 s over 54 frames.

Testing

  • Built with cargo xwin build --profile diag -p victory --features diagnostics.
  • Ran under Proton with VICTORY_PIPELINE_WAIT_MS unset. The log shows host pipeline wait budget per frame, per kind millis=500, and the fps above are from that run.
  • cargo xwin clippy -p victory-gpu shows no warnings in make.rs, and cargo fmt --check is clean for it.
  • Not tested on Windows. The Windows path only reaches the new code through on_wine(), which returns false there.

The pipelines vkd3d never finishes are a separate issue, and I'm still looking into them.

Under Wine/Proton, vkd3d-proton holds some pipelines for good, so the
12 s per-frame wait budget was waited out in every frame and those
draws were dropped anyway. Default the budget to 500 ms when ntdll
exports wine_get_version. Windows keeps the 12 s default; the
VICTORY_PIPELINE_WAIT_MS override still wins everywhere.

Measured on Linux (GE-Proton, vkd3d-proton, RADV), same save:
before 0.1 fps (~12.2 s/frame), after 3.3-3.4 fps (~300 ms/frame).
@Daayben

Daayben commented Nov 26, 2026

Copy link
Copy Markdown

Rejeté sur la 4090 : la campagne 06 (3 paires alternées) a donné un écran noir et moins de draws (3 523-3 542 contre 4 316-4 390 à draw égale). Le gain de 12 % est un artefact du rendu cassé. Voir la discussion sur #22. On relance si un correctif du rendu est trouvé.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants