Skip to content

ggml-webgpu: Windows D3D12 fallback for ShaderF16-lacking primary ada…#21744

Open
MansfieldPlumbing wants to merge 1 commit intoggml-org:masterfrom
MansfieldPlumbing:fix/webgpu-windows-shaderf16-fallback
Open

ggml-webgpu: Windows D3D12 fallback for ShaderF16-lacking primary ada…#21744
MansfieldPlumbing wants to merge 1 commit intoggml-org:masterfrom
MansfieldPlumbing:fix/webgpu-windows-shaderf16-fallback

Conversation

@MansfieldPlumbing
Copy link
Copy Markdown

@MansfieldPlumbing MansfieldPlumbing commented Apr 10, 2026

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

…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.
@MansfieldPlumbing MansfieldPlumbing requested a review from a team as a code owner April 10, 2026 20:58
@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning WebGPU labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant