-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExecutionEngineException in Unity3d IL2CPP iOS #152
Comments
Does this error occur only on the device and not in the simulator? Also, do you have a small repro project?
… On 18 May 2019, at 10:21, mjokipii ***@***.***> wrote:
Running code using Infer.NET fails with an ExecutionEngineException on iOS when built with IL2CPP from Unity3d. Some of the instantiations of generic types used internally don't exist during compile time which causes the corresponding iOS AOT code to be missing at runtime.
Details:
Unity 2018.3
Microsoft.ML.Probabilistic.dll
Microsoft.ML.Probabilistic.Compiler.dll
ExecutionEngineException: Attempting to call method 'Microsoft.ML.Probabilistic.Models.ModelBuilder::SearchExpression<System.Boolean>' for which no ahead of time (AOT) code was generated.
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Utilities.Util.Invoke (System.Reflection.MethodBase method, System.Object target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.ModelBuilder.Build (Microsoft.ML.Probabilistic.Models.InferenceEngine engine, System.Boolean inferOnlySpecifiedVars, System.Collections.Generic.IEnumerable`1[T] vars) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.BuildAndCompile (System.Boolean inferOnlySpecifiedVars, System.Collections.Generic.IEnumerable`1[T] vars) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.GetCompiledInferenceAlgorithm (System.Boolean inferOnlySpecifiedVars, Microsoft.ML.Probabilistic.Models.IVariable var) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.Infer (Microsoft.ML.Probabilistic.Models.IVariable var) [0x00000] in <00000000000000000000000000000000>:0
at Main.TwoCoins () [0x00000] in <00000000000000000000000000000000>:0
at Main.Start () [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Utilities.Util.Invoke (System.Reflection.MethodBase method, System.Object target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.ModelBuilder.Build (Microsoft.ML.Probabilistic.Models.InferenceEngine engine, System.Boolean inferOnlySpecifiedVars, System.Collections.Generic.IEnumerable`1[T] vars) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.BuildAndCompile (System.Boolean inferOnlySpecifiedVars, System.Collections.Generic.IEnumerable`1[T] vars) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.GetCompiledInferenceAlgorithm (System.Boolean inferOnlySpecifiedVars, Microsoft.ML.Probabilistic.Models.IVariable var) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.ML.Probabilistic.Models.InferenceEngine.Infer (Microsoft.ML.Probabilistic.Models.IVariable var) [0x00000] in <00000000000000000000000000000000>:0
at Main.TwoCoins () [0x00000] in <00000000000000000000000000000000>:0
at Main.Start () [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)```
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This error occurs only when ran on a device that executes only AOT code like the IL2CPP compiled Xcode build on any iOS device. The library performs correctly in the editor that executes managed code. I have a small Unity3d repro. Where should i deliver the project? |
You can either attach it here (25MB limit) or use a third party host.
Please include a full set of steps required to repro.
I’m not sure this is something we can fix, it seems like it is either a limitation, or a bug in another tool. However, we can certainly take a look!
… On 18 May 2019, at 13:09, mjokipii ***@***.***> wrote:
This error occurs only when ran on a device that executes only AOT code like the IL2CPP compiled Xcode build on any iOS device. The library performs correctly in the editor that executes managed code. I have a small Unity3d repro. Where should i deliver the project?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes, this is due to a known limitation of the IL2CPP compiler used in Unity3d and concerns only generic types with value type parameter. Please see: Unfortunately that includes just about every use of Infer.Net. I'll post the repro in a minute. |
Reproduced on iOS 12.1.4 and iOS 10.2.1 using Unity3d 2018.3.10f1 and Xcode 10.2.1. |
Hi there, any chance for a fix or a workaround to allow Infer.NET on Unity iOS? |
Hi! |
That sounds promising. After a quick look to the instructions, if ican can update the model parameters and data without recompiling, i think inference is all i need in the iOS side. I will look into this and see if i can make this work. Thanks a lot! |
Running code using Infer.NET fails with an ExecutionEngineException on iOS when built with IL2CPP from Unity3d. Some of the instantiations of generic types used internally don't exist during compile time which causes the corresponding iOS AOT code to be missing at runtime.
Details:
Unity 2018.3
Microsoft.ML.Probabilistic.dll
Microsoft.ML.Probabilistic.Compiler.dll
The text was updated successfully, but these errors were encountered: