From 43519e853ec36d7747ec81bb0cd67641dfba1d08 Mon Sep 17 00:00:00 2001 From: "Gordon Lam (SH)" Date: Mon, 13 Apr 2026 16:10:10 +0800 Subject: [PATCH] Add error code reference for EP registration results Documents possible ExecutionProviderReadyResultState values beyond just Success, with handling guidance. Fixes ADO #61791058 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/new-windows-ml/initialize-execution-providers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/new-windows-ml/initialize-execution-providers.md b/docs/new-windows-ml/initialize-execution-providers.md index 4f44118b..22660f3c 100644 --- a/docs/new-windows-ml/initialize-execution-providers.md +++ b/docs/new-windows-ml/initialize-execution-providers.md @@ -239,6 +239,15 @@ installed = result.status == winml.ExecutionProviderReadyResultState.SUCCESS --- +### Handling installation results + +The [ExecutionProviderReadyResult](/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.machinelearning.executionproviderreadyresult) returned by `EnsureReadyAsync()` includes a [Status](/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.machinelearning.executionproviderreadyresult.status) property of type [ExecutionProviderReadyResultState](/windows/windows-app-sdk/api/winrt/microsoft.windows.ai.machinelearning.executionproviderreadyresultstate). When `Status` is not `Success`, use the `ExtendedError` and `DiagnosticText` properties to diagnose the failure. + +> [!TIP] +> Always check the `Status` before proceeding with session creation. If a provider fails, consider falling back to a different execution provider, such as the CPU execution provider. For common download and installation issues, see [Troubleshoot execution provider download issues](./execution-provider-errors.md). + +--- + ## Installing with progress The APIs for downloading and installing EPs include callbacks that provide progress updates, so that you can display progress indicators to keep your users informed.