How to enable OpenCL on Nexus 5

Google added OpenCL drivers in Android 4.2, but then removed them from Android 4.3. As a result, with Android 4.4 we're unable to run OpenCL applications on Nexus 5, even if the GPU (Qualcomm's Adreno 330) supports OpenCL 1.2.

However, Qualcomm still leaves a backdoor to enable OpenCL in their latest Android driver (shipped with Kitkat KOT49H), which is located at /system/vendor/lib/ as an user-mode driver. It means we can still enable OpenCL functions by installing the missing libraries back to the device.

Here is the steps (ROOT only):

  1. Clone this repository to your local machine
  2. Attach your device, and install the missing libraries following these instructions
$ adb push jellybean/system/lib /sdcard/
$ adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# cp /sdcard/ /system/lib/
# cp /sdcard/ /system/lib/
# chmod 644 /system/lib/
# chmod 644 /system/lib/


Max Lv

A programmer focusing on High-performance Computing.

comments powered by Disqus