ggml-webgpu: Windows D3D12 fallback for ShaderF16-lacking primary ada…#21744
Open
MansfieldPlumbing wants to merge 1 commit intoggml-org:masterfrom
Open
ggml-webgpu: Windows D3D12 fallback for ShaderF16-lacking primary ada…#21744MansfieldPlumbing wants to merge 1 commit intoggml-org:masterfrom
MansfieldPlumbing wants to merge 1 commit intoggml-org:masterfrom
Conversation
…pters On Windows with mixed GPU configs (e.g. primary display on Pascal NVIDIA, compute on AMD Vega), Dawn's default HighPerformance adapter selection picks the display GPU. If that GPU lacks ShaderF16, the backend asserts and crashes. This patch adds a generic DXGI enumeration fallback that selects the first available adapter supporting ShaderF16. Also fixes DXC library loading by resolving dxil.dll and dxcompiler.dll from the executable directory before Dawn's restricted LoadLibraryEx search path runs, preventing silent FXC fallback and the associated performance regression. Tested on: AMD Radeon Pro V340 (gfx901) + NVIDIA Quadro P2000, Windows 11, D3D12 driver 26.20.11016.1. Baseline: 20.40 t/s pp512 on Qwen3.5-9B-Q3_K_S.
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.
Overview
On Windows with mixed GPU configs (e.g. primary display on Pascal NVIDIA,
compute on AMD Vega/RDNA), Dawn's HighPerformance adapter selection picks
the display GPU. If that GPU lacks ShaderF16, the backend asserts and crashes.
Adds a generic DXGI enumeration fallback: if the default adapter lacks
ShaderF16, enumerate all adapters and bind to the first that supports it,
logging the adapter name. No hardcoded device strings.
Also fixes DXC loading by resolving dxil.dll and dxcompiler.dll from the
executable directory before Dawn's restricted LoadLibraryEx runs, preventing
silent FXC fallback and associated performance regression.
Tested: AMD Radeon Pro V340 (gfx901, D3D12 FL 12_1) + NVIDIA Quadro P2000
(no ShaderF16), driver 26.20.11016.1, Windows 10 IoT LTSC.
Baseline: 20.40 t/s pp512, Qwen3.5-9B-Q3_K_S.
Additional information
Requirements
I have read and agree with the contributing guidelines
AI usage disclosure: YES - used Claude to generalize the adapter enumeration logic from a device-specific prototype to a generic ShaderF16 fallback