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

[vulkan] Fix MoltenVK support #4205

Merged
merged 24 commits into from
Feb 7, 2022
Merged

Conversation

bobcao3
Copy link
Collaborator

@bobcao3 bobcao3 commented Jan 31, 2022

Related issue = #3030
Depending PR = https://github.com/taichi-dev/taichi/pull/4202/files (merged)

This fixes the MoltenVK support on mac.

Fixes & improvements include:

  • Auto search for clang-11 / clang-10 when host compiler is clang>=12 (higher version of macOS should work without setting CXX env vars)
  • Use dlopen to load MoltenVK and use Volk (with custom loader) to handle the rest of loading. This avoids the @rpath thing on mac, and makes Molten actually shippable
  • Fix vulkan device API memory mapping bug when buffer is suballocated from a larger VulkanMemory
  • Avoid buffer binding aliasing.
  • Use different binding points for aliases if absolutely required
  • Add AcquireRelease barrier before atomics (a compromise for aliasing instead of ptr cast). The impact of this is yet to be seen.
  • Fix non 32-bit non-integral arguments on to-source translated platforms
  • Relax GGUI test on macOS where Metal does not support wide lines
  • Relaxed the element wise power test
  • Changed args / rets to compiled SPIR-V struct

In addition to be able to run and ship MoltenVK, this also gurantees the SPIR-V codegen will work when translated to MSL (as that is what MoltenVK do under the hood). This helps our on-going AOT effort.

Vulkan testing is added for M1, and vulkan is added in release for all macOS variants

@netlify
Copy link

netlify bot commented Jan 31, 2022

✔️ Deploy Preview for docsite-preview ready!

🔨 Explore the source changes: 845a505

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/62009307f8d4a40007be47f5

😎 Browse the preview: https://deploy-preview-4205--docsite-preview.netlify.app

@bobcao3
Copy link
Collaborator Author

bobcao3 commented Jan 31, 2022

/format

@bobcao3
Copy link
Collaborator Author

bobcao3 commented Jan 31, 2022

/format

1 similar comment
@bobcao3
Copy link
Collaborator Author

bobcao3 commented Jan 31, 2022

/format

@bobcao3
Copy link
Collaborator Author

bobcao3 commented Jan 31, 2022

/format

1 similar comment
@bobcao3
Copy link
Collaborator Author

bobcao3 commented Jan 31, 2022

/format

Copy link
Contributor

@lin-hitonami lin-hitonami left a comment

Choose a reason for hiding this comment

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

It works! Thanks!

@@ -209,13 +210,14 @@ jobs:

- name: Build
run: |
brew install molten-vk
Copy link
Contributor

@lin-hitonami lin-hitonami Feb 7, 2022

Choose a reason for hiding this comment

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

Should we brew uninstall molten-vk after we complete the building process to make sure the test can pass without molten-vk?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, if it does not take a lot of time

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.

None yet

3 participants