GPU: choose an adapter that can run the title, and name the ones that cannot #967

Open
github-bot wants to merge 2 commits from github-bot/gh-967 into main AGit
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-24 14:35 UTC · original
zzm1234560621-prog:gpu/adapter-selection → main · +385 −2 · 3 files · 2 commits · open

GPU: choose an adapter that can run the title, and name the ones that cannot

What

victory_gpu::host::create now picks the host adapter instead of taking
D3D12CreateDevice(None, …). New module crates/victory-gpu/src/adapter.rs:

  • enumerate() walks IDXGIFactory4::EnumAdapters1 and probes each adapter:
    its description, whether a D3D12 device can be created on it,
    SHADER_MODEL, D3D12_OPTIONS7::MeshShaderTier, and the software flag.
  • choose() is a pure function over those facts and is where the policy lives.
  • report() renders one line per adapter, for the error below.
  • open() creates the device on the chosen adapter.

create() keeps its WARP branch unchanged (VICTORY_D3D12_WARP, diagnostics
builds) and returns anyhow::Result instead of windows::core::Result, so a
failure can carry the adapter list rather than a bare E_FAIL.

Why

D3D12CreateDevice(None, …) means "whatever DXGI calls the default adapter",
which is the adapter driving the primary output. That is the wrong adapter in
two common configurations:

  • Hybrid laptops (Intel iGPU + discrete GPU): the default is the
    integrated GPU. It may create a device and still not be what runs the
    world; the old code would either use it or fail the SM 6.6 check with
    the device supports SM 0x65 only and no hint that a capable GPU is in
    the machine.
  • Machines with a remote-desktop or emulator display driver: those add
    adapters that enumerate like any other and cannot create a D3D12 device.
    When one of them ends up as the default, the failure was an E_FAIL with
    no name attached.

The title needs shader model 6.6 (README) and, for the world, mesh shaders,
so "the default adapter" is not a safe default.

How the choice is made

  1. Hardware only. A software adapter is never chosen — Microsoft Basic Render Driver reports SM 6.6 and mesh shaders too (measured below), and
    silently running the title on the CPU is worse than a failure that names
    the reason. WARP stays the explicit VICTORY_D3D12_WARP switch.
  2. A device must exist and report SM 6.6.
  3. Mesh shaders first — the world's draws are mesh dispatches.
  4. Then the most DedicatedVideoMemory.
  5. Then the lowest LUID, so the same machine makes the same choice whatever
    order the driver enumerates in.

When nothing qualifies, the error lists every adapter with its LUID, vendor,
dedicated memory, shader model, mesh support and whether it is software.

Measured

enumerate() + choose() on the machine this was written on (Windows 11,
Core Ultra 9 185H, one Intel Arc iGPU, plus a remote-desktop display driver
and an emulator display driver installed):

adapters on this machine:
  Intel(R) Arc(TM) Graphics        [LUID 00000000:0001060b, vendor 8086, 128 MiB, SM 0x66, mesh]
  Intel(R) Arc(TM) Graphics        [LUID 00000000:00018b29, vendor 8086, 128 MiB, SM 0x66, mesh]
  Intel(R) Arc(TM) Graphics        [LUID 00000000:000163a9, vendor 8086, 128 MiB, SM 0x66, mesh]
  Microsoft Basic Render Driver    [LUID 00000000:00010a2a, vendor 1414,   0 MiB, SM 0x66, mesh, software]
chosen: Some("Intel(R) Arc(TM) Graphics")

Two things this shows that the old code could not:

  • The same physical GPU appears three times, once per display path. Which of
    the three is "the default" is not stable across runs; the LUID tie-break is.
  • The Basic Render Driver passes a naive SM 6.6 + mesh test. That is the
    reason for rule 1.

Not verified

  • No game files, no console hardware: nothing here was run against the title.
  • No frame-time or image comparison; this changes which adapter is used, not
    what is drawn.
  • One machine, one adapter family. The mesh-first rule is a reading of the
    README ("mesh shaders for the world"), not something measured on a GPU
    without mesh support.
  • The 32-lane/64-lane behaviour of whatever adapter gets chosen is not
    touched by this PR; it is the same host the old code would have used
    whenever the default adapter was the right one.

Tested

cargo test -p victory-gpu --locked: 50 passed, 1 ignored, 0 failed
(8 of them new; they drive choose and report over synthetic facts and
need neither a GPU nor a display).

CI's commands, on Windows 11 with MSVC 14.51 and Rust 1.98.1 (the pinned
toolchain):

  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean
  • cargo xtask policy: ok
  • cargo test --workspace --locked: see the run below

One caveat for anyone re-running the suite: victory-core's two
policy::tests and victory-gpu's shader_cache / watch tests create
directories under %TEMP%. They pass on a normal machine; a run whose
%TEMP% is not writable fails them with PermissionDenied, which is not a
code failure.

Relation to open PRs

  • #94 / #320 add VICTORY_ADAPTER and adapter helpers for the shader test
    host. This PR deliberately adds no environment variable: if that lands
    first, Facts and choose are the shared implementation those helpers
    should call, and the override becomes one more input to choose.
  • Touches nothing in victory-shader, so #233 / #439's stack is unaffected.
**@⁠zzm1234560621-prog** on GitHub · 2026-11-24 14:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/967) `zzm1234560621-prog:gpu/adapter-selection` → `main` · +385 −2 · 3 files · 2 commits · open # GPU: choose an adapter that can run the title, and name the ones that cannot ## What `victory_gpu::host::create` now picks the host adapter instead of taking `D3D12CreateDevice(None, …)`. New module `crates/victory-gpu/src/adapter.rs`: - `enumerate()` walks `IDXGIFactory4::EnumAdapters1` and probes each adapter: its description, whether a D3D12 device can be created on it, `SHADER_MODEL`, `D3D12_OPTIONS7::MeshShaderTier`, and the software flag. - `choose()` is a pure function over those facts and is where the policy lives. - `report()` renders one line per adapter, for the error below. - `open()` creates the device on the chosen adapter. `create()` keeps its WARP branch unchanged (`VICTORY_D3D12_WARP`, diagnostics builds) and returns `anyhow::Result` instead of `windows::core::Result`, so a failure can carry the adapter list rather than a bare `E_FAIL`. ## Why `D3D12CreateDevice(None, …)` means "whatever DXGI calls the default adapter", which is the adapter driving the primary output. That is the wrong adapter in two common configurations: - **Hybrid laptops** (Intel iGPU + discrete GPU): the default is the integrated GPU. It may create a device and still not be what runs the world; the old code would either use it or fail the SM 6.6 check with `the device supports SM 0x65 only` and no hint that a capable GPU is in the machine. - **Machines with a remote-desktop or emulator display driver**: those add adapters that enumerate like any other and cannot create a D3D12 device. When one of them ends up as the default, the failure was an `E_FAIL` with no name attached. The title needs shader model 6.6 (README) and, for the world, mesh shaders, so "the default adapter" is not a safe default. ## How the choice is made 1. Hardware only. A software adapter is never chosen — `Microsoft Basic Render Driver` reports SM 6.6 and mesh shaders too (measured below), and silently running the title on the CPU is worse than a failure that names the reason. WARP stays the explicit `VICTORY_D3D12_WARP` switch. 2. A device must exist and report SM 6.6. 3. Mesh shaders first — the world's draws are mesh dispatches. 4. Then the most `DedicatedVideoMemory`. 5. Then the lowest LUID, so the same machine makes the same choice whatever order the driver enumerates in. When nothing qualifies, the error lists every adapter with its LUID, vendor, dedicated memory, shader model, mesh support and whether it is software. ## Measured `enumerate()` + `choose()` on the machine this was written on (Windows 11, Core Ultra 9 185H, one Intel Arc iGPU, plus a remote-desktop display driver and an emulator display driver installed): ``` adapters on this machine: Intel(R) Arc(TM) Graphics [LUID 00000000:0001060b, vendor 8086, 128 MiB, SM 0x66, mesh] Intel(R) Arc(TM) Graphics [LUID 00000000:00018b29, vendor 8086, 128 MiB, SM 0x66, mesh] Intel(R) Arc(TM) Graphics [LUID 00000000:000163a9, vendor 8086, 128 MiB, SM 0x66, mesh] Microsoft Basic Render Driver [LUID 00000000:00010a2a, vendor 1414, 0 MiB, SM 0x66, mesh, software] chosen: Some("Intel(R) Arc(TM) Graphics") ``` Two things this shows that the old code could not: - The same physical GPU appears three times, once per display path. Which of the three is "the default" is not stable across runs; the LUID tie-break is. - The Basic Render Driver passes a naive SM 6.6 + mesh test. That is the reason for rule 1. ## Not verified - No game files, no console hardware: nothing here was run against the title. - No frame-time or image comparison; this changes which adapter is used, not what is drawn. - One machine, one adapter family. The mesh-first rule is a reading of the README ("mesh shaders for the world"), not something measured on a GPU without mesh support. - The 32-lane/64-lane behaviour of whatever adapter gets chosen is not touched by this PR; it is the same host the old code would have used whenever the default adapter was the right one. ## Tested `cargo test -p victory-gpu --locked`: 50 passed, 1 ignored, 0 failed (8 of them new; they drive `choose` and `report` over synthetic facts and need neither a GPU nor a display). CI's commands, on Windows 11 with MSVC 14.51 and Rust 1.98.1 (the pinned toolchain): - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: clean - `cargo xtask policy`: ok - `cargo test --workspace --locked`: see the run below One caveat for anyone re-running the suite: `victory-core`'s two `policy::tests` and `victory-gpu`'s `shader_cache` / `watch` tests create directories under `%TEMP%`. They pass on a normal machine; a run whose `%TEMP%` is not writable fails them with `PermissionDenied`, which is not a code failure. ## Relation to open PRs - #94 / #320 add `VICTORY_ADAPTER` and adapter helpers for the shader test host. This PR deliberately adds **no** environment variable: if that lands first, `Facts` and `choose` are the shared implementation those helpers should call, and the override becomes one more input to `choose`. - Touches nothing in `victory-shader`, so #233 / #439's stack is unaffected.
D3D12CreateDevice(None, …) takes the adapter DXGI calls the default, which
is the one driving the primary output: the integrated GPU on a hybrid
laptop, and on a machine with a remote-desktop or emulator display driver
an adapter that cannot create a device at all. The title needs shader model
6.6 and, for the world, mesh shaders, so neither is a safe default, and
when none of them worked the failure was a bare E_FAIL that named nothing.

Enumerate and probe every adapter — a device, SHADER_MODEL,
D3D12_OPTIONS7's mesh tier, the software flag — then choose: hardware,
SM 6.6, mesh shaders first, then the most dedicated memory, then the
lowest LUID so the choice does not depend on enumeration order. Software
adapters are never chosen (Microsoft Basic Render Driver reports SM 6.6
and mesh shaders too), and WARP stays the explicit VICTORY_D3D12_WARP
switch. When nothing qualifies, the error lists every adapter with what
it offers.

Measured on the machine this was written on (Core Ultra 9 185H, Intel Arc
iGPU, plus a remote-desktop and an emulator display driver): four
adapters, the same GPU listed three times — once per display path, so
which is the default is not stable — and the Basic Render Driver passing a
naive SM 6.6 + mesh test.

cargo test -p victory-gpu: 57 passed, 0 failed, 1 ignored.
cargo clippy --workspace --all-targets --all-features -- -D warnings: clean.
cargo xtask policy: ok.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:13 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:13 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 66d97ee: cargo test -p victory-gpu passes, 57 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7135655287) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 66d97ee: `cargo test -p victory-gpu` passes, 57 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠heromike405-arch on GitHub · 2026-11-24 15:18 UTC · original

Independent DXGI/D3D12 probe on a hybrid Windows 11 laptop (build 26100). I created a feature-level 12.0 D3D12 device per enumerated adapter and made the same SM 6.6 and OPTIONS7 mesh-tier queries used in 66d97ee.

Adapter Dedicated VRAM SM 6.6 Mesh tier DXGI software
NVIDIA GeForce RTX 5060 Laptop GPU 7899 MiB Yes 1 No
AMD Radeon 610M 461 MiB Yes None No
Microsoft Basic Render Driver 0 MiB Yes 1 Yes

Applying the PR's selection rules to the measured facts picks the RTX 5060. In this configuration, D3D12CreateDevice(NULL, ...) also returned the RTX device, so this run does not reproduce the default-adapter mismatch. The software adapter did report mesh support despite being flagged as software.

Standalone probe of the Windows APIs and the selection criteria. The PR binary and game were not run. AI-assisted with Codex.

**@⁠heromike405-arch** on GitHub · 2026-11-24 15:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7135807559) Independent DXGI/D3D12 probe on a hybrid Windows 11 laptop (build 26100). I created a feature-level 12.0 D3D12 device per enumerated adapter and made the same SM 6.6 and OPTIONS7 mesh-tier queries used in `66d97ee`. | Adapter | Dedicated VRAM | SM 6.6 | Mesh tier | DXGI software | | --- | ---: | --- | --- | --- | | NVIDIA GeForce RTX 5060 Laptop GPU | 7899 MiB | Yes | 1 | No | | AMD Radeon 610M | 461 MiB | Yes | None | No | | Microsoft Basic Render Driver | 0 MiB | Yes | 1 | Yes | Applying the PR's selection rules to the measured facts picks the RTX 5060. In this configuration, `D3D12CreateDevice(NULL, ...)` also returned the RTX device, so this run does not reproduce the default-adapter mismatch. The software adapter did report mesh support despite being flagged as software. *Standalone probe of the Windows APIs and the selection criteria. The PR binary and game were not run. AI-assisted with Codex.*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:30 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/lib.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7148580695) <!-- victory-triage v1 head=66d97eea7ea30a71e7111b147752d47c9294afc8 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/lib.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Coderlord on GitHub · 2026-11-25 05:21 UTC · original

A suggestion from testing #967: skip software adapters in probe().

probe() makes a D3D12 device on every enumerated adapter, the Microsoft Basic Render Driver included, though runs_the_title() never picks a software adapter. A WARP device is one per adapter and process, so the probe makes and drops the very device that code asking for WARP on purpose holds. In a fork with a WARP-based test (fxceless/victory-gta6's inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset), that test failed in 2 of 2 full cargo test --workspace runs with #967 applied (a VirtualFree(MEM_DECOMMIT) of memory that a just-dropped WARP placed buffer covered was refused), and in 1 of 4 full runs with the change below (so the change makes it rarer, not gone; the test itself races WARP releasing the placed buffer late). Run alone, it passes either way. The main point stands on its own: the probe makes a device no choice can use.

The change, in crates/victory-gpu/src/adapter.rs: return early from probe() for software adapters, and have report() say not probed for them instead of no D3D12 device:

    // Software adapters are never chosen (`runs_the_title`), so no device is
    // made on them: a WARP device in every process costs time and memory, and
    // it is the very device (one per adapter and process) that code and tests
    // asking for WARP on purpose get.
    if facts.software {
        return facts;
    }

The choice does not change: on Windows 11 with an RTX 5080, an AMD integrated GPU and the Basic Render Driver, #967 with this change picks the RTX 5080 (host adapter chosen adapter=NVIDIA GeForce RTX 5080 shader_model=0x66 mesh_shaders=true adapters=3), and it no longer makes a WARP device at every start.

AI use: found, written and tested with Claude Code (Claude Opus 5.5).

**@⁠Coderlord** on GitHub · 2026-11-25 05:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7153690840) A suggestion from testing #967: skip software adapters in `probe()`. `probe()` makes a D3D12 device on every enumerated adapter, the Microsoft Basic Render Driver included, though `runs_the_title()` never picks a software adapter. A WARP device is one per adapter and process, so the probe makes and drops the very device that code asking for WARP on purpose holds. In a fork with a WARP-based test (fxceless/victory-gta6's `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset`), that test failed in 2 of 2 full `cargo test --workspace` runs with #967 applied (a `VirtualFree(MEM_DECOMMIT)` of memory that a just-dropped WARP placed buffer covered was refused), and in 1 of 4 full runs with the change below (so the change makes it rarer, not gone; the test itself races WARP releasing the placed buffer late). Run alone, it passes either way. The main point stands on its own: the probe makes a device no choice can use. The change, in `crates/victory-gpu/src/adapter.rs`: return early from `probe()` for software adapters, and have `report()` say `not probed` for them instead of `no D3D12 device`: ```rust // Software adapters are never chosen (`runs_the_title`), so no device is // made on them: a WARP device in every process costs time and memory, and // it is the very device (one per adapter and process) that code and tests // asking for WARP on purpose get. if facts.software { return facts; } ``` The choice does not change: on Windows 11 with an RTX 5080, an AMD integrated GPU and the Basic Render Driver, #967 with this change picks the RTX 5080 (`host adapter chosen adapter=NVIDIA GeForce RTX 5080 shader_model=0x66 mesh_shaders=true adapters=3`), and it no longer makes a WARP device at every start. AI use: found, written and tested with Claude Code (Claude Opus 5.5).
github-bot force-pushed github-bot/gh-967 from 66d97eea7e to 489eca15ce 2026-11-26 11:33:30 +00:00 Compare
Author
Owner

@⁠mercuryVM on GitHub · 2026-11-24 14:46 UTC · original · approved these changes

Tested 66d97eea on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 57 passed, and with --features diagnostics 60 passed, including the seven choose tests. cargo clippy -p victory-gpu --all-targets is clean. This machine has the RTX 5070, an AMD integrated GPU and two virtual display adapters, so it's a realistic multi-adapter host. The selection itself isn't exercised by a test against the real adapters, and the title wasn't run.

  • choose as a pure function over probed facts (device creatable, SM 6.6, mesh tier, software flag, VRAM, LUID) is easy to reason about. Excluding software adapters keeps WARP an explicit switch, and the LUID tiebreak makes the result stable for a given machine.
  • Two suggestions:
    • There's no user override. With "mesh, then most VRAM" a user can't force a specific GPU, for example to compare iGPU against dGPU behaviour, short of disabling the other in Device Manager. A VICTORY_ADAPTER=<LUID or index> escape hatch, listed in report()'s output, would cover that.
    • Probing creates a D3D12 device on every adapter at startup, including virtual display adapters (Parsec and Meta here) that have no device. That's harmless, but it's worth a debug! per probe so a slow driver at startup is attributable.

AI-assisted (Claude Code).

**@⁠mercuryVM** on GitHub · 2026-11-24 14:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#pullrequestreview-6041407960) · **approved these changes** Tested 66d97eea on Windows 11, RTX 5070, MSVC: `cargo test -p victory-gpu -- --test-threads=1` 57 passed, and with `--features diagnostics` 60 passed, including the seven `choose` tests. `cargo clippy -p victory-gpu --all-targets` is clean. This machine has the RTX 5070, an AMD integrated GPU and two virtual display adapters, so it's a realistic multi-adapter host. The selection itself isn't exercised by a test against the real adapters, and the title wasn't run. - `choose` as a pure function over probed facts (device creatable, SM 6.6, mesh tier, software flag, VRAM, LUID) is easy to reason about. Excluding software adapters keeps WARP an explicit switch, and the LUID tiebreak makes the result stable for a given machine. - Two suggestions: - There's no user override. With "mesh, then most VRAM" a user can't force a specific GPU, for example to compare iGPU against dGPU behaviour, short of disabling the other in Device Manager. A `VICTORY_ADAPTER=<LUID or index>` escape hatch, listed in `report()`'s output, would cover that. - Probing creates a D3D12 device on every adapter at startup, including virtual display adapters (Parsec and Meta here) that have no device. That's harmless, but it's worth a `debug!` per probe so a slow driver at startup is attributable. AI-assisted (Claude Code).
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 11:13 UTC · original

Rebased onto main 63bcca4, and #967 now carries the probe() change Coderlord asked for.

What changed since the first push

  • crates/victory-gpu/src/lib.rs conflict resolved: mod adapter; sits above mod bindless;.
  • create() now calls crate::adapter::open() in the non-WARP branch of current main, and keeps crate::tdr::log() after the device exists (that arrived on main after the first push).
  • probe() returns before making a device on a software adapter, with the comment Coderlord suggested; report() says not probed for them instead of no D3D12 device. A test covers the wording.
  • One test added for the software path, so nine in adapter::tests now.

Numbers on the rebased head, Intel Arc iGPU (Xe-LPG, driver 32.0.101.6127), Rust 1.98.1 MSVC

  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo test -p victory-gpu: 237 passed, 2 failed, 1 ignored. Both failures are on main too, unmodified, on this GPU — descriptor::host::tests::dynamic_slots_are_held_until_released (assertion failed: heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS) and memory::tests::lists_share_a_table_and_copies_keep_their_views (past the dynamic slots). They look like heap-size limits of this adapter rather than anything this PR touches; worth its own issue if nobody has filed it.
  • The 9 adapter::tests pass; they are synthetic Facts, no DXGI call, so they also pass on a GPU-less CI runner.

On the software adapter, after the change

probe() no longer makes a device on Microsoft Basic Render Driver, so the fork's WARP collision Coderlord described should be gone at the source: this path creates no WARP device at all now. What still makes one is warp_adapter() itself, which is where an explicit VICTORY_D3D12_WARP run goes, and that has not changed.

Overlap with #1483

#1483 adds high_performance_adapter() (+45 in crates/victory-gpu/src/host.rs) for the same problem: EnumAdapterByGpuPreference(HIGH_PERFORMANCE), first adapter that makes a device, software skipped. That picks the discrete GPU but does not check SM 6.6 or mesh shaders, does not order equal candidates deterministically, and reports nothing when it finds none — where a D3D12CreateDevice(None, …) failure names no adapter at all. If #1483 lands first, adapter::Facts/choose are what its helper should call; if this lands first, #1483 only needs to drop that hunk. Say which you prefer and I will adapt this one — the shader half of #1483 is independent of it, and I have no opinion on which of the two adapter shapes you want.

No game files were used. Tested with AI assistance (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 11:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7190440275) Rebased onto `main` `63bcca4`, and #967 now carries the `probe()` change Coderlord asked for. **What changed since the first push** - `crates/victory-gpu/src/lib.rs` conflict resolved: `mod adapter;` sits above `mod bindless;`. - `create()` now calls `crate::adapter::open()` in the non-WARP branch of current `main`, and keeps `crate::tdr::log()` after the device exists (that arrived on `main` after the first push). - `probe()` returns before making a device on a software adapter, with the comment Coderlord suggested; `report()` says `not probed` for them instead of `no D3D12 device`. A test covers the wording. - One test added for the software path, so nine in `adapter::tests` now. **Numbers on the rebased head, Intel Arc iGPU (Xe-LPG, driver 32.0.101.6127), Rust 1.98.1 MSVC** - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo test -p victory-gpu`: 237 passed, 2 failed, 1 ignored. Both failures are **on `main` too**, unmodified, on this GPU — `descriptor::host::tests::dynamic_slots_are_held_until_released` (`assertion failed: heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS`) and `memory::tests::lists_share_a_table_and_copies_keep_their_views` (`past the dynamic slots`). They look like heap-size limits of this adapter rather than anything this PR touches; worth its own issue if nobody has filed it. - The 9 `adapter::tests` pass; they are synthetic `Facts`, no DXGI call, so they also pass on a GPU-less CI runner. **On the software adapter, after the change** `probe()` no longer makes a device on `Microsoft Basic Render Driver`, so the fork's WARP collision Coderlord described should be gone at the source: this path creates no WARP device at all now. What still makes one is `warp_adapter()` itself, which is where an explicit `VICTORY_D3D12_WARP` run goes, and that has not changed. **Overlap with #1483** #1483 adds `high_performance_adapter()` (+45 in `crates/victory-gpu/src/host.rs`) for the same problem: `EnumAdapterByGpuPreference(HIGH_PERFORMANCE)`, first adapter that makes a device, software skipped. That picks the discrete GPU but does not check SM 6.6 or mesh shaders, does not order equal candidates deterministically, and reports nothing when it finds none — where a `D3D12CreateDevice(None, …)` failure names no adapter at all. If #1483 lands first, `adapter::Facts`/`choose` are what its helper should call; if this lands first, #1483 only needs to drop that hunk. Say which you prefer and I will adapt this one — the shader half of #1483 is independent of it, and I have no opinion on which of the two adapter shapes you want. _No game files were used. Tested with AI assistance (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 15:31 UTC · original

Your note — "the selection itself isn't exercised by a test against the real adapters" — is now addressed in 51a79ba.

the_real_enumeration_names_every_adapter_and_never_chooses_software calls enumerate() and then asserts only what holds on any host: every adapter is named in the report, choose never returns a software adapter or one that cannot run the title, and does not pass such an adapter over. It prints the pick, and skips where there is no DXGI adapter.

On a machine that has the awkward set — Intel Arc iGPU plus two indirect display adapters and Oray/MuMu virtual ones:

chose 0 of 4: Intel(R) Arc(TM) Graphics

So the enumeration seen by the real DXGI on this host is four adapters, three of which cannot create an SM 6.6 device, and the choice is the one that can. That is the case the PR exists for, and it now has a test behind it rather than only the synthetic orderings.

Two failures in cargo test -p victory-gpu --lib here (238 passed, 2 failed, 1 ignored) are this host's 1M view-heap cap, not from this change:

  • descriptor::host::tests::dynamic_slots_are_held_until_released — the test #3191 fixes;
  • memory::tests::lists_share_a_table_and_copies_keep_their_views — assert!(pairs.0 >= 1 << 18, "past the dynamic slots") at memory.rs:1030, the same assumption; I have flagged it in #3178 rather than widen this PR.

cargo clippy -p victory-gpu --all-targets -- -D warnings: clean. cargo xtask policy: ok.

Thanks for running it on the RTX 5070 host — the two virtual display adapters there are exactly what made me confident the filter is right.

AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 15:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/967#issuecomment-7196380571) Your note — "the selection itself isn't exercised by a test against the real adapters" — is now addressed in `51a79ba`. `the_real_enumeration_names_every_adapter_and_never_chooses_software` calls `enumerate()` and then asserts only what holds on any host: every adapter is named in the report, `choose` never returns a software adapter or one that cannot run the title, and does not pass such an adapter over. It prints the pick, and skips where there is no DXGI adapter. On a machine that has the awkward set — Intel Arc iGPU **plus two indirect display adapters and Oray/MuMu virtual ones**: ``` chose 0 of 4: Intel(R) Arc(TM) Graphics ``` So the enumeration seen by the real DXGI on this host is four adapters, three of which cannot create an SM 6.6 device, and the choice is the one that can. That is the case the PR exists for, and it now has a test behind it rather than only the synthetic orderings. Two failures in `cargo test -p victory-gpu --lib` here (238 passed, 2 failed, 1 ignored) are this host's 1M view-heap cap, not from this change: - `descriptor::host::tests::dynamic_slots_are_held_until_released` — the test #3191 fixes; - `memory::tests::lists_share_a_table_and_copies_keep_their_views` — `assert!(pairs.0 >= 1 << 18, "past the dynamic slots")` at `memory.rs:1030`, the same assumption; I have flagged it in #3178 rather than widen this PR. `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. `cargo xtask policy`: ok. Thanks for running it on the RTX 5070 host — the two virtual display adapters there are exactly what made me confident the filter is right. _AI-assisted (Claude)._
The seven `choose` tests build their own `Facts`, so nothing ran the real
enumeration — the part that meets a hybrid laptop's integrated GPU or an
indirect display adapter (mercuryVM's review of #967).

`the_real_enumeration_names_every_adapter_and_never_chooses_software` calls
`enumerate()`, then asserts what holds on any host: every adapter appears in
the report, and `choose` never returns a software adapter or one that cannot
run the title, and does not pass one over. It prints the pick and skips where
there is no DXGI adapter.

This machine, which has an Intel Arc iGPU, two indirect display adapters and
Oray/MuMu virtual ones:

  chose 0 of 4: Intel(R) Arc(TM) Graphics

cargo test -p victory-gpu --lib: 238 passed, 2 failed, 1 ignored. Both
failures are this host's view-heap cap and are not from this change: one is
`descriptor::host::tests::dynamic_slots_are_held_until_released`, which #3191
fixes, and the other `memory::tests::lists_share_a_table_and_copies_keep_their_views`
asserts `pairs.0 >= 1 << 18` on the same assumption.

cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/967/head:github-bot/gh-967'
git switch 'github-bot/gh-967'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-967'
git switch 'github-bot/gh-967'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-967'
git switch 'github-bot/gh-967'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-967'
git switch 'main'
git merge --squash 'github-bot/gh-967'
git switch 'main'
git merge --ff-only 'github-bot/gh-967'
git switch 'main'
git merge 'github-bot/gh-967'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/Marvisak--VIctory!967
No description provided.