问题描述
我正在使用Microsoft.ML.OnnxRuntime.DirectML nuget包进行图像分类,如下所示:
var options = new SessionOptions();
options.AppendExecutionProvider_DML( 1 ); // deviceId goes here
var session = new InferenceSession( _modelPath,options );
我有一个大问题:在IIS中,集成视频卡的deviceId为0,离散的设备的deviceId为1。但是,当我的应用在Kestrel下运行时,集成的设备的deviceId为1,离散的设备ID为0,这与Task的相反进行评分时,Manager会在“ GPU引擎”列中显示。
现在我的集成卡不能与该软件包一起使用,因为它会抛出此异常(而且这毫无意义):
Exception Info: Microsoft.ML.OnnxRuntime.OnnxRuntimeException: [ErrorCode:RuntimeException] D:\5\s\onnxruntime\core\providers\dml\dml_provider_factory.cc(110)\onnxruntime.DLL!00007FF8C074118F: (caller: 00007FF8C07411C7) Exception(941) tid(35b8) 887A0020 An internal issue prevented the driver from carrying out the specified operation. The driver's state is probably suspect,and the application should not continue.
因此,我需要一种可靠的方法来检测离散视频卡的deviceId。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)