StableDiffusion / OnnxRuntimeException / The specified device interface or feature level is not supported on this system
imranypatel opened this issue · comments
While trying Basic Stable Diffusion Example, at the following line in the code:
var pipeline = StableDiffusionPipeline.CreatePipeline(@"models\huggingface\stable-diffusion-v1-5");
Exception is raised as:
Microsoft.ML.OnnxRuntime.OnnxRuntimeException
HResult=0x80131500
Message=[ErrorCode:RuntimeException] D:\a\_work\1\s\onnxruntime\core\providers\dml\dml_provider_factory.cc(518)\onnxruntime.DLL!00007FFCA503D0A9: (caller: 00007FFCA503D211) Exception(1) tid(3644) 887A0004 The specified device interface or feature level is not supported on this system.
Source=Microsoft.ML.OnnxRuntime
StackTrace:
at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus)
at Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_DML(Int32 deviceId)
at OnnxStack.Core.Extensions.GetSessionOptions(OnnxModelConfig configuration)
at OnnxStack.Core.Model.OnnxModelSession..ctor(OnnxModelConfig configuration)
at OnnxStack.StableDiffusion.Models.UNetConditionModel..ctor(UNetConditionModelConfig configuration)
at OnnxStack.StableDiffusion.Pipelines.StableDiffusionPipeline.CreatePipeline(StableDiffusionModelSet modelSet, ILogger logger)
at OnnxStack.StableDiffusion.Pipelines.StableDiffusionPipeline.CreatePipeline(String modelFolder, ModelType modelType, Int32 deviceId, ExecutionProvider executionProvider, MemoryModeType memoryMode, ILogger logger)
at TestOnnxStack.TestStableDiffusion.<Test01>d__0.MoveNext() in ...\TestOnnxStack\TestStableDiffusion.cs:line 23
at Program.<<Main>$>d__0.MoveNext() in ...\TestOnnxStack\Program.cs:line 6
Environment:
- Windows 10
- .Net 8.0
- Microsoft.ML.OnnxRuntime.DirectML Version="1.18.0"
- OnnxStack.StableDiffusion Version="0.31.0
Any pointers to troubleshooting?
Thanks
Got some clue from the discussion at microsoft/onnxruntime#15953
Changed target CPU from Any CPU to x64 to resolve the problem.