Skip to content

Fall back to the system D3D12 runtime when the Agility SDK device factory cannot create a device - #1

Closed
gianlucamazza wants to merge 3 commits into
mainfrom
claude/onnxruntime-genai-pr-review-ucwwx0
Closed

Fall back to the system D3D12 runtime when the Agility SDK device factory cannot create a device#1
gianlucamazza wants to merge 3 commits into
mainfrom
claude/onnxruntime-genai-pr-review-ucwwx0

Conversation

@gianlucamazza

Copy link
Copy Markdown
Owner

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.

gianlucamazza and others added 3 commits July 7, 2026 21:01
…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
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@gianlucamazza, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 097b6422-1465-4693-9f9f-4bce4b224c25

📥 Commits

Reviewing files that changed from the base of the PR and between 131d99f and 0074a87.

📒 Files selected for processing (1)
  • src/dml/dml_helpers.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/onnxruntime-genai-pr-review-ucwwx0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gianlucamazza

Copy link
Copy Markdown
Owner Author

Superseded: this fix landed upstream in microsoft#2280 (merged 2026-07-13). Closing the fork staging PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants