Repository navigation
Conversation
zAcherttp
force-pushed
the
windows-gpu-choice
branch
from
October 31, 2026 03:29
ec4a000 to
dc7f5e2
Compare
Rune took the lowest-power adapter, so a desktop with an integrated GPU and a discrete card driving the monitor drew on the integrated one and copied every frame across, on Vulkan. Windows now takes the card DXGI lists first (the GPU set for the app in Settings > Display > Graphics, else the system default), then that card's DX12 adapter before Vulkan. WGPU_ADAPTER_NAME and WGPU_POWER_PREF still choose the card; WGPU_BACKEND now limits the backends. translucency::prefer breaks ties by the same backend order. The immediates upload test wraps its immediate in a struct: wgpu's HLSL backend rejects non-struct immediates (gfx-rs/wgpu#5683). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading the order through wgpu's DX12 enumeration opened a device on every card, and the pick then listed every backend again, which also opens each card's Vulkan device: 350-400 ms more before the window could open on a two-GPU desktop. The order now comes from DXGI's EnumAdapters1 (about 17 ms, via windows 0.62, which wgpu-hal already builds), and the card's adapter is looked up on DX12 alone before every backend. hello, device ready after process start, median of 7: 886/954 ms on dev, 887/927 ms with this. RUNE_GPU_LOG=1 now prints that time on Windows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every pick on Windows already lands on DX12 (by_card takes it first), but the instance still loaded Vulkan's driver, which costs a launch about 145 ms. With a hardware card and no WGPU_BACKEND, the instance is now DX12 only; WGPU_BACKEND=vulkan still runs on Vulkan. A D3D12 support probe would cost about 230 ms, and every Windows GPU with a Vulkan driver ships a D3D12 one, so there is none. hello, device ready after process start, median of 9 alternating runs: 972 ms with DX12 and Vulkan loaded, 826 ms with DX12 alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zAcherttp
force-pushed
the
windows-gpu-choice
branch
from
October 31, 2026 05:56
dc7f5e2 to
2f6ab83
Compare
Member
|
thanks for this. rune is agent-driven, so we don't take pull requests. if you'd like a change or a bug fixed, have your agent open an issue describing it (https://github.com/anomalyco/rune/issues) and our agents will pick it up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows: take the GPU Windows chooses for the app, on DX12
On a Windows desktop with an integrated GPU and a discrete card driving the monitor, Rune draws on the integrated GPU and copies every frame across. It also lands on Vulkan, so the DirectComposition path #31 set up for DX12 never runs for an opaque window. On an Intel UHD 730 + RTX 4070 machine (240 Hz monitor on the RTX),
hello:devResizedto drawn, median)surface.configureThe
configuretime on the integrated GPU isn't a vsync wait: withImmediatepresents it stays at 30–35 ms, so rebuilding a swapchain there for a monitor the RTX drives costs that much. Resize times come from a size-move-loop trace on a local branch, run with that branch's own resize changes switched off (RUNE_WIN_SYNC_RESIZE=0,RUNE_WIN_RESIZE_OVERSIZE=0), so both columns redraw afterResizedwith vsync, asdevdoes.Why
The compositor match in
gpu::pickis Linux-only, so Windows falls back torequest_adapter(LowPower), which takes whichever backend lists the integrated GPU first. #31 works around this for translucent surfaces (translucency::prefer); opaque windows keep the low-power pick.Fix
WGPU_ADAPTER_NAME,WGPU_POWER_PREFand the compositor match, Windows takes the card DXGI lists first: the GPU set for the app in Settings > Display > Graphics, else the system default. A laptop whose panel runs off its integrated GPU keeps it.translucency::preferbreaks ties the same way.EnumAdapters1(about 17 ms, throughwindows0.62, which wgpu-hal already builds). Reading it through wgpu's DX12 enumeration opened a device on every card and added 350–400 ms before the window opened.Gpu::instanceloads DX12 alone, so Vulkan's driver no longer loads at launch (the 146 ms above).WGPU_BACKEND(dx12,vulkan) now limits the backends, andWGPU_BACKEND=vulkanis the way back. There's no D3D12 support probe: it costs about 230 ms, and every Windows GPU with a Vulkan driver ships a D3D12 one. This is separate fromRUNE_GPU_BACKEND, which picks wgpu or Metal.a_device_asked_for_immediates_draws_with_themwraps its immediate in a struct, which wgpu's HLSL backend needs (Push constant of non-struct type fails to compile on DX12 gfx-rs/wgpu#5683).House rules: changelog fragment
changelog/unreleased/2026-10-30-windows-gpu-choice.md;scripts/file-size.shpasses (0 errors); rebased on currentdev. This touches the same sort key intranslucency::preferas #39; I'll rebase on whichever lands first.Testing
On the machine above:
RUNE_GPU_LOG=1 cargo run -p hellopicks the RTX on DX12 by default, the RTX on Vulkan withWGPU_BACKEND=vulkan, and the Intel GPU on DX12 withWGPU_POWER_PREF=loworWGPU_ADAPTER_NAME=intel.RUNE_GPU_LOG=1now also prints how long after process start the device was ready.WGPU_BACKEND=dx12,vulkan. Before the DX12-only instance, launch matcheddev(887/927 against 886/954 ms).cargo test -p rune --lib: 1267 pass and 10 fail. 7 fail the same way ondevhere:edit::tests::hidden_multiline_pristine_replace_and_delete,keycaps::tests::repeated_chords_count_and_named_keys_use_glyphs,render::metallib::tests::precompiled_uber_metallib_is_fresh, bothtext::tests::emoji_*, and bothvideo::tests. 3 pixel-exact layer tests fail on the RTX with either backend and pass on the integrated GPUdevpicks:cache_matches_uncached_at_rest_and_skips_rerasterize_on_ancestor_live_offset,filtered_video_and_image_page_match_primitive_sourceandclipped_single_draw_fades_do_not_allocate_targets.Not tested on AMD. #31's PC (RTX 5070 Ti + AMD Radeon integrated) is the case to check:
RUNE_GPU_LOG=1 cargo run -p overlayshould name the GPU you expect onDx12, with clear corners rather than black ones, and an opaque window should land on the card driving the monitor.🤖 Generated with Claude Code