Taichi-UnityExample icon indicating copy to clipboard operation
Taichi-UnityExample copied to clipboard

Bug report: Ignored launch because kernel handle is null

Open Hanke98 opened this issue 3 years ago • 4 comments

Hi, I am working on benchmarking some algorithms with Taichi-AOT on mobile phones. I built the libtaichi_c_api.so and libtaichi_unity.so for android according to the instructions. However, when I launch the launch the unity project on my phone, the scene with armadillo shows but fails to run simulation steps. Here 's the errors I got from logcat:

E  InvalidOperationException: Ignored launch because kernel handle is null at Taichi.ComputeGraph.LaunchAsync 
(Taichi.Generated.TiNamedArgument[] namedArgs) [0x00020] in  /......./Taichi-UnityExample/Assets/Taichi/ComputeGraph.cs:20  at Taichi.ComputeGraph.LaunchAsync 
(System.Collections.Generic.Dictionary`2[TKey,TValue] namedArgs) [0x0014e] in /......./Taichi-UnityExample/Assets/Taichi/ComputeGraph.cs:53   at ImplicitFem.Update () [0x0028b] in  /......./Taichi-UnityExample/Assets/Scripts/ImplicitFem.cs:218 

It seems that it failed to launch the kernel.

In fact, one month ago(Oct. 1), I managed to launch the demo, with taichi-unity2@196fa01 and Taichi with my minor hacking (you can find it in my fork). But it has some problem with memory (That's why I did some hack). It seems that the recent version of taichi-unity2 fixes the problem of memory but causes the errors above.

I really need this demo to work normally since it is part of my project, so any advices will be very appreciated ! Thanks in advance.

Hanke98 avatar Nov 02 '22 13:11 Hanke98

I have the same problem! I ran cgraph.py and got graph.tcm. But putting it in Unity environment doesn't work correctly

tianlajiangjun avatar Mar 23 '23 06:03 tianlajiangjun

I have the same problem! I ran cgraph.py and got graph.tcm. But putting it in Unity environment doesn't work correctly

Hi @tianlajiangjun! After consulting @PENGUINLIONG, I found that rerun the python scripts to generate modules and rebuild taichi_c_api.dll and taichi_unity.dll can solve the problem. Maybe you can have a try:-)

Hanke98 avatar Mar 24 '23 04:03 Hanke98

Thank you for your reply! It means that I need to build taichi from source to get taichi_c_api.dll?

tianlajiangjun avatar Mar 25 '23 10:03 tianlajiangjun

Thank you for your reply! It means that I need to build taichi from source to get taichi_c_api.dll?

Yeah, rebuilding the dlls works for me.

Hanke98 avatar Mar 27 '23 12:03 Hanke98