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

DLL not found

Open YoruCathy opened this issue 2 years ago • 7 comments

DllNotFoundException: taichi_unity assembly:<unknown assembly> type:<unknown type> member:(null)
Taichi.Generated.Ffi.TixImportNativeRuntimeUnity () (at Assets/Taichi/Generated/taichi_unity.cs:26)
Taichi.Runtime.get_Singleton () (at Assets/Taichi/Runtime.cs:20)
Taichi.AotModule..ctor (System.String module_path) (at Assets/Taichi/AotModule.cs:10)
Taichi.AotModuleAsset.Load () (at Assets/Taichi/AotModuleAsset.cs:24)
Taichi.AotModuleAsset.GetAllKernels () (at Assets/Taichi/AotModuleAsset.cs:47)
ImplicitFem.Start () (at Assets/Scripts/ImplicitFem.cs:81)

Hi team, I'm trying to run this example on Ubuntu 20.04, with Unity 2023.1.0a21. It is complaining about the error above. Any suggestions for resolving this?

YoruCathy avatar Mar 17 '23 20:03 YoruCathy

Sorry that we don't have prebuilt binary for Linux platform, but the examples should work out of the box on either Windows/macOS. You can follow the instruction here (https://github.com/taichi-dev/taichi-unity2) and see if you can build libtaichi_c_api.so and libtaichi_unity2.so and put them to Assets/Plugins.

PENGUINLIONG avatar Mar 17 '23 23:03 PENGUINLIONG

I am getting the same issue on both Windows/macOS... Is there anything I can look into for this issue on Windows/macOS?

sarahhaha avatar Mar 18 '23 00:03 sarahhaha

That's funny. Could you provide more information like unity logs etc about that? The repo is continuously covered by our CI so it shouldn't break.

PENGUINLIONG avatar Mar 18 '23 01:03 PENGUINLIONG

It is the same DLLNotFoundException as above. DllNotFoundException: taichi_unity assembly: type: member:(null) Taichi.Generated.Ffi.TixImportNativeRuntimeUnity () (at Assets/Taichi/Generated/taichi_unity.cs:26) Taichi.Runtime.get_Singleton () (at Assets/Taichi/Runtime.cs:20) Taichi.AotModule..ctor (System.String module_path) (at Assets/Taichi/AotModule.cs:10) Taichi.AotModuleAsset.Load () (at Assets/Taichi/AotModuleAsset.cs:24) Taichi.AotModuleAsset.GetAllKernels () (at Assets/Taichi/AotModuleAsset.cs:47) Mpm88.Start () (at Assets/Scripts/Mpm88.cs:33)

There is also a NullReferenceException which I believe is caused by the DLL not being found. NullReferenceException: Object reference not set to an instance of an object Mpm88.Update () (at Assets/Scripts/Mpm88.cs:102)

sarahhaha avatar Mar 22 '23 01:03 sarahhaha

Well I just upgraded the prebuilts in https://github.com/taichi-dev/Taichi-UnityExample/pull/27. Please check if the latest master still have the problem. At least I tried a bit and it simply works. Otherwise I would recommend you to double check if you have installed the MSVC redistributables https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170 but it should come with any Windows 10 or higher. If it again crashes I can hardly help.

PENGUINLIONG avatar Mar 22 '23 03:03 PENGUINLIONG

Hi @PENGUINLIONG , in the readme there's a unity version requirement saying it needs 2022.3.14 or above to operate, but we can not find this version anywhere. Is this a typo?

YoruCathy avatar Mar 24 '23 20:03 YoruCathy

@PENGUINLIONG Thank you for upgrading the prebuilt. I have ended up fixing this issue by getting a fresh build and following the developer installation here https://docs.taichi-lang.org/docs/dev_install.

sarahhaha avatar Apr 14 '23 21:04 sarahhaha