Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find the boost library #114

Closed
XiaoMaol opened this issue Jul 17, 2017 · 10 comments
Closed

Cannot find the boost library #114

XiaoMaol opened this issue Jul 17, 2017 · 10 comments

Comments

@XiaoMaol
Copy link

Dear all:

I currently trying to use ck-caffe to download caffe on my mali-GPU. After downloading the necessary components, I use the command
ck install package:lib-caffe-bvlc-opencl-clblast-universal --env.DISABLE_DEVICE_HOST_UNIFIED_MEMORY=ON --env.CK_HOST_CPU_NUMBER_OF_PROCESSORS=2 to download Caffe.
But it seems that ck-caffe is trying to find Boost Library in a wrong directory:
I have download Boost in my own preferred location:
ck_caffe_issue1_1
However, whenever I run the above mentioned command, ck tries to find the boost in the location

/usr/lib and gives me following error message:
ck-caffe-issue1_3

I have tried to change the environment variable with

 export BOOST_INCLUDEDIR=$HOME/Documents/SummerResearch/boost_installation/include/ 
 export BOOST_ROOT=$HOME/Documents/SummerResearch/boost_installation 

However, ck is still trying to find boost using the directory /usr/lib

so I tried to get around the problem through soft-link by setting

sudo ln -sf /home/odroid/Documents/SummerResearch/boost_installation/include/boost/ /usr/lib/boost

so now, ck install could find the boost, but it cannot find certain boost_library, giving me the error message:
ck-caffe_issue1_2

and I am sure that I have the required library in the directory

/home/odroid/Documents/SummerResearch/boost_installation/lib 

Could you please give me some help? Thanks!

@dohai90
Copy link

dohai90 commented Jul 18, 2017

@XiaoMaol , Hello, It's nice to know that you are using ck-caffe with mali GPU because I'm doing so :D
I faced your problem some days ago, and I worked around to overcome with this problem as follow:

  1. sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev libboost-all-dev
  2. Go to boost homepage and download the lastest boost library (v1.64 as I remember).
  3. ./boostrap.sh --prefix=/usr/local
  4. Build it with command: ./b2
  5. Final install it: sudo ./b2 install

And when you install ck-caffe, the program will realize that you have 2 boost libraries on your system, so let's choose manually built version (v1.64 in this case) and bingo :) Hope this help

I have installed ck-caffe on Odroid Xu4 which running ubuntu 16.04. I wonder how to install optimized blast version for mali GPU because when I chose blast for mali GPU and built caffe but failed. @psyhtest , Would you help me with this case? And I also have one more question that how can I use ck-caffe with float16, will it improve inference time? I'm intent on running YOLO for real time object detection using mali GPU and ck-caffe :)

@psyhtest
Copy link
Member

First of all, @XiaoMaol @dohai90, it's nice of you both to use CK-Caffe. Thanks for your interest! :)

@XiaoMaol It's a bit weird that CK didn't offer to install Boost when it failed to find it in the system path (/use/lib) but perhaps it was a partial installation. As @dohai90 noted, it is not sufficient to just download Boost - you need to build it. Unfortunately, it's a bit of a pain to do so. Fortunately, CK automates this as well!

Please try the following sequence of steps:

$ ck pull repo:ck-math
$ ck rm env --tags=lib,boost
$ ck install package:lib-boost-1.64.0
$ ck install package:lib-caffe-bvlc-opencl-clblast-universal \
  --env.DISABLE_DEVICE_HOST_UNIFIED_MEMORY=ON \
  --env.CK_HOST_CPU_NUMBER_OF_PROCESSORS=2

Does this resolve your issue?

@psyhtest
Copy link
Member

@dohai90, please try building Caffe w/ CLBlast with the above flags. I suspect your failure relates to this workaround not being enabled. If this doesn't help, please open a separate issue and provide more information.

We don't yet support building Caffe with FP16, although the OpenCL branch already supports it. I'll open an enhancement request.

It's cool you want to run YOLO! Have you already converted it to Caffe? Have you considered YOLO v2 as well? Really curios to hear about your results!

@jialiang19
Copy link

jialiang19 commented Jul 19, 2017

I had a similar problem of finding boost library, and after following @psyhtest's guide, I solve the problem.

@XiaoMaol
Copy link
Author

Hey @dohai90, thank you so much for giving me advice! and I am so glad to hear that you are doing real time object detection using Mali.

Hey @psyhtest, thank you so much for your help as well. Currently, I finally have successfully download Caffe! :)

Here is the picture:

ck2_1

@psyhtest
Copy link
Member

psyhtest commented Jul 20, 2017

@XiaoMaol, great to hear this worked for you. And you, @jialiang19.

P.S. Wow! Your Odroid (XU4?) board has the OpenCL driver of revision 14.0, whereas the latest one can download from the ARM Mali drivers' page is 12.0...

@gfursin
Copy link
Contributor

gfursin commented Jul 23, 2017

By the way, in the cases, when "correct" version of dependency such as Boost is installed in an unusual path, it is possible to detect it first (before installing Caffe via CK) while giving CK extra paths to search libraries like this:

$ ck detect soft:lib.boost --search_dirs={ROOT dir of correct boost}

and then continue installing Caffe via CK.

Another note - rather than calling ./caffe device_query, you can also use the CK front-end for Caffe (we are trying to unify AI APIs):

$ ck run program:caffe --cmd_key=query_gpu_opencl

Hope it's of any help and thanks again for your interest!

@Lmy0217
Copy link

Lmy0217 commented Aug 12, 2017

@dohai90 @psyhtest, I get similar error of finding boost library when I use the command

$ ck install package:lib-caffe-bvlc-opencl-libdnn-clblast-universal \
  --target_os=android24-arm-v7a \
  --env.DISABLE_DEVICE_HOST_UNIFIED_MEMORY=ON  \
  --env.CK_HOST_CPU_NUMBER_OF_PROCESSORS=2

the error message is

CMake Error at /usr/share/cmake-3.2/Modules/FindBoost.cmake:1201 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.64.0

  Boost include path:
  /home/*****/CK-TOOLS/lib-boost-acl-1.64.0-llvm-android-ndk-5.0.300080-android24-arm-v7a-32/install/include


  Could not find the following static Boost libraries:

          boost_thread
          boost_filesystem

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.

the boost include path in error message is CK-TOOLS subdirectory. I check this directory and I find only 7 files in folder install/lib as follows

libboost_chrono.a
libboost_prg_exec_monitor.a
libboost_program_options.a
libboost_system.a
libboost_test_exec_monitor.a
libboost_timer.a
libboost_unit_test_framework.a

so I use the command

ck install package:lib-boost-1.64.0-acl --target_os=android24-arm-v7a

to rebuild this boost but not more file.

is there anything wrong?

@psyhtest
Copy link
Member

psyhtest commented Aug 14, 2017

@Lmy0217 You are using a wrong package package:lib-boost-1.64.0-acl. It's a special version I prepared to use with the ARM Compute Library. Please try:

$ ck rm env --tags=lib,boost,android24-arm-v7a
$ ck install package:lib-boost-1.64.0  --target_os=android24-arm-v7a
$ ck install package:lib-caffe-bvlc-opencl-libdnn-clblast-universal \
  --target_os=android24-arm-v7a \
  --env.DISABLE_DEVICE_HOST_UNIFIED_MEMORY=ON \
  --env.CK_HOST_CPU_NUMBER_OF_PROCESSORS=2

@Lmy0217
Copy link

Lmy0217 commented Aug 17, 2017

it's successfully installed, thanks. @psyhtest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants