Git Product home page Git Product logo

Comments (16)

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Update-
Build is successfull.
Please let me know how to include ACL with any app.
such as i ma running ssd model, so should it be like "./SSD acl_opencl"?

As running ./build/tests/bin/bench_sqz -r1 gives error-
Register reference's operators
terminate called after throwing an instance of 'cl::Error'
what(): empty
Aborted

I am using Ubuntu18 with ACL version18.05.
Thanks.

from tengine.

hey-yahei avatar hey-yahei commented on May 18, 2024

Reference: document for ACL Driver

  1. Firstly, can you successfully run ./build/tests/bin/bench_sqz with parameter -d acl_opencl to set gpu as default device?
  2. To include ACL with any app, call the function set_default_device("acl_opencl") in your own app just as tests/bin/bench_sqz.cpp do.
  3. If running several graphs in one app is needed, replace set_default_device function with set_graph_device to set different device for different graph.

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Hi,
Thanks for the reply.
I don't know what is happening, i am using rockpro64 board (RK3399). I did checked out ACL vers 18.05 and built that. But now not able to build Tengine again. As according to https://github.com/OAID/Tengine/blob/master/doc/acl_driver.md
i remove build/driver and then build again. Now it is throwing error every time-
In file included from acl_graph_device.hpp:35:0,
from acl_graph_driver.hpp:36,
from acl_graph_driver.cpp:25:
acl_graph.hpp: In member function ‘bool TEngine::CLGraph::AddConvolutionLayer(TEngine::Node*)’:
acl_graph.hpp:360:23: error: no matching function for call to ‘arm_compute::ActivationLayerInfo::ActivationLayerInfo()’
ActivationLayerInfo act_info;
....

2)Second doubt is-
In Tengine/example/CMakeList, there is a line-
if( NOT ANDROID)
add_subdirectory(caffe_wrapper)
endif()

If i comment these lines then it successfully build (WITHOUT ACL), and if i uncomment these lines it through error of "cublas_v2.h" : no such file or directory.

from tengine.

hey-yahei avatar hey-yahei commented on May 18, 2024

Hi, rahulsharma11

  1. Just double check, make sure that your ACL version is v18.05? As I know, class arm_compute::ActivationLayerInfo is added default constructor with no parameters after v18.02.
  2. If the version of ACL is right, try to reclone Tengine from github to your devices, check your path to ACL in makefile.config and make clean && make -j4 again.
    BTW, why not show your settings in makefile.config file which may help debug?
  3. Confused, cublas.h seems a header for CUDA library, and I can't find any source code of Tengine with cublas.h included. Can you show me more error information? For example, which source file includes it?

Thanks

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Hi,
i did checkout v18.05 for ACL, and did make clean and make again for Tengine.
It is successfully built.
I also did Sudo make install in Tengine to build examples.
Now while building examples, i am getting the error for cublas error.

  1. Firstly i built caffe separately from-
    https://github.com/BVLC/caffe
    And did -
    mkdir build
    cd build
    cmake ..
    make all
    make install
    make runtest
    Then while building examples, it was throwing error for caffe/caffe.h not found, so included the caffe path in CMakeList file in "Tengine/examples/caffe_wrapper/cpp_classification" and "Tengine/examples/caffe_wrapper/mtcnn". But now the error is for cublas again-
    here is the output-
    In file included from /home/rock64/rahul/caffe/include/caffe/common.hpp:19:0,
    from /home/rock64/rahul/caffe/include/caffe/blob.hpp:8,
    from /home/rock64/rahul/caffe/include/caffe/caffe.hpp:7,
    from /home/rock64/rahul/Tengine/examples/caffe_wrapper/mtcnn/caffe_mtcnn.hpp:27,
    from /home/rock64/rahul/Tengine/examples/caffe_wrapper/mtcnn/test_caffe_mtcnn.cpp:24:
    /home/rock64/rahul/caffe/include/caffe/util/device_alternate.hpp:34:10: fatal error: cublas_v2.h: No such file or directory
    #include <cublas_v2.h>
    ^~~~~~~~~~~~~
    compilation terminated.
    caffe_wrapper/mtcnn/CMakeFiles/CAFFE_MTCNN.dir/build.make:62: recipe for target 'caffe_wrapper/mtcnn/CMakeFiles/CAFFE_MTCNN.dir/test_caffe_mtcnn.cpp.o' failed
    make[2]: *** [caffe_wrapper/mtcnn/CMakeFiles/CAFFE_MTCNN.dir/test_caffe_mtcnn.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from /home/rock64/rahul/caffe/include/caffe/common.hpp:19:0,
    from /home/rock64/rahul/caffe/include/caffe/blob.hpp:8,
    from /home/rock64/rahul/caffe/include/caffe/caffe.hpp:7,
    from /home/rock64/rahul/Tengine/examples/caffe_wrapper/mtcnn/caffe_mtcnn.hpp:27,
    from /home/rock64/rahul/Tengine/examples/caffe_wrapper/mtcnn/caffe_mtcnn.cpp:24:
    /home/rock64/rahul/caffe/include/caffe/util/device_alternate.hpp:34:10: fatal error: cublas_v2.h: No such file or directory
    #include <cublas_v2.h>

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Changes in makefile.config file for Tengine-

#Set the path of caffe used for compile and link,
#if caffe's operator calculation is enabled.
CAFFE_ROOT = /home/rock64/rahul/caffe

#Enable GPU support by Arm Computing Library
CONFIG_ACL_GPU=y

#Use BLAS as the operator implementation

CONFIG_ARCH_BLAS=y

#Set the path of ACL
ACL_ROOT=/home/rock64/rahul/ComputeLibrary

from tengine.

hey-yahei avatar hey-yahei commented on May 18, 2024

Hi, rahulsharma11

Maybe you did not uncomment CONFIG_CAFFE_REF=y.
CONFIG_CAFFE_REF and CAFFE_ROOT should be setted at the same time.

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Oh sry, i forget to mention that also.
Yes i did uncomment CONFIG_CAFFE_REF=y.

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

And again i got error for

./build/tests/bin/bench_sqz -r1 gives error-
Register reference's operators
terminate called after throwing an instance of 'cl::Error'
what(): empty
Aborted

Now i am building Tengine again without ACL to double check the result.

from tengine.

hey-yahei avatar hey-yahei commented on May 18, 2024

Try to comment CONFIG_CAFFE_REF=y and CAFFE_ROOT to not build the reference operators wrapped on Caffe, then rebuild Tengine and examples again.

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Ok.
Will try that.

Also i confirm that if i build Tengine without ACL, then on ruuning "./build/tests/bin/bench_sqz -r1"
it gives successful results-
Register reference's operators
Register Driver: CaffeNode
Caffe Node Driver Initialized
Driver: CaffeNode probed 1 devices
tensor: prob created by node: prob is not consumed
add the node: prob into output list
Load model successfully
REPEAT COUNT= 1
Repeat [1] time 51573.00 us per RUN. used 51573 us
0.2763 - "n02123045 tabby, tabby cat"
0.2673 - "n02123159 tiger cat"
0.1766 - "n02119789 kit fox, Vulpes macrotis"
0.0827 - "n02124075 Egyptian cat"
0.0777 - "n02085620 Chihuahua"

Release Graph Executor for graph graph0
ALL TEST DONE
Release workspace default resource

And Examples are also build successfully.

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Hi,
I rebuilt Tengine by commneting Caffe and uncommnet ACL in makefile.config.
Results-
Tengine successfully built.
Tengine examples built but after commenting the following in CMakeList.txt in Tengine/examples
if( NOT ANDROID)
add_subdirectory(caffe_wrapper)
endif()

Error-
./build/tests/bin/bench_sqz -r1 throws-
terminate called after throwing an instance of 'cl::Error'
what(): empty
Aborted

And if i uncomment the following in Tengine/examples CMakeList.txt
if( NOT ANDROID)
add_subdirectory(caffe_wrapper)
endif()

Then Tengine examples throws error-
/home/rock64/rahul/caffe/include/caffe/util/device_alternate.hpp:34:10: fatal error: cublas_v2.h: No such file or directory
#include <cublas_v2.h>

I guess there is something not working with the version.

from tengine.

cyberfire avatar cyberfire commented on May 18, 2024

@rahulsharma11

It looks that it is probably that you forget to "make install" after building tengine library.
Would you please check that?

Thanks,

Haitao

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Hi,
Yes i did "make install" after tengine make.
I have freshly cloned both Compute library and Tengine. Builded Computelibrary by-
"aarch64-linux-gnu-gcc opencl-1.2-stubs/opencl_stubs.c -Iinclude -shared -o build/libOpenCL.so
scons Werror=0 -j4 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
wget ftp://ftp.openailab.net/tools/script/Computelibrary/Makefile
sudo make install"

Then in Tengine makefile.config, provided the ACL path. Tengine is built successfully.
Issue is with Tengine/Eaxmples.
Can you please confirm this for examples?
I am getting same error-
terminate called after throwing an instance of 'cl::Error'
what(): empty
Aborted

Without ACL everything is fine.
Thanks,

from tengine.

hey-yahei avatar hey-yahei commented on May 18, 2024

Hi,

It seems that there is something wrong with ACL.

Try to rebuild it by following the document ARM Compute Library Driver

scons Werror=1 -j4 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a

but not
arch64-linux-gnu-gcc opencl-1.2-stubs/opencl_stubs.c -Iinclude -shared -o build/libOpenCL.so scons Werror=0 -j4 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a wget ftp://ftp.openailab.net.cn/tools/script/Computelibrary/Makefile sudo make install

Thanks

from tengine.

rahulsharma11 avatar rahulsharma11 commented on May 18, 2024

Hi,
Now it is working.
What i did-

  1. Rebuild Compute library with "neon=0".
  2. Downloaded libmali from "https://goo.gl/25dk2r"
  3. linked /usr/lib/aarch64-linux-gnu/libOpenCL.so.1.0.0 with "libmali-midgaurd-t86-r14p0-fbdev.so" in lib folder.
    Then it worked.
    Thanks for the support.

from tengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.