gpu: select high-performance hardware adapter on multi-GPU systems #3071

Open
AdvaitPalve11 wants to merge 3 commits from upstream-pr/3073 into main
AdvaitPalve11 commented 2026-11-26 06:26:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AdvaitPalve11 on 2026-11-26T06:26:14Z.


On hybrid laptops and multi-GPU systems, passing None to D3D12CreateDevice defaults to the display adapter (often integrated Intel/AMD graphics) instead of the discrete high-performance GPU (NVIDIA/AMD), leading to shader/pipeline failures and memory limits.

  • Query IDXGIFactory6::EnumAdapterByGpuPreference with DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE to select discrete GPU.

  • Fall back to enumerating non-software adapters by largest dedicated video memory.

  • Support optional VICTORY_D3D12_ADAPTER= for explicit adapter filtering.

  • Add unit tests verifying adapter description parsing and software adapter exclusion.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5505151586 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073). Originally posted by [AdvaitPalve11](https://github.com/AdvaitPalve11) on 2026-11-26T06:26:14Z. --- On hybrid laptops and multi-GPU systems, passing None to D3D12CreateDevice defaults to the display adapter (often integrated Intel/AMD graphics) instead of the discrete high-performance GPU (NVIDIA/AMD), leading to shader/pipeline failures and memory limits. - Query IDXGIFactory6::EnumAdapterByGpuPreference with DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE to select discrete GPU. - Fall back to enumerating non-software adapters by largest dedicated video memory. - Support optional VICTORY_D3D12_ADAPTER=<name> for explicit adapter filtering. - Add unit tests verifying adapter description parsing and software adapter exclusion.
kotekompotek commented 2026-11-26 06:34:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T06:34:51Z.

Review: APPROVED


Verified: env substring filter uses full enum (user's explicit choice, even software); GpuPreference enum skips SOFTWARE flag so WARP is never picked implicitly; VRAM-max fallback also skips software; device-creation failure on the chosen adapter warns and falls back to default with tdr::log() preserved in both branches; WARP env keeps priority. adapter_name handles missing terminator.

<!-- greyfinch-sync:Marvisak/VIctory:review:6069556101 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#pullrequestreview-6069556101). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T06:34:51Z. **Review:** APPROVED --- Verified: env substring filter uses full enum (user's explicit choice, even software); GpuPreference enum skips SOFTWARE flag so WARP is never picked implicitly; VRAM-max fallback also skips software; device-creation failure on the chosen adapter warns and falls back to default with tdr::log() preserved in both branches; WARP env keeps priority. adapter_name handles missing terminator.
fuzeofficlal commented 2026-11-26 08:25:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T08:25:38Z.

Review: CHANGES_REQUESTED


Tested on a dual-GPU Windows 11 system (NVIDIA GeForce RTX 5090 0x10de + AMD Radeon(TM) Graphics 0x1002 + WARP):

  • Default (unset), VICTORY_D3D12_ADAPTER="RTX 5090", and an unmatched filter (nonexistent_gpu_xyz) all select NVIDIA GeForce RTX 5090.
  • VICTORY_D3D12_ADAPTER=Radeon selects AMD Radeon(TM) Graphics and genuinely switches the host D3D12 device end-to-end (confirmed by running present_compositor_builds_both_pipeline_states and dynamic_slots_are_held_until_released, which passes on the AMD iGPU's >1M descriptor heap while failing on NVIDIA's 1M cap).
  • VICTORY_D3D12_WARP=1 (--features diagnostics) still takes precedence via warp_adapter(), and video_memory() already queries device.GetAdapterLuid(), so VRAM reporting follows the selected adapter automatically.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (default and --all-features) and cargo xtask policy are clean.

A few small issues showed up during source review and testing that should be addressed before merging:

1. VICTORY_D3D12_ADAPTER does not ignore empty/whitespace values or skip software adapters (crates/victory-gpu/src/host.rs:46-60)

  • If VICTORY_D3D12_ADAPTER is set to "" or whitespace (e.g., from a launcher/wrapper script), name.to_lowercase().contains(&filter_lower) matches EnumAdapters1(0) unconditionally — on hybrid laptops where adapter 0 is the iGPU, that silently bypasses DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE. Please .trim() the value and ignore it when empty.
  • The VICTORY_D3D12_ADAPTER loop also doesn't skip DXGI_ADAPTER_FLAG_SOFTWARE. Testing VICTORY_D3D12_ADAPTER=Basic returns Microsoft Basic Render Driver (vendor=0x1414, flags=0x2), logs "selected hardware adapter via VICTORY_D3D12_ADAPTER", bypasses the diagnostics-only gate on VICTORY_D3D12_WARP=1, and makes this PR's own hardware_adapter_selects_non_software test panic (left: 2, right: 0). Skipping DXGI_ADAPTER_FLAG_SOFTWARE here keeps the function consistent with its name, log message, and unit test.

2. Probe D3D12 FEATURE_LEVEL_12_0 support before returning a candidate (crates/victory-gpu/src/host.rs:16-24, 63-105)

hardware_adapter() returns the first non-software adapter without probing D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, std::ptr::null_mut::<Option<ID3D12Device>>()).is_ok(). If the first enumerated hardware adapter lacks D3D12 FL 12.0 support (or is a virtual/headless display driver that rejects device creation), create() immediately falls back to D3D12CreateDevice(None, ...) instead of continuing to the next hardware adapter in the IDXGIFactory6 / VRAM-fallback loops.

3. README.md table placement (README.md:215)

VICTORY_D3D12_ADAPTER=<name> is currently added inside the --features victory-gpu/diagnostics table next to VICTORY_D3D12_WARP=1, even though host.rs honors it in all builds. Please move it to the always-available environment variables section above (around lines 155-166), or explicitly note that it does not require diagnostics.

<!-- greyfinch-sync:Marvisak/VIctory:review:6070655696 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#pullrequestreview-6070655696). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T08:25:38Z. **Review:** CHANGES_REQUESTED --- Tested on a dual-GPU Windows 11 system (`NVIDIA GeForce RTX 5090` `0x10de` + `AMD Radeon(TM) Graphics` `0x1002` + WARP): - Default (unset), `VICTORY_D3D12_ADAPTER="RTX 5090"`, and an unmatched filter (`nonexistent_gpu_xyz`) all select `NVIDIA GeForce RTX 5090`. - `VICTORY_D3D12_ADAPTER=Radeon` selects `AMD Radeon(TM) Graphics` and genuinely switches the host D3D12 device end-to-end (confirmed by running `present_compositor_builds_both_pipeline_states` and `dynamic_slots_are_held_until_released`, which passes on the AMD iGPU's >1M descriptor heap while failing on NVIDIA's 1M cap). - `VICTORY_D3D12_WARP=1` (`--features diagnostics`) still takes precedence via `warp_adapter()`, and `video_memory()` already queries `device.GetAdapterLuid()`, so VRAM reporting follows the selected adapter automatically. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`) and `cargo xtask policy` are clean. A few small issues showed up during source review and testing that should be addressed before merging: ### 1. `VICTORY_D3D12_ADAPTER` does not ignore empty/whitespace values or skip software adapters (`crates/victory-gpu/src/host.rs:46-60`) - If `VICTORY_D3D12_ADAPTER` is set to `""` or whitespace (e.g., from a launcher/wrapper script), `name.to_lowercase().contains(&filter_lower)` matches `EnumAdapters1(0)` unconditionally — on hybrid laptops where adapter 0 is the iGPU, that silently bypasses `DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE`. Please `.trim()` the value and ignore it when empty. - The `VICTORY_D3D12_ADAPTER` loop also doesn't skip `DXGI_ADAPTER_FLAG_SOFTWARE`. Testing `VICTORY_D3D12_ADAPTER=Basic` returns `Microsoft Basic Render Driver` (`vendor=0x1414, flags=0x2`), logs `"selected hardware adapter via VICTORY_D3D12_ADAPTER"`, bypasses the `diagnostics`-only gate on `VICTORY_D3D12_WARP=1`, and makes this PR's own `hardware_adapter_selects_non_software` test panic (`left: 2, right: 0`). Skipping `DXGI_ADAPTER_FLAG_SOFTWARE` here keeps the function consistent with its name, log message, and unit test. ### 2. Probe D3D12 `FEATURE_LEVEL_12_0` support before returning a candidate (`crates/victory-gpu/src/host.rs:16-24, 63-105`) `hardware_adapter()` returns the first non-software adapter without probing `D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, std::ptr::null_mut::<Option<ID3D12Device>>()).is_ok()`. If the first enumerated hardware adapter lacks D3D12 FL 12.0 support (or is a virtual/headless display driver that rejects device creation), `create()` immediately falls back to `D3D12CreateDevice(None, ...)` instead of continuing to the next hardware adapter in the `IDXGIFactory6` / VRAM-fallback loops. ### 3. `README.md` table placement (`README.md:215`) `VICTORY_D3D12_ADAPTER=<name>` is currently added inside the `--features victory-gpu/diagnostics` table next to `VICTORY_D3D12_WARP=1`, even though `host.rs` honors it in all builds. Please move it to the always-available environment variables section above (around lines 155-166), or explicitly note that it does not require `diagnostics`.
Marvisak commented 2026-11-26 09:06:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T08:23:31Z.


Automated triage for the maintainers.

Verdict: needs work. Choosing the discrete GPU on hybrid machines could be useful, but hardware_adapter in crates/victory-gpu/src/host.rs changes which device every non-WARP run gets, and the PR gives no run showing the problem or the fix.

What it needs:

  • Evidence: a log from a multi-GPU machine showing that D3D12CreateDevice(None, …) lands on the integrated GPU, and that this change picks the discrete one and the title runs there.
  • Respect the user's choice: EnumAdapterByGpuPreference(HIGH_PERFORMANCE) may override the GPU the user picked for the exe in Windows' per-app graphics settings. Either keep the default adapter unless asked (the VICTORY_D3D12_ADAPTER filter, or an opt-in switch), or show that per-app settings still apply.
  • Tests: hardware_adapter_selects_non_software only checks what the function itself filters for, and it does nothing on machines where nothing is returned. If VICTORY_D3D12_ADAPTER is set and matches the software adapter, it fails. A test that checks the selection order on a fixed list of adapter descriptions would be more useful.
  • The fallback that ranks by dedicated memory repeats victory-shader's emit::host::hardware_adapter with different rules. One rule for both would keep the translator's checks and the runtime on the same adapter.

CI: check passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7186537482 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#issuecomment-7186537482). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T08:23:31Z. --- <!-- victory-triage v1 head=98253adb64421081b31c42a9afb7120e7324fdb1 verdict=needs-work at=2026-11-26T08:18:50Z --> Automated triage for the maintainers. **Verdict: needs work.** Choosing the discrete GPU on hybrid machines could be useful, but `hardware_adapter` in `crates/victory-gpu/src/host.rs` changes which device every non-WARP run gets, and the PR gives no run showing the problem or the fix. What it needs: - **Evidence:** a log from a multi-GPU machine showing that `D3D12CreateDevice(None, …)` lands on the integrated GPU, and that this change picks the discrete one and the title runs there. - **Respect the user's choice:** `EnumAdapterByGpuPreference(HIGH_PERFORMANCE)` may override the GPU the user picked for the exe in Windows' per-app graphics settings. Either keep the default adapter unless asked (the `VICTORY_D3D12_ADAPTER` filter, or an opt-in switch), or show that per-app settings still apply. - **Tests:** `hardware_adapter_selects_non_software` only checks what the function itself filters for, and it does nothing on machines where nothing is returned. If `VICTORY_D3D12_ADAPTER` is set and matches the software adapter, it fails. A test that checks the selection order on a fixed list of adapter descriptions would be more useful. - The fallback that ranks by dedicated memory repeats `victory-shader`'s `emit::host::hardware_adapter` with different rules. One rule for both would keep the translator's checks and the runtime on the same adapter. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
smaxxey commented 2026-11-26 11:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by smaxxey on 2026-11-26T10:13:26Z.


Evidence from a hybrid laptop, which the triage asked for: i7-13620H with an RTX 4060 Laptop GPU and Intel UHD, Windows 11 26300, Rust 1.98.1. No game files.

  • DXGI's EnumAdapters1 order here: 0 = RTX 4060 Laptop GPU, 1 = Intel UHD Graphics, 2 = Microsoft Basic Render Driver. The only active output, \\.\DISPLAY5 (the primary, at 0,0), is on the RTX 4060; the Intel adapter has no outputs. So on main, D3D12CreateDevice(None, …) already lands on the RTX here.
  • With this PR (head 98253ad merged locally onto main 63bcca4), hardware_adapter() picks the same one: hardware_adapter: description=NVIDIA GeForce RTX 4060 Laptop GPU, vendor=0x10de, flags=0x0.
  • #1132 reports the same CPU and GPU pair with the Intel UHD as adapter 0. DXGI lists first the adapter whose output holds the desktop's primary display, so whether main lands on the iGPU depends on which GPU drives the primary display, not on the machine model.
  • cargo test -p victory-gpu --lib --locked with this PR: 231 passed, 2 failed, same as main 63bcca4 on this card: only the two NVIDIA failures of #1835 (descriptor::host::tests::dynamic_slots_are_held_until_released, memory::tests::lists_share_a_table_and_copies_keep_their_views), nothing new.

Not shown by this run: the iGPU-first case itself, which this machine is not in right now.

Tested with Claude Code's help.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189073769 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#issuecomment-7189073769). Originally posted by [smaxxey](https://github.com/smaxxey) on 2026-11-26T10:13:26Z. --- Evidence from a hybrid laptop, which the triage asked for: i7-13620H with an **RTX 4060 Laptop GPU** and Intel UHD, Windows 11 26300, Rust 1.98.1. No game files. - DXGI's `EnumAdapters1` order here: 0 = RTX 4060 Laptop GPU, 1 = Intel UHD Graphics, 2 = Microsoft Basic Render Driver. The only active output, `\\.\DISPLAY5` (the primary, at 0,0), is on the RTX 4060; the Intel adapter has no outputs. So on `main`, `D3D12CreateDevice(None, …)` already lands on the RTX here. - With this PR (head `98253ad` merged locally onto `main` 63bcca4), `hardware_adapter()` picks the same one: `hardware_adapter: description=NVIDIA GeForce RTX 4060 Laptop GPU, vendor=0x10de, flags=0x0`. - #1132 reports the same CPU and GPU pair with the Intel UHD as adapter 0. DXGI lists first the adapter whose output holds the desktop's primary display, so whether `main` lands on the iGPU depends on which GPU drives the primary display, not on the machine model. - `cargo test -p victory-gpu --lib --locked` with this PR: 231 passed, 2 failed, same as `main` 63bcca4 on this card: only the two NVIDIA failures of #1835 (`descriptor::host::tests::dynamic_slots_are_held_until_released`, `memory::tests::lists_share_a_table_and_copies_keep_their_views`), nothing new. Not shown by this run: the iGPU-first case itself, which this machine is not in right now. Tested with Claude Code's help.
AdvaitPalve11 commented 2026-11-26 16:32:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AdvaitPalve11 on 2026-11-26T16:32:37Z.


Thanks for the thorough review and testing! I've updated the PR (commit 710c326) to address all review comments and triage items:

  1. VICTORY_D3D12_ADAPTER string handling & software rejection:

    • The filter string is now trimmed (.trim()) and ignored if empty or whitespace-only, avoiding unconditional matching on adapter 0.
    • Enforced desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE == 0 within the filter loop so software adapters like Microsoft Basic Render Driver are never returned as a hardware adapter.
  2. D3D12 Feature Level 12.0 probing:

    • Added supports_d3d12() to probe D3D12CreateDevice(..., D3D_FEATURE_LEVEL_12_0, NULL) across all candidate loops (substring filter, EnumAdapterByGpuPreference, and VRAM fallback). If an enumerated adapter lacks FL 12.0 or is a virtual adapter that rejects device creation, enumeration continues to the next hardware adapter instead of aborting.
  3. Harmonized fallback rule:

    • Aligned the dedicated VRAM fallback with victory-shader's emit::host::hardware_adapter (desc.DedicatedVideoMemory > 0).
  4. Deterministic unit tests:

    • Added unit test select_adapter_fixed_list_rules testing candidate filtering, whitespace trimming, software adapter rejection, and VRAM ranking against a mock list of adapter descriptions without requiring physical hardware.
  5. README.md placement:

    • Moved VICTORY_D3D12_ADAPTER from the --features diagnostics table to the general environment variables section since it is honored in all builds.

Regarding hybrid laptop evidence:

  • On hybrid systems where the internal display is wired through the integrated GPU (such as the i7-13620H + RTX 4060 configuration reported in #1132), DXGI assigns adapter index 0 to the iGPU because it owns the primary desktop output \\.\DISPLAY1. D3D12CreateDevice(None, ...) selects adapter 0 by default, forcing the title onto the iGPU unless hardware_adapter() queries EnumAdapterByGpuPreference(HIGH_PERFORMANCE).
  • When users configure an explicit GPU choice in Windows' per-app Graphics Settings (Settings > System > Display > Graphics), DXGI's EnumAdapterByGpuPreference respects those preferences.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7197782074 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#issuecomment-7197782074). Originally posted by [AdvaitPalve11](https://github.com/AdvaitPalve11) on 2026-11-26T16:32:37Z. --- Thanks for the thorough review and testing! I've updated the PR (commit `710c326`) to address all review comments and triage items: 1. **`VICTORY_D3D12_ADAPTER` string handling & software rejection:** - The filter string is now trimmed (`.trim()`) and ignored if empty or whitespace-only, avoiding unconditional matching on adapter 0. - Enforced `desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE == 0` within the filter loop so software adapters like Microsoft Basic Render Driver are never returned as a hardware adapter. 2. **D3D12 Feature Level 12.0 probing:** - Added `supports_d3d12()` to probe `D3D12CreateDevice(..., D3D_FEATURE_LEVEL_12_0, NULL)` across all candidate loops (substring filter, `EnumAdapterByGpuPreference`, and VRAM fallback). If an enumerated adapter lacks FL 12.0 or is a virtual adapter that rejects device creation, enumeration continues to the next hardware adapter instead of aborting. 3. **Harmonized fallback rule:** - Aligned the dedicated VRAM fallback with `victory-shader`'s `emit::host::hardware_adapter` (`desc.DedicatedVideoMemory > 0`). 4. **Deterministic unit tests:** - Added unit test `select_adapter_fixed_list_rules` testing candidate filtering, whitespace trimming, software adapter rejection, and VRAM ranking against a mock list of adapter descriptions without requiring physical hardware. 5. **`README.md` placement:** - Moved `VICTORY_D3D12_ADAPTER` from the `--features diagnostics` table to the general environment variables section since it is honored in all builds. Regarding hybrid laptop evidence: - On hybrid systems where the internal display is wired through the integrated GPU (such as the i7-13620H + RTX 4060 configuration reported in #1132), DXGI assigns adapter index 0 to the iGPU because it owns the primary desktop output `\\.\DISPLAY1`. `D3D12CreateDevice(None, ...)` selects adapter 0 by default, forcing the title onto the iGPU unless `hardware_adapter()` queries `EnumAdapterByGpuPreference(HIGH_PERFORMANCE)`. - When users configure an explicit GPU choice in Windows' per-app Graphics Settings (*Settings > System > Display > Graphics*), DXGI's `EnumAdapterByGpuPreference` respects those preferences.
fuzeofficlal commented 2026-11-26 18:11:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T18:11:56Z.

Review: APPROVED


All previous review items are resolved in 710c326 — approving to clear the earlier change request.

Re-verified merged onto main (63bcca43) on a dual-GPU Windows 11 system (NVIDIA GeForce RTX 5090 0x10de + AMD Radeon(TM) Graphics 0x1002 + WARP):

  • cargo xtask policy (191 files ok), cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features), and all 4 adapter unit tests (adapter_name_handles_null_terminator, hardware_adapter_selects_non_software, select_adapter_fixed_list_rules, warp_adapter_accepts_only_software) pass.
  • VICTORY_D3D12_ADAPTER live matrix across fresh processes:
    • Unset, "", " ", " rtx 5090 ", and "nonexistent_gpu_xyz" all select NVIDIA GeForce RTX 5090 (0x10de, flags=0x0).
    • "Basic" now skips Microsoft Basic Render Driver (DXGI_ADAPTER_FLAG_SOFTWARE) and falls back to NVIDIA GeForce RTX 5090 (flags=0x0), fixing the previous panic.
    • "Radeon" selects AMD Radeon(TM) Graphics (0x1002, flags=0x0) and passes end-to-end D3D12 device tests (present_compositor_builds_both_pipeline_states, read_marks_of_both_bitmaps_are_taken) on the AMD iGPU.
    • VICTORY_D3D12_WARP=1 (--features diagnostics) still takes priority even when VICTORY_D3D12_ADAPTER=Radeon is set.
  • supports_d3d12() (crates/victory-gpu/src/host.rs:399) probes D3D_FEATURE_LEVEL_12_0 across all three selection loops, and README.md:166-168 now documents VICTORY_D3D12_ADAPTER outside the diagnostics-only table.
<!-- greyfinch-sync:Marvisak/VIctory:review:6078825914 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#pullrequestreview-6078825914). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T18:11:56Z. **Review:** APPROVED --- All previous review items are resolved in `710c326` — approving to clear the earlier change request. Re-verified merged onto `main` (`63bcca43`) on a dual-GPU Windows 11 system (`NVIDIA GeForce RTX 5090` `0x10de` + `AMD Radeon(TM) Graphics` `0x1002` + WARP): - `cargo xtask policy` (`191 files ok`), `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`), and all 4 adapter unit tests (`adapter_name_handles_null_terminator`, `hardware_adapter_selects_non_software`, `select_adapter_fixed_list_rules`, `warp_adapter_accepts_only_software`) pass. - `VICTORY_D3D12_ADAPTER` live matrix across fresh processes: - Unset, `""`, `" "`, `" rtx 5090 "`, and `"nonexistent_gpu_xyz"` all select `NVIDIA GeForce RTX 5090` (`0x10de, flags=0x0`). - `"Basic"` now skips `Microsoft Basic Render Driver` (`DXGI_ADAPTER_FLAG_SOFTWARE`) and falls back to `NVIDIA GeForce RTX 5090` (`flags=0x0`), fixing the previous panic. - `"Radeon"` selects `AMD Radeon(TM) Graphics` (`0x1002, flags=0x0`) and passes end-to-end D3D12 device tests (`present_compositor_builds_both_pipeline_states`, `read_marks_of_both_bitmaps_are_taken`) on the AMD iGPU. - `VICTORY_D3D12_WARP=1` (`--features diagnostics`) still takes priority even when `VICTORY_D3D12_ADAPTER=Radeon` is set. - `supports_d3d12()` (`crates/victory-gpu/src/host.rs:399`) probes `D3D_FEATURE_LEVEL_12_0` across all three selection loops, and `README.md:166-168` now documents `VICTORY_D3D12_ADAPTER` outside the diagnostics-only table.
upipibi commented 2026-11-28 03:44:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T03:44:09Z.


For whoever picks between them: five open PRs change how the host adapter is chosen. Read from the diffs, not run.

PR What it does State
#2371 (antikohza, fixes #1226) EnumAdapterByGpuPreference(HIGH_PERFORMANCE), first hardware adapter with FL 12.0 triage: merge candidate
#2367 (PanS4ge) the same preference, plus a VICTORY_ADAPTER override, and logs the GPU mergeable
this PR (#3073) the same preference with dedicated-memory checks, plus a VICTORY_D3D12_ADAPTER filter triage: needs work
#2053 (rminzao) only logs the host GPU and warns when it isn't the high-performance one mergeable
#1483 (spy0eye-beep) the same preference, bundled with shader-lowering fixes conflicting

Two things that follow:

  • The override switch. #2367 and this PR add the same override under two names (VICTORY_ADAPTER against VICTORY_D3D12_ADAPTER). Only one should land.
  • The field data. smaxxey's laptop above lists the RTX 4060 Laptop GPU first, so the default adapter is right there. ZigZagBoi1/ScarlettPort#274, from another VIctory-derived tree, is the opposite case: on an Optimus laptop the default adapter was the Intel iGPU, and the device was made there despite the Windows high-performance preference. They fixed it with the same high-performance enumeration (ScarlettPort#292). So the order differs from laptop to laptop, and the preference call is what makes it right on both.

AI-assisted (Claude Code, Claude Opus 5.5 read the five diffs).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7233328922 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3073#issuecomment-7233328922). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T03:44:09Z. --- For whoever picks between them: five open PRs change how the host adapter is chosen. Read from the diffs, not run. | PR | What it does | State | |---|---|---| | #2371 (antikohza, fixes #1226) | `EnumAdapterByGpuPreference(HIGH_PERFORMANCE)`, first hardware adapter with FL 12.0 | triage: merge candidate | | #2367 (PanS4ge) | the same preference, plus a `VICTORY_ADAPTER` override, and logs the GPU | mergeable | | this PR (#3073) | the same preference with dedicated-memory checks, plus a `VICTORY_D3D12_ADAPTER` filter | triage: needs work | | #2053 (rminzao) | only logs the host GPU and warns when it isn't the high-performance one | mergeable | | #1483 (spy0eye-beep) | the same preference, bundled with shader-lowering fixes | conflicting | Two things that follow: - **The override switch.** #2367 and this PR add the same override under two names (`VICTORY_ADAPTER` against `VICTORY_D3D12_ADAPTER`). Only one should land. - **The field data.** smaxxey's laptop above lists the RTX 4060 Laptop GPU first, so the default adapter is right there. ZigZagBoi1/ScarlettPort#274, from another VIctory-derived tree, is the opposite case: on an Optimus laptop the default adapter was the Intel iGPU, and the device was made there despite the Windows high-performance preference. They fixed it with the same high-performance enumeration (ScarlettPort#292). So the order differs from laptop to laptop, and the preference call is what makes it right on both. AI-assisted (Claude Code, Claude Opus 5.5 read the five diffs).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3073:upstream-pr/3073'
git switch 'upstream-pr/3073'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3073'
git switch 'upstream-pr/3073'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3073'
git switch 'upstream-pr/3073'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3073'
git switch 'main'
git merge --squash 'upstream-pr/3073'
git switch 'main'
git merge --ff-only 'upstream-pr/3073'
git switch 'main'
git merge 'upstream-pr/3073'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3071
No description provided.