Caffe: `/usr/bin/ld: cannot find -lproto` when opencl branch building

Created on 17 May 2017  ·  9Comments  ·  Source: BVLC/caffe

I'm trying to build opencl branch with
that document like this cmake setting.

$ cmake .. -DUSE_GREENTEA=ON -DUSE_CUDA=OFF -DViennaCL_INCLUDE_DIR=$HOME/local/include -DOPENCL_LIBRARIES=/opt/intel/opencl/libOpenCL.so -DOPENCL_INCLUDE_DIRS=/opt/intel/opencl/include -DCNAJE_BUILD_TYPE=Release
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- Found lmdb    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)
-- -- CUDA is disabled. Building without it...
-- Found ViennaCL include: /home/delta/local/include
-- Found OpenCL include: /opt/intel/opencl/include;/usr/include
-- OpenCV found (/usr/share/OpenCV)
-- Found OpenBLAS libraries: /usr/lib/libopenblas.so
-- Found OpenBLAS include: /usr/include
-- NumPy ver. 1.11.0 found (include: /usr/lib/python2.7/dist-packages/numpy/core/include)
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   python
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   1.0-1028-g0f19d3e
--   System            :   Linux
--   C++ compiler      :   /usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -fPIC -Wall -std=c++11 -DCMAKE_BUILD -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -fPIC -Wall -std=c++11 -DCMAKE_BUILD -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   OFF
--   USE_OPENCV        :   ON
--   USE_FFT           :   OFF
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   OFF
--   ALLOW_LMDB_NOLOCK :   OFF
--   USE_HDF5          :   ON
-- 
-- Dependencies:
--   BLAS              :   Yes (open)
--   Boost             :   Yes (ver. 1.58)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.0.0)
--   lmdb              :   Yes (ver. 0.9.17)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.3)
--   OpenCV            :   Yes (ver. 2.4.9.1)
--   CUDA              :   No
-- 
-- Python:
--   Interpreter       :   /usr/bin/python2.7 (ver. 2.7.12)
--   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
--   NumPy             :   /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0)
-- 
-- Documentaion:
--   Doxygen           :   /usr/bin/doxygen (1.8.11)
--   config_file       :   /home/delta/git/caffe/.Doxyfile
-- 
-- Install:
--   Install path      :   /home/delta/git/caffe/build/install
-- 
-- Configuring done
CMake Warning (dev) in src/caffe/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "caffe" has an INTERFACE_LINK_LIBRARIES property which differs from
  its LINK_INTERFACE_LIBRARIES properties.

  INTERFACE_LINK_LIBRARIES:

    caffeproto;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libglog.so;/usr/lib/x86_64-linux-gnu/libgflags.so;$<$<NOT:$<CONFIG:DEBUG>>:/usr/local/lib/libprotobuf.so>;$<$<CONFIG:DEBUG>:/usr/local/lib/libprotobuf.so>;-lpthread;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/liblmdb.so;/usr/lib/x86_64-linux-gnu/libleveldb.so;/opt/intel/opencl/libOpenCL.so;opencv_core;opencv_highgui;opencv_imgproc;/usr/lib/libopenblas.so;/usr/lib/x86_64-linux-gnu/libboost_python.so

  LINK_INTERFACE_LIBRARIES:

    caffeproto;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libglog.so;/usr/lib/x86_64-linux-gnu/libgflags.so;/usr/local/lib/libprotobuf.so;-lpthread;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5_hl.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/delta/.pyenv/versions/anaconda3-4.3.0/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/liblmdb.so;/usr/lib/x86_64-linux-gnu/libleveldb.so;/opt/intel/opencl/libOpenCL.so;opencv_core;opencv_highgui;opencv_imgproc;/usr/lib/libopenblas.so;/usr/lib/x86_64-linux-gnu/libboost_python.so

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/delta/git/caffe/build

and make it but i get /usr/bin/ld: cannot find -lproto error

$ make -j4
...
[ 88%] Linking CXX executable net_speed_benchmark
[ 88%] Linking CXX executable finetune_net
/usr/bin/ld: -lproto が見つかりません
collect2: error: ld returned 1 exit status
tools/CMakeFiles/net_speed_benchmark.dir/build.make:130: ターゲット 'tools/net_speed_benchmark' のレシピで失敗しました
make[2]: *** [tools/net_speed_benchmark] エラー 1
CMakeFiles/Makefile2:543: ターゲット 'tools/CMakeFiles/net_speed_benchmark.dir/all' のレシピで失敗しました
make[1]: *** [tools/CMakeFiles/net_speed_benchmark.dir/all] エラー 2
make[1]: *** 未完了のジョブを待っています....
[ 88%] Linking CXX executable upgrade_net_proto_binary
/usr/bin/ld: -lproto が見つかりません
collect2: error: ld returned 1 exit status
tools/CMakeFiles/finetune_net.dir/build.make:130: ターゲット 'tools/finetune_net' のレシピで失敗しました
make[2]: *** [tools/finetune_net] エラー 1
CMakeFiles/Makefile2:505: ターゲット 'tools/CMakeFiles/finetune_net.dir/all' のレシピで失敗しました
make[1]: *** [tools/CMakeFiles/finetune_net.dir/all] エラー 2
/usr/bin/ld: -lproto が見つかりません
collect2: error: ld returned 1 exit status
tools/CMakeFiles/upgrade_net_proto_binary.dir/build.make:130: ターゲット 'tools/upgrade_net_proto_binary' のレシピで失敗しました
make[2]: *** [tools/upgrade_net_proto_binary] エラー 1
CMakeFiles/Makefile2:581: ターゲット 'tools/CMakeFiles/upgrade_net_proto_binary.dir/all' のレシピで失敗しました
make[1]: *** [tools/CMakeFiles/upgrade_net_proto_binary.dir/all] エラー 2
[ 88%] Linking CXX executable caffe
/usr/bin/ld: -lproto が見つかりません
collect2: error: ld returned 1 exit status
tools/CMakeFiles/caffe.bin.dir/build.make:130: ターゲット 'tools/caffe' のレシピで失敗しました
make[2]: *** [tools/caffe] エラー 1
CMakeFiles/Makefile2:467: ターゲット 'tools/CMakeFiles/caffe.bin.dir/all' のレシピで失敗しました
make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] エラー 2
Makefile:127: ターゲット 'all' のレシピで失敗しました
make: *** [all] エラー 2

Operating system: ubuntu 14.04
Compiler: gcc 5.4.0
CUDA version (if applicable):
CUDNN version (if applicable):
BLAS: open
Python or MATLAB version (for pycaffe and matcaffe respectively): anaconda3-4.3.0

OpenCL bug

All 9 comments

hi,I think u need install googleprotobuffer

Use caffe on ubuntu u would better read caffe wiki on ubuntu or mac etc. if u run on windows the caffe source code need fix an error that cannot find some layer .the code I have written on my question at this issues,but still another error I cann't fix it.

It's a bug, will fix asap.

Should be fixed.

This looks like commit 30a2ab7e50 if broken.

Looks like we also need rename proto to caffeproto in cmake/Targets.cmake

Something like this:
--- a/cmake/Targets.cmake
+++ b/cmake/Targets.cmake
@@ -12,14 +12,14 @@ macro(caffe_set_caffe_link)
endforeach()
endif()
if(BUILD_SHARED_LIBS)
- set(Caffe_LINK caffe proto)
+ set(Caffe_LINK caffe caffeproto)
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set(Caffe_LINK -Wl,-force_load caffe -Wl,-force_load proto)
+ set(Caffe_LINK -Wl,-force_load caffe -Wl,-force_load caffeproto)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- set(Caffe_LINK -Wl,--whole-archive caffe proto -Wl,--no-whole-archive)
+ set(Caffe_LINK -Wl,--whole-archive caffe caffeproto -Wl,--no-whole-archive)
elseif(MSVC)
- set(Caffe_LINK caffe proto)
+ set(Caffe_LINK caffe caffeproto)
endif()
endif()
endmacro()

Thanks,
Val.

  1. make -j4 succeeded with @naibaf7 commit https://github.com/BVLC/caffe/commit/e0f77c3b5f4837615f05b097ba3f2a05d7413e58 Thank you.
  2. make runtest -j4 failed because EXAMPLES_SOURCE_DIR macro is not defined.
    EXAMPLES_SOURCE_DIR is defined here but when cmake building it isn't defined.
    So I need sed -e 's/\#define CUDA_TEST_DEVICE/\#define CUDA_TEST_DEVICE \n\#define EXAMPLES_SOURCE_DIR "\/home\/delta\/git\/caffe\/examples\/"/g' -i ./caffe_config.h and test works.
  3. some test failed. The most serious is Segmentation fault on clFinish.

hardware: Surface Pro3
os: ubuntu14.04
SDK: OpenCL 1.2, beignet 1.4 (git-beaf26f)
CPU: Core i5 4300U HD4400 (Haswell)

$ ./tools/caffe device_query -gpu all
I0518 16:19:30.288357 13602 common.cpp:433] Total devices: 1
I0518 16:19:30.288759 13602 common.cpp:434] CUDA devices: 0
I0518 16:19:30.288827 13602 common.cpp:435] OpenCL devices: 1
I0518 16:19:30.288887 13602 common.cpp:459] Device id:                     0
I0518 16:19:30.288947 13602 common.cpp:461] Device backend:                OpenCL
I0518 16:19:30.289026 13602 common.cpp:463] Backend details:               Intel: OpenCL 1.2 beignet 1.4 (git-beaf26f)
I0518 16:19:30.289121 13602 common.cpp:465] Device vendor:                 Intel
I0518 16:19:30.289168 13602 common.cpp:467] Name:                          Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
I0518 16:19:30.289214 13602 common.cpp:469] Total global memory:           2021654528

SyncedMemoryTest

[ RUN      ] SyncedMemoryTest.TestGPURead
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
/home/delta/git/caffe/src/caffe/test/test_syncedmem.cpp:129: Failure
Value of: 2
Expected: (static_cast<char*>(recovered_value))[i]
Which is: '\x1' (1)
[  FAILED  ] SyncedMemoryTest.TestGPURead (1 ms)
[----------] 7 tests from SyncedMemoryTest (2 ms total)

CPUDevice

https://pastebin.com/1Xk3hi9a

[----------] 26 tests from NetTest/1, where TypeParam = caffe::CPUDevice<double>
[ RUN      ] NetTest/1.TestGetBlob
[       OK ] NetTest/1.TestGetBlob (0 ms)
[ RUN      ] NetTest/1.TestBottomNeedBackwardForce
[       OK ] NetTest/1.TestBottomNeedBackwardForce (1 ms)
[ RUN      ] NetTest/1.TestReshape
Build Status = -2 ( Err = -11 )
Log: stringInput.cl:111:49: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
stringInput.cl:20:15: note: expanded from macro 'Dtype'
...
unknown file: Failure
C++ exception with description "ViennaCL: FATAL ERROR: CL_INVALID_PROGRAM_EXECUTABLE.
If you think that this is a bug in ViennaCL, please report it at [email protected] and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!" thrown in the test body.
[  FAILED  ] NetTest/1.TestReshape, where TypeParam = caffe::CPUDevice<double> (159 ms)

Segmentation fault on clFinish

[----------] Global test environment tear-down
[==========] 2100 tests from 276 test cases ran. (1667193 ms total)
[  PASSED  ] 2098 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] NetTest/1.TestReshape, where TypeParam = caffe::CPUDevice<double>
[  FAILED  ] SyncedMemoryTest.TestGPURead

 2 FAILED TESTS
*** Aborted at 1495090803 (unix time) try "date -d @1495090803" if you are using GNU date ***
PC: @     0x7f70632e9688 clFinish
*** SIGSEGV (@0x400000218) received by PID 12814 (TID 0x7f7065513ac0) from PID 536; stack trace: ***
    @     0x7f70642ff390 (unknown)
    @     0x7f70632e9688 clFinish
    @     0x7f7064f9d62a caffe::SyncedMemory::~SyncedMemory()
    @           0x9109c2 boost::detail::sp_counted_impl_p<>::dispose()
    @           0x8e3f3a boost::detail::sp_counted_base::release()
    @           0x912222 boost::detail::sp_counted_impl_p<>::dispose()
    @     0x7f7064ce6b59 boost::detail::sp_counted_impl_p<>::dispose()
    @     0x7f7064ce3fe8 std::vector<>::~vector()
    @     0x7f7061ec136a __cxa_finalize
    @     0x7f7064cddef3 (unknown)
Segmentation fault (core dumped)

also benchmark

$ ./tools/caffe time -model ../models/bvlc_alexnet/deploy.prototxt -gpu 0
I0518 14:28:17.989312  7905 caffe.cpp:391] Use GPU with device ID 0
I0518 14:28:18.069370  7905 device.cpp:62] CL_DEVICE_HOST_UNIFIED_MEMORY: 1
I0518 14:28:19.164757  7905 net.cpp:57] Initializing net from parameters: 
name: "AlexNet"
...
I0518 14:31:27.541334  7905 caffe.cpp:469] Average Forward pass: 3.68935e+11 ms.
I0518 14:31:27.541369  7905 caffe.cpp:471] Average Backward pass: 1112.85 ms.
I0518 14:31:27.541389  7905 caffe.cpp:473] Average Forward-Backward: 3.68935e+11 ms.
I0518 14:31:27.541406  7905 caffe.cpp:475] Total Time: 1.84467e+13 ms.
I0518 14:31:27.541422  7905 caffe.cpp:476] *** Benchmark ends ***
*** Aborted at 1495085487 (unix time) try "date -d @1495085487" if you are using GNU date ***
PC: @     0x7f1fec302685 clFinish
*** SIGSEGV (@0xffffffffffffffff) received by PID 7905 (TID 0x7f1fed94bac0) from PID 18446744073709551615; stack trace: ***
    @     0x7f1feb9d34b0 (unknown)
    @     0x7f1fec302685 clFinish
    @     0x7f1fed3d662a caffe::SyncedMemory::~SyncedMemory()
    @     0x7f1fed18a262 boost::detail::sp_counted_impl_p<>::dispose()
    @     0x7f1fed12550a boost::detail::sp_counted_base::release()
    @     0x7f1fed125a2d boost::detail::sp_counted_impl_p<>::dispose()
    @     0x7f1fed11fb59 boost::detail::sp_counted_impl_p<>::dispose()
    @     0x7f1fed11cfe8 std::vector<>::~vector()
    @     0x7f1feb9d836a __cxa_finalize
    @     0x7f1fed116ef3 (unknown)
zsh: segmentation fault (core dumped)  ./tools/caffe time -model ../models/bvlc_alexnet/deploy.prototxt -gpu 0

Should We report a new issue?
Or it may be a beignet bug...?

Thanks.

@legokichi Ok I'll look into it. Yes you could try the proprietary Intel drivers as an alternative to check if they run any better meanwhile.

@naibaf7 I change Intel driver (here is the clinfo result)

$ ./tools/caffe device_query
I0519 20:50:38.733840 11750 common.cpp:433] Total devices: 1
I0519 20:50:38.734081 11750 common.cpp:434] CUDA devices: 0
I0519 20:50:38.734099 11750 common.cpp:435] OpenCL devices: 1
I0519 20:50:38.734107 11750 common.cpp:459] Device id:                     0
I0519 20:50:38.734114 11750 common.cpp:461] Device backend:                OpenCL
I0519 20:50:38.734138 11750 common.cpp:463] Backend details:               Intel(R) Corporation: OpenCL 1.2 LINUX
I0519 20:50:38.734163 11750 common.cpp:465] Device vendor:                 Intel(R) Corporation
I0519 20:50:38.734176 11750 common.cpp:467] Name:                          Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
I0519 20:50:38.734329 11750 common.cpp:469] Total global memory:           4044312576

benchmark works without segfault.

$ tools/caffe time -model ../models/bvlc_alexnet/deploy.prototxt -gpu 0
I0519 19:48:51.957670  9651 caffe.cpp:391] Use GPU with device ID 0
I0519 19:48:52.070819  9651 device.cpp:62] CL_DEVICE_HOST_UNIFIED_MEMORY: 1
I0519 19:49:02.506319  9651 net.cpp:57] Initializing net from parameters: 
name: "AlexNet"
...
I0519 19:58:50.314121  9651 caffe.cpp:469] Average Forward pass: 5247.06 ms.
I0519 19:58:50.314211  9651 caffe.cpp:471] Average Backward pass: 6389.42 ms.
I0519 19:58:50.314231  9651 caffe.cpp:473] Average Forward-Backward: 11636.9 ms.
I0519 19:58:50.314245  9651 caffe.cpp:475] Total Time: 581843 ms.
I0519 19:58:50.314256  9651 caffe.cpp:476] *** Benchmark ends ***

However, TestReshape stopped with 100% CPU usage.

$ make runtest
[  1%] Built target caffeproto
[ 69%] Built target caffe
[ 70%] Built target gtest
[100%] Built target test.testbin
Setting to use device 0
Note: Randomizing tests' orders with a seed of 96580 .
[==========] Running 2100 tests from 276 test cases.
[----------] Global test environment set-up.
[----------] 26 tests from NetTest/3, where TypeParam = caffe::GPUDevice<double>
...
[ RUN      ] NetTest/3.TestReshape

Hi, @legokichi , it seems I met the same problem as you.
The simple phenomenon occurs when I run cmake:

`CMake Warning (dev) in src/caffe/CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

Target "caffe" has an INTERFACE_LINK_LIBRARIES property which differs from
its LINK_INTERFACE_LIBRARIES properties.

INTERFACE_LINK_LIBRARIES:

caffeproto;/home/liuxiang/anaconda2/lib/libboost_system.so;/home/liuxiang/anaconda2/lib/libboost_thread.so;/home/liuxiang/anaconda2/lib/libboost_filesystem.so;/home/liuxiang/anaconda2/lib/libboost_chrono.so;/home/liuxiang/anaconda2/lib/libboost_date_time.so;/home/liuxiang/anaconda2/lib/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libglog.so;/home/liuxiang/anaconda2/lib/libgflags.so;$<$<NOT:$<CONFIG:DEBUG>>:/usr/lib/x86_64-linux-gnu/libprotobuf.so>;$<$<CONFIG:DEBUG>:/usr/lib/x86_64-linux-gnu/libprotobuf.so>;-lpthread;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/liuxiang/anaconda2/lib/liblmdb.so;/home/liuxiang/anaconda2/lib/libleveldb.so;/usr/local/cuda-8.0/lib64/libcudart.so;/usr/local/cuda-8.0/lib64/libcurand.so;/usr/local/cuda-8.0/lib64/libcublas.so;/usr/local/cuda-8.0/lib64/libcudnn.so;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;/usr/lib/liblapack.so;/usr/lib/libcblas.so;/usr/lib/libatlas.so;/home/liuxiang/anaconda2/lib/libboost_python.so

LINK_INTERFACE_LIBRARIES:

caffeproto;/home/liuxiang/anaconda2/lib/libboost_system.so;/home/liuxiang/anaconda2/lib/libboost_thread.so;/home/liuxiang/anaconda2/lib/libboost_filesystem.so;/home/liuxiang/anaconda2/lib/libboost_chrono.so;/home/liuxiang/anaconda2/lib/libboost_date_time.so;/home/liuxiang/anaconda2/lib/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libglog.so;/home/liuxiang/anaconda2/lib/libgflags.so;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/home/liuxiang/anaconda2/lib/libhdf5_hl.so;/home/liuxiang/anaconda2/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/liuxiang/anaconda2/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/home/liuxiang/anaconda2/lib/liblmdb.so;/home/liuxiang/anaconda2/lib/libleveldb.so;/usr/local/cuda-8.0/lib64/libcudart.so;/usr/local/cuda-8.0/lib64/libcurand.so;/usr/local/cuda-8.0/lib64/libcublas.so;/usr/local/cuda-8.0/lib64/libcudnn.so;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;/usr/lib/liblapack.so;/usr/lib/libcblas.so;/usr/lib/libatlas.so;/home/liuxiang/anaconda2/lib/libboost_python.so

This warning is for project developers. Use -Wno-dev to suppress it.
`
I have done all I could following answers this page, yet them do not work.
So can you give me some advices?

Was this page helpful?
0 / 5 - 0 ratings