How to enable Opencl support on hikey960?



I’m also waiting for opencl enabled drivers for the Hikey960 on android. [1] shows a userspace driver that seems to contain the opencl symbols. Is this the one promised above?
If so, do I have to take extra steps to integrate them with my kernel?
I am using the android-hikey-linaro-4.9 of [2]. The provided binaries have the version r9p0-01rel0, the kernel contains the define MALI_RELEASE_NAME=r7p0-01rel0.



Here it is folks -

Credits to Arm. Ignore the description error atm - being fixed as we speak. OpenCL 2.0 is available.



What kind of kernel support is required for this Open*L library mali-G71_r9p0-01rel0_linux_1fbdev.tar.gz ?
I have seen only these integrated gpu/arm drivers



You can download the kernel driver from


I’ve downloaded the ARM Bifrost GPU package and pointed the ICD at the driver.

The clinfo utility is able to report some useful (and correct) info but certain queries are failing:

Failed creating base context during opening of kernel driver.
Kernel module may not have been loaded

I assume this means the kernel doesn’t have proper support for the user-space driver?

Can anyone point me in the right direction?


root@linaro-developer:~# clinfo
Number of platforms                               1
  Platform Name                                   ARM Platform
  Platform Vendor                                 ARM
  Platform Version                                OpenCL 2.0 v1.r9p0-01rel0.37c12a13c46b4c2d9d736e0d5ace2e5e
  Platform Profile                                FULL_PROFILE
  Platform Extensions function suffix             ARM

  Platform Name                                   ARM Platform
Number of devices                                 1
Failed creating base context during opening of kernel driver.
Kernel module may not have been loaded
  Device Name                                     <printDeviceInfo:0: get Device Name size : error -6>
  Device Vendor                                   ARM


I have integrated the Bifrost kernel driver into the latest HiKey960 kernel from 96boards at

Try compiling that kernel, and install the modules. OpenCL works, but the driver does not have support for powersaving or clock control. I tried modifying the hisilicon platform in the original branch to work with this driver, but that didn’t change anything.

If anyone is interested, I also have a debian 9 (stretch) image with the kernel + modules installed. It boots, WiFi works, and OpenCL works as well. It does not have a mali.icd at the moment, but that’s easy enough to add. No real X support though, as I didn’t look into that. Feel free to ping me if interested, and I’ll set up a download of it.

Bas Vermeulen


I have checked out the -b feature/update-to-mali-r9p0-01rel0 branch from your repository.
The kernel compiles and boots on my debian setup (with hikey960_defconfig),
but i don’t see r9p0-01rel0 in the tree.
The modules are disabled. Which .config are you using ?


I’m using this defconfig to build. The driver is built as a module.



OK, you have used defconfig and not hikey960_defconfig.


No, I modified the hikey960_defconfig and used that instead. Copy my
defconfig to your_defconfig in arch/arm64/configs and do a make
your_defconfig, copy defconfig to .config and compile, or even replace hikey960_defconfig with mine.



Fantastic! I was going to do the same thing. I’ll try this out tonight.

Did you notice that ARM updated the Bifrost kernel driver to r11?

Do you know if the kernel and user-space driver rXX versions are supposed to match?


I just noticed the defconfig I attached to the email didn’t get attached here.

Please cherry-pick commit 97a703e840eea6a51157abffa332ad4610d2a8e2 and use daedalean_defconfig to compile a kernel with mali support enabled as a module.



I did notice the r11 kernel driver, but wanted to keep the userspace and kernel driver matched as closely as possible.



FWIW, Vulkan 1.0 symbols are in the downloaded library but ARM didn’t include* links.


Hello all and @ric96, I have hikey960 boards, it has android os in it. However, when I run opencl program, it say

terminate called after throwing an instance of 'cl::Error’
what(): clGetDeviceInfo.

I download mali-450_r7p0-00rel0_android-6.0_1.tar.gz from and pushed to hikey. But also get same error shown above.
Can you give me more information about how to give it work on opencl with hikey960?
Thanks you


The mali gpu driver yoi downloaded is only for hikey that uses the 450mp gpu. The hikey960 has only debian linux binaries available publically. For aosp its a wip.


So, does debian linux support opencl?
link here only directs to aosp not debian.


There is no ready made image, but you can roll your own debian image.


Hi, @bvermeul, is it possible to share your debian 9(stretch) image? I’d like to test some opencl application in HiKey960 board.



You can download the image here:

There is an empty root password. When using wifi, setup /etc/wpa_supplicant/wpa_supplicant-wlan0.conf (or something similar). Make sure to set up UEFI boot for the normal rpb linux images, and flash this image as system with fastboot.