OpenCL Hello World

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL Hello World

OpenCL Hello World

Abstract


This is a small tutorial about running a simple OpenCL application in

an i.MX6Q. It covers a very small introduction to OpenCL, the explanation

of the code and how to compile and run it.

 

Requirements

 

Any i.MX6Q board.

Linux BSP with the gpu-viv-bin-mx6q package (for instructions on how to build the BSP, check the BSP Users Guide)

 

OpenCL overview

 

OpenCL allows any program to use the GPGPU features of the GC2000 (General-Purpose Computing on Graphics Processing Units) that means to use the i.MX6Q GPU processing power in any program.

 

OpenCL uses kernels which are functions that can be executed in the GPU. These functions must be written in a C99 like code. In our current GPU there

is no scheduling so each kernel will execute in a FIFO fashion. iMx6Q GPU is OpenCL 1.1 EP conformant.


The Code

 

The example provided here performs a simple addition of arrays in the GPU. The header needed to use openCL is cl.h and is under /usr/include/CL in your BSP

rootfs when you install the gpu-viv-bin-mx6q package. The header is typically included like this: #include <CL/cl.h> The libraries needed to link the program are libGAL.so and libOpenCL.so those are under /usr/lib in your BSP rootfs.

 

For details on the OpenCL API check the khronos page: http://www.khronos.org/opencl/


Our kernel source is as follows:

__kernel void VectorAdd(__global int* c, __global int* a,__global int* b)

{

     // Index of the elements to add

     unsigned int n = get_global_id(0);

     // Sum the nth element of vectors a and b and store in c

     c[n] = a[n] + b[n];

}

The kernel is declared with the signature

    __kernel void VectorAdd(__global int* c, __global int* a,__global int* b).

 

This takes vectors a and b as arguments adds them and stores the result in

the vector c. It looks like a normal C99 method except for the keywords kernel

and global. kernel tells the compiler this function is a kernel, global tells the

compiler this attributes are of global address space.

get_global_id built-in function

 

This function will tell us to which index of the vector this kernel corresponds

to. And in the last line the vectors are added. Below is the full source code

commented.

//************************************************************

// Demo OpenCL application to compute a simple vector addition

// computation between 2 arrays on the GPU

// ************************************************************

#include <stdio.h>

#include <stdlib.h>

#include <CL/cl.h>

//

// OpenCL source code

const char* OpenCLSource[] = {

"__kernel void VectorAdd(__global int* c, __global int* a,__global int* b)",

"{",

" // Index of the elements to add \n",

" unsigned int n = get_global_id(0);",

" // Sum the nth element of vectors a and b and store in c \n",

" c[n] = a[n] + b[n];",

"}"

};

// Some interesting data for the vectors

int InitialData1[20] = {37,50,54,50,56,0,43,43,74,71,32,36,16,43,56,100,50,25,15,17};

int InitialData2[20] = {35,51,54,58,55,32,36,69,27,39,35,40,16,44,55,14,58,75,18,15};

// Number of elements in the vectors to be added

#define SIZE 100

// Main function

// ************************************************************

int main(int argc, char **argv)

{

     // Two integer source vectors in Host memory

     int HostVector1[SIZE], HostVector2[SIZE];

     //Output Vector

     int HostOutputVector[SIZE];

     // Initialize with some interesting repeating data

     for(int c = 0; c < SIZE; c++)

     {

          HostVector1[c] = InitialData1[c%20];

          HostVector2[c] = InitialData2[c%20];

          HostOutputVector[c] = 0;

     }

     //Get an OpenCL platform

     cl_platform_id cpPlatform;

     clGetPlatformIDs(1, &cpPlatform, NULL);

     // Get a GPU device

     cl_device_id cdDevice;

     clGetDeviceIDs(cpPlatform, CL_DEVICE_TYPE_GPU, 1, &cdDevice, NULL);

     char cBuffer[1024];

     clGetDeviceInfo(cdDevice, CL_DEVICE_NAME, sizeof(cBuffer), &cBuffer, NULL);

     printf("CL_DEVICE_NAME: %s\n", cBuffer);

     clGetDeviceInfo(cdDevice, CL_DRIVER_VERSION, sizeof(cBuffer), &cBuffer, NULL);

     printf("CL_DRIVER_VERSION: %s\n\n", cBuffer);

     // Create a context to run OpenCL enabled GPU

     cl_context GPUContext = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, NULL);

     // Create a command-queue on the GPU device

     cl_command_queue cqCommandQueue = clCreateCommandQueue(GPUContext, cdDevice, 0, NULL);

     // Allocate GPU memory for source vectors AND initialize from CPU memory

     cl_mem GPUVector1 = clCreateBuffer(GPUContext, CL_MEM_READ_ONLY |

     CL_MEM_COPY_HOST_PTR, sizeof(int) * SIZE, HostVector1, NULL);

     cl_mem GPUVector2 = clCreateBuffer(GPUContext, CL_MEM_READ_ONLY |

     CL_MEM_COPY_HOST_PTR, sizeof(int) * SIZE, HostVector2, NULL);

     // Allocate output memory on GPU

     cl_mem GPUOutputVector = clCreateBuffer(GPUContext, CL_MEM_WRITE_ONLY,

     sizeof(int) * SIZE, NULL, NULL);

     // Create OpenCL program with source code

     cl_program OpenCLProgram = clCreateProgramWithSource(GPUContext, 7, OpenCLSource, NULL, NULL);

     // Build the program (OpenCL JIT compilation)

     clBuildProgram(OpenCLProgram, 0, NULL, NULL, NULL, NULL);

     // Create a handle to the compiled OpenCL function (Kernel)

     cl_kernel OpenCLVectorAdd = clCreateKernel(OpenCLProgram, "VectorAdd", NULL);

     // In the next step we associate the GPU memory with the Kernel arguments

     clSetKernelArg(OpenCLVectorAdd, 0, sizeof(cl_mem), (void*)&GPUOutputVector);

     clSetKernelArg(OpenCLVectorAdd, 1, sizeof(cl_mem), (void*)&GPUVector1);

     clSetKernelArg(OpenCLVectorAdd, 2, sizeof(cl_mem), (void*)&GPUVector2);

     // Launch the Kernel on the GPU

     // This kernel only uses global data

     size_t WorkSize[1] = {SIZE}; // one dimensional Range

     clEnqueueNDRangeKernel(cqCommandQueue, OpenCLVectorAdd, 1, NULL,

     WorkSize, NULL, 0, NULL, NULL);

     // Copy the output in GPU memory back to CPU memory

     clEnqueueReadBuffer(cqCommandQueue, GPUOutputVector, CL_TRUE, 0,

     SIZE * sizeof(int), HostOutputVector, 0, NULL, NULL);

     // Cleanup

     clReleaseKernel(OpenCLVectorAdd);

     clReleaseProgram(OpenCLProgram);

     clReleaseCommandQueue(cqCommandQueue);

     clReleaseContext(GPUContext);

     clReleaseMemObject(GPUVector1);

     clReleaseMemObject(GPUVector2);

     clReleaseMemObject(GPUOutputVector);

     for( int i =0 ; i < SIZE; i++)

          printf("[%d + %d = %d]\n",HostVector1[i], HostVector2[i], HostOutputVector[i]);

     return 0;

}


How to compile in Host

 

Get to your ltib folder and run

$./ltib m shell

This way you will be using the cross compiler ltib uses and the default include and lib directories will be the ones in your bsp. Then run

LTIB> gcc cl_sample.c -lGAL -lOpenCL -o cl_sample.


How to run in the i.MX6Q

 

Insert the GPU module

root@freescale/home/user $ modprobe galcore

Copy the compiled CL program and then run

root@freescale /home/user$ ./cl_sample


References

 

[1] ttp://www.khronos.org/opencl/

Original Attachment has been moved to: libOpenCL.so.zip

Original Attachment has been moved to: libCLC_Android.so.zip

Original Attachment has been moved to: libOpenCL_Android.so.zip

Original Attachment has been moved to: libCLC.so.zip

Labels (2)
Tags (2)
Comments

Hi, will OpenCL and these examples work on Android v4.0.4 (ICS) for i.MX6?
Thanks

You could build the app for linux and run it for android in the command line.

I have heard of CL on android NDK but I have downloaded NDK-r9c and I don't see the CL headers.

It's probably a custom project for other devices, but you can probably make it work on i.Mx6 ICS since we are OpenCL EP compliant.

BTW.

If you're android system doesn't have the CL library it will need to be copied by hand.

Michel

Hi,

I am also trying to use OpenCL on Android.(i.MX6, udoo board)

I took the libOpenCL.so from a linux installation and placed it onto the Android udoo board (since there was no libOpenCL.so on the Android version).

When I tried to load it, it missed these library's: ld-2.15.so / ld-linux.so.3 / libc.so.6 / libc-2.15.so / librt.so.1 and librt-2.15.so

I've found those library's on the Linux Udoo and moved them to the Android udoo board. But now I get this error:

01-02 00:01:12.810: E/dalvikvm(3206): dlopen("/system/lib/libOpenCL.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "librt.so.1" needed by "libOpenCL.so"; caused by soinfo_link_image(linker.cpp:1635): could not load library "libc.so.6" needed by "librt.so.1"; caused by soinfo_relocate(linker.cpp:1178): unknown reloc type 19 @ 0x689a13e0 (1193)


What I've found online (not that much) told me that these .so files are compiled with a compiler for linux that is not supported on Android.

Do you perhaps have more information about this issue or can guide me in the right directoin?

Kind regards,

Dries

Hi,

How are you using CL?  Are you using CL in NDK? Or is it a Linux program?

Michel

Hi,

thank you for reply. I'm using OpenCL in the android-ndk.

Dries

2014-04-16 16:10 GMT+01:00 Guillermo Michel Jimenez <

admin@community.freescale.com>:

<https://community.freescale.com/> OpenCL Hello World

new comment by Guillermo Michel Jimenez<https://community.freescale.com/people/ChucoChe?et=watches.email.document_comment> View

all comments on this document<https://community.freescale.com/docs/DOC-93984?et=watches.email.document_comment#comment-10750>

Ok, I'll try to provide you the openCL so for Android. I'll get back to you soon.

Michel

Thanks a lot, I am looking forward to it!

Dries

On my system(Ubuntu 12.04.3 by wandboard), I have to build with:

gcc -std=c99 opencl_sample.c -lOpenCL -lGAL -o opencl_sample

Notice: put OpenCL before GAL, otherwise will get error like:

/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../lib/libOpenCL.so: undefined reference to `gcUNIFORM_SetValueF'

What is the Android Freescale BSP version you're using?

Michel

I've downloaded the Android source from the udoo website here:

http://www.udoo.org/downloads/

(we have the 4.2 Android version right now)

I guess we need one of these software packages?

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab

Do you have a suggustion?

Dries

I don't think Freescale BSPs will work with the wand board. I'll verify if they do or if a CL so compiled for or Android BSP will work on the wand board android.

Michel

I am working on the Udoo board, but since it's +- the same hardware I guess

it won't make a difference. Hopefully there is a CL compiled for it or an

Android BSP. Any chance that if there is no CL now, that there will be one

in the future?

Hi,

I have attached the libraries for Android 4.3 in the freescale web page to the document.

There is currently no plans to support officially CL in the Android BSP

Michel

Thank you for the library's! With the libOpenCL.so I can compile OpenCL

programs and run it on the udoo board. The found here

https://github.com/mattscar/opencl_device_test works fine.

But, when I use my own code I get a CL_INVALID_KERNEL from the

clSetKernelArg function. So I still need to find out why I get that error.

Could you explain me what the libCLC.c is?

Thanks a lot for the support!

Dries

Hi,

lbCLC.so is the online kernel compiler.

Michel

The libOpenCL.so contains the function implementations and I can use those.

But building the kernel will always file (even if I port your example to

Android). It must be because I do not use the libCLC.so , but I have no

idea how I can make my program use the libCLC.so online kernel compiler.

Do you have an example or guide that can point me in the right direction?

Dries

I think the invalid kernel is a common error.

AndreSilva can you give us a hand?

Michel

We have a very good how-to documentation, I will upload it and past the link here.

regards,

Andre

Thank you for the documentation. But the problem I'm facing is that I do

not know how to call the libCLC online compiler.

Do I need to link to it somewhere?

Dries

It is done by clBuildProgram function, so you dont need to worry about it. Just take a look in the code attached on the documentation.

Hi,

I'm trying to run this code on an imx6q with open suse version installed but the function clGetDeviceIds gives me an segmentation fault. When i launch it with grind, it gives me the eroor when calling the function (gcoHAL_QuerySeparated3D2D in gc_hal_user_query).

I'm a beginner with openCL. Thanks in advance for your help.

Jerome

Hi Jerome, how did you installed the gpu package ? also, there is any other test (CL or GLES) already built that you could test ? just to make sure that the driver is working properly ?

thanks,

Andre

Hello

I try to run openCL on wbquard board. The operating system is debian Jessie.

Where I find the BSP Users Guide for the graphic driver as above-quoted?

Thanks for assistance

Although it is possible to setup your Jessie for OpenCL, personally I wouldn't bother. I spent a number of weeks testing the OpenCL EP implementation. Given that it is the EP (embedded profile) implementation it is very restrictive on the size of the kernel it can deal with and the API available (ie no atomics).

Hi

I am using the libOpenCL and libCLC files  provided in this post in Android 4.3 on a imx6Q Wandboard.  The usual apps that print the OpenCL device info work OK but when trying to build a cl program,  the call clBuildProgram fails and a further query on error returns 'fail to open temporary file./cl-xxxxxx for writing'.  I donot seem to get any further than this so would appreciate if anyone can confirm if the attached libs in this page are the expected libs to be used or the location where the correct libs are available.

Regards

Sateesh

anushreemoholkar Did you run into this problem?

Michel

Hi Anushree, Michel

I would be grateful if you can provide an update on this.

Sateesh

Hi All,

Is it possible to execute OpenCL ' Kernel from Gstreamer Plugin during running Gstreamer pipeline?

I want to use OpenCL from gstreamer plugin while running any video through gst-launch.

I am adding one sample Gstreamer Plugin (e.g. sampleocl-plugin) into the Gstreamer Pipeline. From 'sampleocl-plugin' i am creating OpenCL Context, creating two Image2D memory object using clCreateImage2D, creating & loading kernel, creating command queue, setargs for kernel (clSetKernelArg(.....,  &srcimage2D)  , clSetKernelArg(...., &dstimage3D)).

Then executing kernel clEnqueueNDRangeKernel with 2 dimensional NDRangeKernel, global work size set to global[0]=640, global[1]=480. & wait for completion of execution of kernel.

My kernel is simply doing memcpy from SRC image to DST image.

code snippet of kernel is :

////////////// START

__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

_kernel void copy_image (

__read_only image2d_t input,

__write_only image2d_t output)

{

  const int2 pos = {get_global_id(0), get_global_id(1)};

  float4 sum = read_imagef(input, sampler, pos);

  write_imagef (output, (int2)(pos.x, pos.y), sum);

}

/////////////// END

What i am observed here that, after completion of my kernel execution, i received only one pixel from SRC image to DST image & i.e from (x=0,y=0) only.

All global Work Items  {global[0]=640, global[0]=480 } MUST execute same Kernel & result MUST all pixels copied from SRC to DST.

I have done/ executed exactly same thing from one simple unit test (executable file), & its working fine. I received entire SRC image in DST image.

In gstreamer, only one pixel copied ? Is something wrong ?

Or any other way should i execute OpenCL from gstreamer ?

I am using YOCTO build system.

-Ankit.

Hi Sateesh,

Please find the libOpenCL_Android.so and libCLC_Android.so in the attachment put them in /system/lib folder.

Please let me know if they are useful or not.

Anushree

Hi, I copied the libOpenCL.so for android and ran this sample on android 4.0.4 in the command line, I get this error: link_image[1936]:  2599 could not load needed library 'libOpenCL.so' for 'cl_sample' (reloc_library[1285]:  2599 cannot locate 'gcGetUserDebugOption'... )CANNOT LINK EXECUTABLE . Do you have any suggustion?

Hi Michel, I copied the libOpenCL.so for android and ran this sample on android 4.0.4 in the command line, then I get this error: link_image[1936]:  2599 could not load needed library 'libOpenCL.so' for 'cl_sample' (reloc_library[1285]:  2599 cannot locate 'gcGetUserDebugOption'... )CANNOT LINK EXECUTABLE . Do you have any suggestion? Kind regards

Hi, I ran this sample on Android 4.0.4 with libOpenCL_Android.so, then I get the error: link_image[1936]:  2599 could not load needed library 'libOpenCL.so' for 'cl_sample' (reloc_library[1285]:  2599 cannot locate 'gcGetUserDebugOption'... )CANNOT LINK EXECUTABLE. Do you have any guidance for compiling these lib for Android?

Hi Cao,

I will try to reproduce this error and let you know.

Anushree

Hi Ankit,

can you send your entire application so I can test it myself ?

thanks,

Andre

Hi Andre,

Thank you for your response.

I have attached entire application on this link:: https://community.freescale.com/message/484166#484166

waiting for your response.

-Ankit.

Sorry for the late response, I will check your code and let you know soon as I get any information.

regards,

andre

Hi Ankit, I answered in the other thread you created (with the file attached), check it out.

cheers,

Andre

Hi,

I tried the sample on Android 4.2.2 with libOpenCL_Android.so and libCLC_Android.so. Unfortunately, it failed at clBuildProgram(OpenCLProgram, 0, NULL, NULL, NULL, NULL). And the error message as:

          [10:28:25]E/OGL-jni-Test( 3508): Error: Building Program (clBuildingProgram):-11

          [10:28:25]E/OGL-jni-Test( 3508): error : Failed to open the temporary file ./cl-0DB401. for writing

Any one met with it? Any idea for it?

In addition, related source code as:

     status = clBuildProgram(OpenCLProgram, 0, NULL, NULL, NULL, NULL);

     if (status != CL_SUCCESS) {

         LOGE("Error: Building Program (clBuildingProgram):%d\n",(int)status);

         size_t len;

         char buffer[8 * 1024];

          printf("Error: Failed to build program executable!\n");

          clGetProgramBuildInfo(OpenCLProgram, cdDevice, CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &len);

          LOGE("%s\n",buffer);

         //eturn ;

     }

Hi Spark,

I will try to reproduce an error and reply with correct libs.

Thanks,

Anushree

Hi Anushree,

How about your result? Did you encounter this same issue?

PS. My board is IMx6.

Thanks,

hi Andre

    As to the function "clBuildProgram()", there is an error when it has been invoked. The error code is -11 (CL_BUILD_PROGRAM_FAILURE) .

    When I use function "clGetProgramBuildInfo" to get the build log , an empty string was returned.

    However, I checked the CL_PROGRAM_BUILD_STATUS  and the build status return  CL_BUILD_SUCCESS which means the last call to    " clBuildProgram ()" on the  specified program object for device was successful,thus the build log should not be empty.

    Could you give some advice ?

regards,

Keerecles

Hi Keerecles,

are you loading the kernel from an external file ? if so, please check for extra spaces or lines on the file, it may cause this issue.

cheers,

andre

I have the exact same problem - clBuildProgram fails (-11) regardless of what I give it, whether an external file or a string in code. No build log is output. There doesn't seem to be any sort of libCLC dependency present - I can remove libCLC.so and nothing changes. Linker only appears to need libOpenCL and libGAL.

I am fairly confident I am doing the right things on the OpenCL side, as I've had OpenCL code running successfully on the same hardware on a different prebuilt image, and am trying to get opencl working on my custom ubuntu image now.

can you share your application so I can test it on my side ?

I don't see a way to attach files here, so I put together a basic file that demonstrates the problem on my end.

The source below attempts to load and build a test.cl file, but fails on building and produces an empty build log, whether I give it a valid or invalid file.

I've been linking with the libraries from gpu_viv_bin 3.0.35, and to reiterate, I can successfully run this example and other OpenCL code in general on a newer kernel with newer gpu drivers - it's just my attempts to add opencl to an older setup that are failing.

I'm happy to provide a compiled binary and the specific libraries I'm using if there's a good way for me to send them over.

----------------------------------------------

#include <fstream>

#include <iostream>

#define __CL_ENABLE_EXCEPTIONS

#include <CL/cl.hpp>

int main(int argc, char** argv)

{

    std::vector<cl::Platform> platforms;

    std::vector<cl::Device> devices;

    cl::Platform::get(&platforms);

    platforms[0].getDevices(CL_DEVICE_TYPE_ALL, &devices);

    cl::Context context(devices);

    cl::CommandQueue queue(context, devices[0]);

    std::ifstream source_file("test.cl");

    std::string source_string(std::istreambuf_iterator<char>(source_file), (std::istreambuf_iterator<char>()));

    const char* program_data = source_string.c_str();

    size_t program_size = source_string.length();

    cl::Program::Sources source(1, std::make_pair(program_data, program_size));

    cl::Program program(context, source);

    try

    {

        program.build(devices);

    }

    catch (cl::Error e)

    {

        std::cout << "OpenCL Error: " << e.what() << " : " << e.err() << std::endl;

        std::cout << "Build Log: " << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]) << std::endl;

        return 1;

    }

    std::cout << "Built Successfully" << std::endl;

    return 0;

}

please, share your CL code.

If anyone else comes across this problem in the future, I've managed to fix it for my case.

First thing to note is that libCLC.so does not have to be detected for the binary to run - if it can't find it clBuildProgram will just fail with no explanation as with the above symptom. You can check that libCLC.so is being found and read using something like strace.

Second, even if libCLC.so is found, clBuildProgram will still quietly fail if libCLC's dependencies are not found. Use ldd libCLC.so to check.

In my case I needed to upgrade libstdc++ to >= 3.20

Older vivante libraries may not have the same version dependencies - I've noticed quite a large amount of change and binary incompatibilities across different versions.

Hi Andre,

I've met exactly same problem when trying to run OpenCL Hello world on i.MX6q Android 6.0 BSP(kernel 4.1.15). 

 

When I create Android.mk I will need to include libVSC.so(using objectdump figured it out) in the dependency, otherwise it will fail to find gcXXXXX(CANNOT LINK EXECUTABLE: cannot locate symbol "gcSHADER_Destroy" referenced by "/system/lib/libOpenCL.so").

LOCAL_SHARED_LIBRARIES := \
libGAL \
libVSC \
libOpenCL \
libCLC \

After adding libVSC, the host executable compiled OK, so that I can run it on iMX6, 

However, if I run it on i.MX6 I will get a "Segmentation fault" when calling clBuildProgram, and I found something like this in logcat

01-01 18:15:21.069 3478 3478 F libc : Fatal signal 11 (SIGSEGV), code 2, fault addr 0xb6dd585c in tid 3478 (opencl)
01-01 18:15:21.171 218 218 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-01 18:15:21.171 218 218 F DEBUG : Build fingerprint: 'Ikegps/orca/orca:6.0.1/0.0.1-rc0/20171130:eng/release-keys'
01-01 18:15:21.171 218 218 F DEBUG : Revision: '0'
01-01 18:15:21.171 218 218 F DEBUG : ABI: 'arm'
01-01 18:15:21.171 218 218 F DEBUG : pid: 3478, tid: 3478, name: opencl >>> opencl <<<
01-01 18:15:21.172 218 218 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xb6dd585c
01-01 18:15:21.177 218 218 F DEBUG : r0 b6a7d748 r1 b6ddcdd3 r2 00000001 r3 00000069
01-01 18:15:21.177 218 218 F DEBUG : r4 b6a7d704 r5 ae4fc0d4 r6 b6dd585c r7 00000000
01-01 18:15:21.177 218 218 F DEBUG : r8 beb20550 r9 b6ddcdc8 sl 0000004f fp 0000000e
01-01 18:15:21.177 218 218 F DEBUG : ip 00000064 sp beb20448 lr b6e66057 pc b6e66066 cpsr 00010030
01-01 18:15:21.181 542 612 W NativeCrashListener: Couldn't find ProcessRecord for pid 3478
01-01 18:15:21.196 218 218 F DEBUG :
01-01 18:15:21.196 218 218 F DEBUG : backtrace:
01-01 18:15:21.197 218 218 E DEBUG : AM write failed: Broken pipe
01-01 18:15:21.197 218 218 F DEBUG : #00 pc 00015066 /system/lib/libVSC.so (gcSHADER_AddAttribute+209)
01-01 18:15:21.197 218 218 F DEBUG : #01 pc 00054f51 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #02 pc 00026e31 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #03 pc 0002722f /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #04 pc 000d319d /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #05 pc 000f5913 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #06 pc 00046e0d /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #07 pc 00018aa1 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #08 pc 0003a7b7 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #09 pc 00044d67 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #10 pc 00018a65 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #11 pc 0003ed03 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #12 pc 00018435 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #13 pc 0003eba9 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #14 pc 00018435 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #15 pc 0001711f /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #16 pc 00017497 /system/lib/libCLC.so
01-01 18:15:21.197 218 218 F DEBUG : #17 pc 00015f0f /system/lib/libCLC.so (gcCompileKernel+42)
01-01 18:15:21.197 218 218 F DEBUG : #18 pc 0000bbb9 /system/lib/libOpenCL.so (clBuildProgram+324)
01-01 18:15:21.197 218 218 F DEBUG : #19 pc 00000da1 /system/bin/opencl
01-01 18:15:21.197 218 218 F DEBUG : #20 pc 00017365 /system/lib/libc.so (__libc_init+44)
01-01 18:15:21.197 218 218 F DEBUG : #21 pc 00001060 /system/bin/opencl

 

Which got a fault addr when calling gcSHADER_AddAttribute....

 

!I am not sure if the libCLC_Android.so and libOpenCL_Android.so here is still usable for newer version kernel/Android BSP. If not, would somebody can help to build a version suits? 

I am going to try the Linux 4.1.15 BSP, But I doubt it is feasible to pull out the so from Linux build use as it is in Android? I known Android has different libc, etc. 

Would be much appreciated if you could provide any information.

Code is here if you'd like to have a look opencl-test-imx6/main.c at master · suyouxin/opencl-test-imx6 · GitHub 

Youxin

Version history
Revision #:
1 of 1
Last update:
‎01-18-2013 02:07 PM
Updated by: