This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compute library run OpenCL examples

Hi

I've recently got over the Compute Library OPenCL.so problem and have moved on to trying to run the examples. I compiled natively on an Odroid XU4 with neon=1 and opencl=1 using "scons Werror=1 -j8 debug=0 neon=1 opencl=1 os=linux arch=armv7a build=native" 

I could run the neon example ok:-

    odroid@odroid:~/ComputeLibrary-17.12/build/examples$ LD_LIBRARY_PATH=~/ComputeLibrary-17.12/build ./neon_convolution

    ./neon_convolution

    Usage: ./build/neon_convolution [input_image.ppm]

    No input_image provided, creating a dummy 640x480 image

    Test passed

When trying the opencl version :-

odroid@odroid:~/ComputeLibrary-17.12/build/examples$ LD_LIBRARY_PATH=~/ComputeLibrary-17.12/build ./cl_convolution

    ./cl_convolution

    Usage: ./build/cl_convolution [input_image.ppm]

    No input_image provided, creating a dummy 640x480 image
    !!!!!!!!!!!!!!!!!!!!!!!!!!!

    ERROR in load_program src/core/CL/CLKernelLibrary.cpp:765: Kernel file ./cl_kernels/convolution3x3.cl does not exist. No such file or directory
    !!!!!!!!!!!!!!!!!!!!!!!!!!!

    Test FAILED

This looks like an OpenCL run/compile failure!
I copied the cl_kernels directory from ~/ComputeLibrary-17.12/src/core/CL into ~/ComputeLibrary-17.12/build/examples and ran it again:-

odroid@odroid:~/ComputeLibrary-17.12/build/examples$ LD_LIBRARY_PATH=~/ComputeLibrary-17.12/build ./cl_convolution

    ./cl_convolution

    Usage: ./build/cl_convolution [input_image.ppm]

    No input_image provided, creating a dummy 640x480 image

    Test passed

Is there some $PATH or other ENV value that needs set up, so that the scons compiled build code points to the original source directory rather than in the build directory or is there something I've missed in the Scons command?

Dave

Parents
  • Thank you, this really help,but I got error after that, here is the detail:

    I've find libOpencL.so in the above directory, when I run:

         string libmali.so | grep Opencl,

    I got :

        OpenCL 1.1 

    but when I compile Compute Library, I got error:  

         ./arm_compute/core/Coordinates.h:37:7: error: base class 'class arm_compute::Dimensions<int>' has a non-virtual  destructor [-Werror=effc++]

          class Coordinates : public Dimensions<int>

    In this issue:  Compiling error on allwinner A20 board , AnthonyARM said it might be a toolchain version problem.

    After that, I change my odroid to ubuntu16.04 mate, and the OpenCL version is 1.2. I use : 

        ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so libOpenCL.so 

    to put a symlink in my ComputeLibrary/build directory, and then run:

        scons Werror=1 -j8 debug=0 neon=1 opencl=1 os=linux arch=armv7a build=native embed_kernels=1 

    got error:

       

    build/src/graph/Graph.os: In function `cl::CommandQueue::makeDefault()':
    Graph.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xc6): undefined reference to `clCreateCommandQueue'
    build/src/graph/Graph.os: In function `cl::Device::makeDefault()':
    Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0x94): undefined reference to `clGetContextInfo'
    Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xc8): undefined reference to `clGetContextInfo'
    build/src/graph/Graph.os: In function `cl::Context::makeDefault()':
    Graph.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x7e): undefined reference to `clCreateContextFromType'
    collect2: error: ld returned 1 exit status
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::CommandQueue::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xf0): undefined reference to `clCreateCommandQueue'
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::Device::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xaa): undefined reference to `clGetContextInfo'
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xde): undefined reference to `clGetContextInfo'
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::Context::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x92): undefined reference to `clCreateContextFromType'
    collect2: error: ld returned 1 exit status

    my ComputeLibrary version is 17.12.  do you have any advice about this? Or how do you compile ComputeLibaray on odroid-xu4?

    thanks

    zk

Reply
  • Thank you, this really help,but I got error after that, here is the detail:

    I've find libOpencL.so in the above directory, when I run:

         string libmali.so | grep Opencl,

    I got :

        OpenCL 1.1 

    but when I compile Compute Library, I got error:  

         ./arm_compute/core/Coordinates.h:37:7: error: base class 'class arm_compute::Dimensions<int>' has a non-virtual  destructor [-Werror=effc++]

          class Coordinates : public Dimensions<int>

    In this issue:  Compiling error on allwinner A20 board , AnthonyARM said it might be a toolchain version problem.

    After that, I change my odroid to ubuntu16.04 mate, and the OpenCL version is 1.2. I use : 

        ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so libOpenCL.so 

    to put a symlink in my ComputeLibrary/build directory, and then run:

        scons Werror=1 -j8 debug=0 neon=1 opencl=1 os=linux arch=armv7a build=native embed_kernels=1 

    got error:

       

    build/src/graph/Graph.os: In function `cl::CommandQueue::makeDefault()':
    Graph.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xc6): undefined reference to `clCreateCommandQueue'
    build/src/graph/Graph.os: In function `cl::Device::makeDefault()':
    Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0x94): undefined reference to `clGetContextInfo'
    Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xc8): undefined reference to `clGetContextInfo'
    build/src/graph/Graph.os: In function `cl::Context::makeDefault()':
    Graph.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x7e): undefined reference to `clCreateContextFromType'
    collect2: error: ld returned 1 exit status
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::CommandQueue::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xf0): undefined reference to `clCreateCommandQueue'
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::Device::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xaa): undefined reference to `clGetContextInfo'
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xde): undefined reference to `clGetContextInfo'
    build/examples/neoncl_scale_median_gaussian.o: In function `cl::Context::makeDefault()':
    neoncl_scale_median_gaussian.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x92): undefined reference to `clCreateContextFromType'
    collect2: error: ld returned 1 exit status

    my ComputeLibrary version is 17.12.  do you have any advice about this? Or how do you compile ComputeLibaray on odroid-xu4?

    thanks

    zk

Children