Robustness on varied PCs: explicit adapter selection and a guard for driver compiler crashes (as in Belobug/VIctory-Belobug-AMD) #15

Open
opened 2026-11-26 20:18:17 +00:00 by github-bot · 0 comments
Owner

@⁠mutlusinan on GitHub · 2026-11-26 20:15 UTC · original

Two small, independent pieces that Belobug/VIctory-Belobug-AMD has and this engine does not.

1. Picking the GPU in the engine

The README says Windows selects the adapter for each executable, and that users should set High performance for kelvaroq-engine.exe. The launcher profiles the preferred discrete GPU, but the engine may then run on another one. The settings would be picked for one card and used on another. Laptops with two GPUs are where this shows. Laptop reports such as #4 (RTX 3050 Laptop) are the kind of machine where it matters; I have not checked which GPU that run used.

Belobug's version (in crates/victory-shader/src/emit/host.rs, used by the runtime and the offline pipeline checks):

  • it prefers a high-performance adapter with Shader Model 6.6 (EnumAdapterByGpuPreference);
  • it logs the chosen adapter's name, PCI vendor and device ids, and dedicated VRAM;
  • VICTORY_D3D12_ADAPTER takes a zero-based DXGI index or part of the adapter's name (NVIDIA, RTX 3050), with tests for matching.

2. Surviving driver compiler crashes

A driver's shader compiler can crash inside pipeline creation. Belobug catches that (VICTORY_COMPILER_GUARD, on by default) and records the pipeline's key in warm-bad.txt beside the pipeline library. Later runs then skip that pipeline instead of crashing again (VICTORY_WARM_BAD). Code: crates/victory-gpu/src/pipeline/make.rs. It was written for AMD's compiler (Belobug/VIctory-Belobug-AMD#298: 29 compute pipelines lost to it).

It should not be on for NVIDIA as it stands. NVIDIA's compiler (nvgpucomp64.dll) raises access violations near address 0 and handles them itself. The guard sees those first-chance faults first and takes them for crashes. On an RTX 5080 that falsely quarantined 20–28 world mesh pipelines a run, and every later run refused them with E_FAIL (Belobug/VIctory-Belobug-AMD#158, open; it may also explain part of Belobug/VIctory-Belobug-AMD#160). Since this project is developed on NVIDIA, a port would have to be off on NVIDIA by default, or tell a handled fault from a real crash, before it helps.

Estimated contribution (projection, not measured here)

  • Frame rate: none.
  • Fewer failed starts: fewer runs on the wrong GPU and wrong settings on two-GPU laptops, and fewer repeat crashes on a pipeline the driver cannot compile. That fits the Automatic profile already in the launcher.

Concerns

  • The quarantine has known bugs in Belobug. Belobug/VIctory-Belobug-AMD#280: a pipeline once quarantined is never retried, and VICTORY_WARM_BAD=0 is ignored. Belobug/VIctory-Belobug-AMD#294 fixes this by scoping the file by driver and build fingerprint. A port should take the fixed form.
  • Card dependence: the adapter selection has none. The compiler guard does: see the NVIDIA note above.
  • Provenance: GPL-3.0-or-later, with no XCL code.

Basis of this comparison. Kelvaroq e062a82 (engine: fxceless/victory-fork f85101b with native/patches 0000–0064 applied; all 61 apply cleanly) and Belobug/VIctory-Belobug-AMD a-publier at cd8dfc0. The two engines' common ancestor is fxceless a26859f; a-publier is 558 commits past it, so the Belobug code needs a manual port onto the pinned tree as a new patch. Read from source only: nothing here was built or run. The estimates above are projections from the numbers each project published, not measurements.

**@⁠mutlusinan** on GitHub · 2026-11-26 20:15 UTC · [original](https://github.com/stellarr-studio/kelvaroq/issues/15) Two small, independent pieces that Belobug/VIctory-Belobug-AMD has and this engine does not. ## 1. Picking the GPU in the engine The README says Windows selects the adapter for each executable, and that users should set **High performance** for `kelvaroq-engine.exe`. The launcher profiles the preferred discrete GPU, but the engine may then run on another one. The settings would be picked for one card and used on another. Laptops with two GPUs are where this shows. Laptop reports such as #4 (RTX 3050 Laptop) are the kind of machine where it matters; I have not checked which GPU that run used. Belobug's version (in `crates/victory-shader/src/emit/host.rs`, used by the runtime and the offline pipeline checks): - it prefers a high-performance adapter with Shader Model 6.6 (`EnumAdapterByGpuPreference`); - it logs the chosen adapter's name, PCI vendor and device ids, and dedicated VRAM; - `VICTORY_D3D12_ADAPTER` takes a zero-based DXGI index or part of the adapter's name (`NVIDIA`, `RTX 3050`), with tests for matching. ## 2. Surviving driver compiler crashes A driver's shader compiler can crash inside pipeline creation. Belobug catches that (`VICTORY_COMPILER_GUARD`, on by default) and records the pipeline's key in `warm-bad.txt` beside the pipeline library. Later runs then skip that pipeline instead of crashing again (`VICTORY_WARM_BAD`). Code: `crates/victory-gpu/src/pipeline/make.rs`. It was written for AMD's compiler (Belobug/VIctory-Belobug-AMD#298: 29 compute pipelines lost to it). **It should not be on for NVIDIA as it stands.** NVIDIA's compiler (`nvgpucomp64.dll`) raises access violations near address 0 and handles them itself. The guard sees those first-chance faults first and takes them for crashes. On an RTX 5080 that falsely quarantined 20–28 world mesh pipelines a run, and every later run refused them with `E_FAIL` (Belobug/VIctory-Belobug-AMD#158, open; it may also explain part of Belobug/VIctory-Belobug-AMD#160). Since this project is developed on NVIDIA, a port would have to be off on NVIDIA by default, or tell a handled fault from a real crash, before it helps. ## Estimated contribution (projection, not measured here) - **Frame rate:** none. - **Fewer failed starts:** fewer runs on the wrong GPU and wrong settings on two-GPU laptops, and fewer repeat crashes on a pipeline the driver cannot compile. That fits the Automatic profile already in the launcher. ## Concerns - **The quarantine has known bugs in Belobug.** Belobug/VIctory-Belobug-AMD#280: a pipeline once quarantined is never retried, and `VICTORY_WARM_BAD=0` is ignored. Belobug/VIctory-Belobug-AMD#294 fixes this by scoping the file by driver and build fingerprint. A port should take the fixed form. - **Card dependence:** the adapter selection has none. The compiler guard does: see the NVIDIA note above. - **Provenance:** GPL-3.0-or-later, with no XCL code. --- **Basis of this comparison.** Kelvaroq `e062a82` (engine: fxceless/victory-fork `f85101b` with `native/patches` 0000–0064 applied; all 61 apply cleanly) and Belobug/VIctory-Belobug-AMD `a-publier` at `cd8dfc0`. The two engines' common ancestor is fxceless `a26859f`; `a-publier` is 558 commits past it, so the Belobug code needs a manual port onto the pinned tree as a new patch. Read from source only: nothing here was built or run. The estimates above are projections from the numbers each project published, not measurements.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:18:17 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.