Skip to content
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

[Android] Add initial support of the platform #3755

Merged
merged 2 commits into from
Dec 9, 2021
Merged

[Android] Add initial support of the platform #3755

merged 2 commits into from
Dec 9, 2021

Conversation

ghuau-innopeak
Copy link
Collaborator

Related issue = #3679

This is an initial support so a lot of features are not supported yet such as the logging with logcat or traceback.

GLFW need to be removed from the build system and also the link
libraries are different from the desktop machine as it uses a different
type of toolchain/libc++/etc.
@netlify
Copy link

netlify bot commented Dec 8, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc ready!

🔨 Explore the source changes: 5010463

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61b154a1531f620008875525

😎 Browse the preview: https://deploy-preview-3755--jovial-fermat-aa59dc.netlify.app

@ghuau-innopeak
Copy link
Collaborator Author

I added a new tag [Android] as this is a new platform, but I can rename it to [Linux] if needed. Also, for testing, this is what I'm currently using:

TAICHI_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=29 -DANDROID_ABI=arm64-v8a -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_LLVM:BOOL=OFF -DTI_EXPORT_CORE:BOOL=ON" python3 setup.py build_ext

@@ -68,6 +85,9 @@ void VulkanProgramImpl::materialize_runtime(MemoryPool *memory_pool,
*result_buffer_ptr = (uint64 *)memory_pool->allocate(
sizeof(uint64) * taichi_result_buffer_entries, 8);

// TODO: Support for Android if possible... Should we move this code to be the
// responsability of the caller to this library?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When embedded in other applications the design is to leave the creation of VkDevice and related states to the caller/host. VulkanDeviceCreator is only used when Taichi is running on its own.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks! that works for me :), I updated the comment to match this behavior, let me know if you prefer to complete remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good for now!

Copy link
Collaborator

@bobcao3 bobcao3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

* No GUI support at the moment
* Forcing Vulkan to 1.2 for compatibility
* Disabling all the extensions except required one for computing
(surface, swapchain, ...)
* No support of traceback: execinfo.h is not supported on Android but
could be re-implemented with libunwind
* No support of logging: need to adapt the logger to use logcat
@bobcao3 bobcao3 merged commit fcdcaf9 into taichi-dev:master Dec 9, 2021
@ghuau-innopeak ghuau-innopeak deleted the android_support branch December 14, 2021 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants