taichi-dev / taichi-nerfs

Implementations of NeRF variants based on Taichi + PyTorch
Apache License 2.0
734 stars 49 forks source link

iOS demo issue #58

Closed LyndzP closed 1 year ago

LyndzP commented 1 year ago

Hi Thank you for awesome project for all. I have a one issue that demo for iOS I was run the code :

1. python3 train.py  
    --root_dir ./data/Synthetic_NeRF/Chair
    --max_steps 20000 --batch_size 8192 --lr 1e-2 
    --deployment --deployment_model_path=. 
2. python3 deployment/InstantNGP/taichi_ngp/taichi_ngp.py --aot --model_path=./deployment.npy --res_w=300 --res_h=600
  1. edit code using Xcode Viewcontroller.m 69:

    NSString *aotFilePath = [bundleRoot stringByAppendingPathComponent:@"taichi_ngp/compiled"]; (compiled is generated folder from 2)

  2. build Xcode

Then I got error like this:

[I 05/22/23 14:52:53.314 2775915] [taichi_core_impl.cpp:ti_create_runtime@246] Taichi Runtime C-API version is: 1005000 2023-05-22 14:52:53.315954+0900 TaichiNGPDemo[6094:2775915] Metal GPU Frame Capture Enabled 2023-05-22 14:52:53.316143+0900 TaichiNGPDemo[6094:2775915] Metal API Validation Enabled [E 05/22/23 14:52:53.626 2775915] [runtime.cpp:host_to_device@117] Device does not support arg type=unknown

[W 05/22/23 14:52:53.627 2775915] [taichi_core_impl.cpp:ti_set_last_error@227] C-API error: (invalid state)[runtime.cpp:host_to_device@117] Device does not support arg type=unknown libc++abi: terminating with uncaught exception of type std::runtime_error: Memory allocation failed [runtime.cpp:host_to_device@117] Device does not support arg type=unknown (lldb)

can I get some solutions?

jim19930609 commented 1 year ago

Hi LyndzP, can you verify your taichi version and make sure you've installed the specific nightly version:

The thing is Taichi AOT requires a C-API dynamic library which has to be compatible with the Taichi (the python-taichi used to generate the AOT files) version.

image