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

Google pixel support #49

Open
MankaranSingh opened this issue Apr 20, 2023 · 3 comments
Open

Google pixel support #49

MankaranSingh opened this issue Apr 20, 2023 · 3 comments

Comments

@MankaranSingh
Copy link

Thanks for the amazing library. work flawlessly on desktop and android phones.
But this is not able to work on google pixel phones, these pixels have libOpenCL-pixel.so that needs to be loaded.

tnn also had some problems with pixel and this could be a reference issue for how to fix this issue
Tencent/TNN#398

@gpu
Copy link
Owner

gpu commented Apr 20, 2023

I'm lacking some context here, and don't even know what the target architecture of the Google pixel is.
Is it correct that there has to be a native library that is linked against libOpenCL-pixel.so?
(I don't know who could build this, but ... if someone provided it, I could add it to one of the next releases)

@MankaranSingh
Copy link
Author

`libOpenCL-pixel.so is Google pixel's openCL lib name (like libPVROCL) for powerVR. Its android with mostly arm64-v8 arch. I can open a pull request once this works.

@gpu
Copy link
Owner

gpu commented Apr 24, 2023

Its android with mostly arm64-v8 arch

That word "mostly" is one point raises the question for me here. The native library that is supposed to be loaded has to match the architecture. And this information has to be encoded in the name of the library. So there is a function in the LibUtils class that assembles that file name. This function may return something like

libJOCL_2_0_4-linux-x86_64.so

or

JOCL_2_0_4-windows-x86.dll

I assume that there is no difference between "arm64-v8" and "arm64" (without the "-v8"), so the name of the library on Android would be libJOCL_2_0_4-android-arm64.so.


Another question that is relevant here: Is there a difference between "Android on Google Pixel" and "Android elsewhere"?

The point is:

If we add a single libJOCL_2_0_4-android-arm64.so to JOCL, will this be linked

  • against libOpenCL-pixel.so or
  • against libOpenCL.so

?

If it has to be linked against different libOpenCL... files (depending on whether it's on Pixel or not), then we'd have to handle this, by creating two file names:

  • libJOCL_2_0_4-android-arm64.so (linked against libOpenCL.so)
  • libJOCL_2_0_4-android-pixel-arm64.so (linked against libOpenCL-pixel.so)

That sounds like a bit of pain in the back, but ... well, whatever Google is doing there, it could be manageable. The question is: Can we unambiguously identify the "Pixel" case in

static OSType calculateOS()
?

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

No branches or pull requests

2 participants