linuxdeploy icon indicating copy to clipboard operation
linuxdeploy copied to clipboard

How to use OpenCL

Open jianzs opened this issue 5 years ago • 1 comments

I have a phone, nubia z11, which has an Adreno 530 GPU. I installed Ubuntu 18 on the phone by LinuxDeploy. Now, I want to use the GPU in Ubuntu. For compiling the source code, I copy the libOpenCL.so from android to Ubuntu. But aftering running the program, I got an error, -1001.

I want to know if there is a way to use OpenCL in Ubuntu?

Test program:

#include <stdio.h>
#include <stdlib.h> 
#include <CL/cl.h> 
#include <CL/opencl.h> 
  
int main()
{
    cl_int status=0;
    size_t deviceListSize;
    cl_uint numPlatforms;
    cl_platform_id platfomr=NULL;

    status=clGetPlatformIDs(0,NULL,&numPlatforms);

    printf("status=%d\n",status);

    return 0;
 }

The result is:

status=-1001

The result of clinfo command:

Number of platforms                               0

jianzs avatar Apr 08 '20 06:04 jianzs

did you solved this problem?i also want to use adreno gpu to hardware accelerate

vadur avatar Apr 28 '22 05:04 vadur