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 x86_64 compatibility #54

Open
JMBartelt opened this issue Sep 1, 2023 · 6 comments
Open

Android x86_64 compatibility #54

JMBartelt opened this issue Sep 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@JMBartelt
Copy link

Would it be possible for whisper.cpp to be compiled for Android x86_64 architecture and run using whisper.unity?

I've got a libwhisper.so file built for Android x86_64 and am wondering what my next steps would be to implement it with whisper.unity. Thanks!

@Macoron
Copy link
Owner

Macoron commented Sep 1, 2023

I personally never tested that, because I don't have x86 Android device. But you probably can:

  1. Compile whisper as a static library .a with x86_64 (see how it's done in CI pipeline here)
  2. Copy compiled library to package Plugins/Android and replace existing one
  3. Comment out this code which checks PlayerSettings. I added that just as a warning and it won't break anything.
  4. In PlayerSettings enable x86_64 architecture

Should probably work after that. Please write back if it does.

P.S. For what target do you compile x86_64? Is that some Chrome OS IoT stuff?

@Macoron Macoron added the enhancement New feature or request label Sep 1, 2023
@JMBartelt
Copy link
Author

Thanks for the directions, I'll give it a try! My target device is the Magic Leap 2

@JMBartelt
Copy link
Author

The app builds and starts after replacing the libwhisper.a with one compiled for Android x86_64, but crashes immediately at runtime.

@Babilinski
Copy link

Babilinski commented Jun 5, 2024

Heads-up to anyone who stubbles upon this, you may need to update the build.sh script that is in the root folder to respect the architecture specified in the build pipeline.

https://github.com/Macoron/whisper.unity/blob/master/build_cpp.sh#L78

@Macoron
Copy link
Owner

Macoron commented Jun 5, 2024

Heads-up to anyone who stubbles upon this, you may need to update the build.sh script that is in the root folder to respect the architecture specified in the build pipeline.

https://github.com/Macoron/whisper.unity/blob/master/build_cpp.sh#L78

Does the compiled library work on your target x86_64 device?

@Babilinski
Copy link

Yes, I just pushed up the changes and configured the project in my fork for android x86_64:
https://github.com/Babilinski/whisper.unity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants