AMD NPU EP download error——Error: VitisAIExecutionProvider is not available on this system.
Issue: AMD NPU EP Download Error Background
My PC originally had the AMD NPU Execution Provider (EP) installed. To verify the automatic EP download functionality, I manually deleted the following two folders under
C:\Program Files\WindowsApps:
Microsoft.WindowsMLRuntime.AMD.NPU.EP_0.1.9.0_x64__8wekyb3d8bbwe
MicrosoftCorporationII.WinML.AMD.NPU.EP.1.8_1.8.26.0_x64__8wekyb3d8bbwe
Then, I added the following test code in
C:\test\WindowsAppSDK\WindowsAppSDK-Samples-main\Samples\WindowsML\cpp\CppConsoleDesktop
to test whether the EP can be automatically redownloaded:
#include <winrt/Microsoft.Windows.AI.MachineLearning.h>
#include <winml/onnxruntime_cxx_api.h>
#include <winrt/Windows.Foundation.h>
#include <iostream>
#include <vector>
int main()
{
try
{
winrt::init_apartment();
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "CppDemo");
std::cout << "ONNX Version string: " << Ort::GetVersionString() << std::endl;
std::cout << "Getting available providers..." << std::endl;
auto catalog = winrt::Microsoft::Windows::AI::MachineLearning::ExecutionProviderCatalog::GetDefault();
catalog.EnsureAndRegisterCertifiedAsync().get();
auto providers = catalog.FindAllProviders();
std::cout << "Available providers from catalog:" << std::endl;
for (auto const& provider : providers)
{
std::wcout << L" Provider: " << provider.Name().c_str() << std::endl;
provider.EnsureReadyAsync().get();
provider.TryRegister();
}
std::vector<Ort::ConstEpDevice> ep_devices = env.GetEpDevices();
std::cout << "All available EP devices:" << std::endl;
for (const auto& d : ep_devices)
{
std::cout << " EP Name: " << d.EpName() << ", Device ID: " << std::endl;
}
std::vector<Ort::ConstEpDevice> selected_ep_devices;
for (const auto& d : ep_devices)
{
if (std::string(d.EpName()) == "VitisAIExecutionProvider")
{
selected_ep_devices.push_back(d);
std::cout << "Found AMD NPU device: " << d.EpName() << std::endl;
}
}
if (selected_ep_devices.empty())
{
throw std::runtime_error("VitisAIExecutionProvider is not available on this system.");
}
Ort::SessionOptions sessionOptions;
sessionOptions.SetEpSelectionPolicy(OrtExecutionProviderDevicePolicy_MAX_EFFICIENCY);
std::cout << "SessionOptions configured with AMD NPU EP." << std::endl;
}
catch (const std::exception& ex)
{
std::cerr << "Error: " << ex.what() << std::endl;
}
return 0;
}
However, when I run the program, I get the following output:
ONNX Version string: 1.23.1 Getting available providers... Available providers from catalog: Provider: VitisAIExecutionProvider All available EP devices: EP Name: CPUExecutionProvider, Device ID: EP Name: DmlExecutionProvider, Device ID: EP Name: DmlExecutionProvider, Device ID: Error: VitisAIExecutionProvider is not available on this system.
In fact, the deleted EP directories were not re-downloaded, which means the following call did not work as expected:
auto catalog = winrt::Microsoft::Windows::AI::MachineLearning::ExecutionProviderCatalog::GetDefault();
catalog.EnsureAndRegisterCertifiedAsync().get();
To restore functionality, I copied my backup folders
(MicrosoftCorporationII.WinML.AMD.NPU.EP.1.8_1.8.26.0_x64__8wekyb3d8bbwe)
back into C:\Program Files\WindowsApps, but the same error still occurs.
Therefore, I would like to ask how I can make the EP re-download the correct AMD NPU Execution Provider files so that the NPU can work properly? I suspect that my deletion method was incorrect, which caused the automatic re-download and detection mechanism to stop working. Is there any way to restore it to normal?
I manually deleted the following two folders
Ah- those are OS-managed folders for the application platform and shouldn't be manipulated directly via the file system. There are other commands you can run to e.g., uninstall an MSIX package that would be installed there (though the EP packages themselves are a little special as they are distributed through Windows Update, cc'ing @jaholme for any documentation on the right incantations for direct management of the EPs- maybe we should try to start with those commands to do a proper full removal of the package).
Update to the latest Windows Update for Windows 11, and then you can utilize remove-appxpackage. get-appxpackage MicrosoftCorporationII.WinML.AMD.NPU.EP | remove-appxpackage
@adrastogi @jaholme Thank you very much for your help. I followed the steps above to remove the existing AMD NPU EP. When I ran the executable program again, it triggered a background download of the AMD NPU EP, which appeared to complete successfully. However, in reality, it was neither installed nor executed successfully.
I used the following command:
Get-AppxPackage -AllUsers *WinML.AMD.NPU.EP* | Remove-AppxPackage -AllUsers
This completely removed MicrosoftCorporationII.WinML.AMD.NPU.EP.1.8_1.8.26.0_x64__8wekyb3d8bbwe and all related information.
After that, when I ran my executable program again, it seemed to trigger an automatic download of the NPU Execution Provider. I could see the download process in the Windows Update settings, showing that the AMD NPU EP was being downloaded.
Once the download was shown as “completed” in Windows Update, I ran the program again — but it still reported that the NPU EP was missing, and an error occurred.
When I checked the folder
C:\Program Files\WindowsApps
I found that there was no directory created for MicrosoftCorporationII.WinML.AMD.NPU.EP.1.8_1.8.26.0_x64__8wekyb3d8bbwe. So it seems like the installation actually failed, even though Windows Update reported it as completed.
Later I discovered that every time I run the executable, it triggers another AMD NPU EP download, which appears again in the Windows Update background task list. However, the corresponding folder still never appears, and the package isn’t actually installed.
This indicates that each “download” looks successful on the surface but actually fails silently, causing the same download to be retriggered every time the program runs.
It seems to be a bug. Please help investigate or track down this issue. Thank you very much.
Download EP start :
Download EP OK:
RUN ./XXX.exe:
Every time I run the program, it triggers a new download. I can see the download progress in the background, but it fails with an error each time.