Skip to main content
Participant
November 24, 2024

Request for supporting dynamic loading OpenCL

  • November 24, 2024
  • 2 replies
  • 860 views
 

I am developing a native app that utilizes OpenCL, Vulkan, and OpenXR, but I’ve encountered a significant roadblock: `libOpenCL.so` cannot be dynamically loaded with dlopen because it is not included in `/etc/public.libraries.txt`.

While it’s technically possible to extract the library using `adb pull /vendor/lib/libOpenCL.so` and bundle it within the APK, this is not a scalable solution for supporting a diverse range of devices, even within the Meta ecosystem. I understand this limitation may be due to security considerations, but it’s worth noting that `libvulkan.so` is already accessible. Restricting developers to Vulkan forces additional effort to convert OpenCL kernels into SPIR-V, which seems unnecessary, IMHO.

Providing support for `libOpenCL.so` would significantly enhance compatibility and streamline development. This is especially important given that many deep learning frameworks rely on dynamic loading of the OpenCL library through stub code.

This topic has been closed for replies.

2 replies

Inspiring
November 24, 2024

The lib was available before v71 update.

I suggest to follow this thread as well:
https://communityforums.atmeta.com/t5/Mobile-Development/OpenCL-broken-after-v71-update/m-p/1263245

New Participant
June 14, 2025

Allowing libOpenCL.so access via dlopen would simplify development and boost compatibility. Relying only on Vulkan adds avoidable complexity.  https://wealthdt5apk.com/