echuraev commented on a change in pull request #7876: URL: https://github.com/apache/tvm/pull/7876#discussion_r711970563
########## File path: apps/ios_rpc/README.md ########## @@ -114,19 +57,198 @@ cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON - -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=XXXXXXXXXX # insert your Team ID -DUSE_IOS_RPC=ON # to enable build iOS RPC application from TVM project tree -cmake --build . --target custom_dso_loader ios_rpc # Will use custom DSO loader by default -# Resulting iOS RPC app bundle will be placed in: -# apps/ios_rpc/ios_rpc/src/ios_rpc-build/Build/Products/[CONFIG]-iphoneos/tvmrpc.app + -DUSE_METAL=ON # to enable Metal runtime + +cmake --build . --target custom_dso_loader tvm_runtime +``` + +### Building iOS TVM RPC application +Before start, please run [init_proj.py](./init_proj.py) to update XCode developer metadata: +```shell +python3 init_proj.py --team_id XXXXXXXXXX --tvm_build_dir "/path/to/tvm/ios/build/folder" +``` +You can get value of your `team_id` in the following ways: +- **You have registered Apple Developer Profile**. In this case you developer + Team ID available at https://developer.apple.com/account/#/membership +- You are using your local developer profile. In this case run the command above + with `XXXXXXXXXX` instead of Team ID. Then open `tvmrpc.xcodeproj` by using + XCode, click on the project name (`tvmrpc`) on the left panel. Then select + target `tvmrpc`. At the bottom of this panel go to `Signing & Capabilities` + tab and in the field `Team` select your local developer profile + (`Your Name (Personal Team)`). + + On the first run of the application you may see message `Could not launch + "tvmrpc"` in the XCode and message `Untrusted Developer` on your device. In + this case it will be necessary to check the certificate. Open + `Settings -> General -> Device Management -> Apple Development: <your_email> + -> Trust "Apple Development: <your_email>"` and click `Trust`. After than you + should rerun your application in the XCode. + +After this step, open `tvmrpc.xcodeproj` by using XCode, build the App and +install the App on the phone. + +## Workflow +Due to security restriction of iOS10. We cannot upload dynamic libraries to the +App and load it from sandbox. Instead, we need to build a list of libraries, +pack them into the app bundle, launch the RPC server and connect to test the +bundled libraries. We use one approach to workaround this limitation, for more +details please take a look into section +[Building TVM runtime and custom DSO loader integration](#building-tvm-runtime-and-custom-DSO-loader-plugin). Review comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
