You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about using Intel NPU in DirectML_ESRGAN samples.
Since only QC NPU can run that sample, i try to change code to run that sample in Intel NPU.
So, I refer to DirectMLNpuInference sample, which works well on Intel NPU.
/* Original Code// DML execution provider prefers these session options.Ort::SessionOptions sessionOptions;sessionOptions.DisableMemPattern();sessionOptions.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);// sessionOptions.DisablePerSessionThreads();// By passing in an explicitly created DML device & queue, the DML execution provider sends work// to the desired device. If not used, the DML execution provider will create its own device & queue.const OrtApi& ortApi = Ort::GetApi();const OrtDmlApi* ortDmlApi = nullptr;Ort::ThrowOnError(ortApi.GetExecutionProviderApi("DML", ORT_API_VERSION, reinterpret_cast<const void**>(&ortDmlApi)));Ort::ThrowOnError(ortDmlApi->SessionOptionsAppendExecutionProvider_DML1(sessionOptions,dmlDevice,d3dQueue));// Load ONNX model into a session.Ort::Env env(OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING, "DirectML_CV");// .exe failed from here (under line)Ort::Session ortSession(env, modelPath.wstring().c_str(), sessionOptions);*/// Changed Code from DirectMLNpuInferenceconst OrtApi& ortApi = Ort::GetApi();
static Ort::Env env{ nullptr };
env = Ort::Env(Ort::ThreadingOptions{});
env.DisableTelemetryEvents();
auto sessionOptions = Ort::SessionOptions{};
sessionOptions.DisableMemPattern();
sessionOptions.DisablePerSessionThreads();
sessionOptions.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);
const OrtDmlApi* ortDmlApi = nullptr;
Ort::ThrowOnError(ortApi.GetExecutionProviderApi("DML", ORT_API_VERSION, reinterpret_cast<constvoid**>(&ortDmlApi)));
Ort::ThrowOnError(ortDmlApi->SessionOptionsAppendExecutionProvider_DML1(sessionOptions, dmlDevice, d3dQueue));
// Create the sessionauto ortSession = Ort::Session(env, L"esrgan.onnx", sessionOptions);
'''But it still shows "2024-11-26 17:11:56.2608680 [E:onnxruntime:, inference_session.cc:2045 onnxruntime::InferenceSession::Initialize::<lambda_deb1d9a98dc3fb814563870e4f4b9f20>::operator ()] Exception during initialization:" Error. If anyone knows the reasons, please tell me... I will be very very appreciated....
The text was updated successfully, but these errors were encountered:
Hello, Thank you for your Hard Work
I have a question about using Intel NPU in DirectML_ESRGAN samples.
Since only QC NPU can run that sample, i try to change code to run that sample in Intel NPU.
So, I refer to DirectMLNpuInference sample, which works well on Intel NPU.
The text was updated successfully, but these errors were encountered: