Fall back to the system D3D12 runtime when the Agility SDK device factory cannot create a device - #1
Conversation
…tory cannot create a device The Agility SDK device factory path in CreateDmlObjects throws on any CreateDevice failure instead of reaching the existing system-runtime fallback branch. A known failure is DXGI_ERROR_ALREADY_EXISTS (0x887A0036): the process already holds a D3D12 device created with the system runtime (e.g. the XAML/WinUI compositor in a packaged app), and devices from different D3D12 runtimes cannot coexist in one process. Whether this path fails is OS-dependent: on systems whose in-box D3D12 is older than the requested SDK version, CreateDeviceFactory fails and the fallback already runs; an OS update silently flips the branch and breaks model load. Treat a factory CreateDevice failure like a factory creation failure: log a warning with the HRESULT and fall back to D3D12CreateDevice. Validated on Xbox Series S (Dev Mode UWP, OS 26100): a XAML app calling OgaCreateModel with the DML EP failed with 887A0036 before this change and loads and runs correctly through the fallback with it.
Address review feedback on microsoft#2280: the diagnostic strings hardcoded 1.614.0 while the factory used the agility_sdk_version constant, so the two could drift apart when the SDK is updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152PPkDwULuMR9hshirPXQx
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded: this fix landed upstream in microsoft#2280 (merged 2026-07-13). Closing the fork staging PR. |
The Agility SDK device factory path in CreateDmlObjects throws on any
CreateDevice failure instead of reaching the existing system-runtime
fallback branch. A known failure is DXGI_ERROR_ALREADY_EXISTS
(0x887A0036): the process already holds a D3D12 device created with the
system runtime (e.g. the XAML/WinUI compositor in a packaged app), and
devices from different D3D12 runtimes cannot coexist in one process.
Whether this path fails is OS-dependent: on systems whose in-box D3D12
is older than the requested SDK version, CreateDeviceFactory fails and
the fallback already runs; an OS update silently flips the branch and
breaks model load.
Treat a factory CreateDevice failure like a factory creation failure:
log a warning with the HRESULT and fall back to D3D12CreateDevice.
Validated on Xbox Series S (Dev Mode UWP, OS 26100): a XAML app calling
OgaCreateModel with the DML EP failed with 887A0036 before this change
and loads and runs correctly through the fallback with it.