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

Compilation errors in OpenCL Branch #6482

Open
1 task
skn123 opened this issue Jul 28, 2018 · 14 comments
Open
1 task

Compilation errors in OpenCL Branch #6482

skn123 opened this issue Jul 28, 2018 · 14 comments
Assignees
Labels

Comments

@skn123
Copy link

skn123 commented Jul 28, 2018

Issue summary

Compilation fails with clang

Steps to reproduce

Cloned a fresh checkout from the OpenCL branch of Caffe. Used default CMake settings and set build to Release

Tried solutions

??

System configuration

  • Operating system: Ubuntu 16.0.4 LTS
  • Compiler: clang 6.0
  • CUDA version (if applicable): NA
  • CUDNN version (if applicable): NA
  • BLAS: CLBlast/ViennaCL
  • Python version (if using pycaffe):
  • MATLAB version (if using matcaffe):

Issue checklist

  • [ x] read the guidelines and removed the first paragraph
  • [x ] written a short summary and detailed steps to reproduce
  • [x ] explained how solutions to related problems failed (tick if found none)
  • [ x] filled system configuration
  • attached relevant logs/config files (tick if not applicable)

Summary of build log
naths@naths-HP-Laptop-15-bs1xx:~/build/caffe$ make
[ 0%] Running C++/Python protocol buffer compiler on /home/naths/srcs/caffe/src/caffe/proto/caffe.proto
Scanning dependencies of target caffeproto
[ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir///include/caffe/proto/caffe.pb.cc.o
[ 1%] Linking CXX static library ../../lib/libcaffeproto.a
[ 1%] Built target caffeproto
[ 1%] Generating test macros source (python -> C++).
[ 1%] Generating macros source (python -> C++).
[ 2%] Generating layer creator source (python -> C++).
[ 2%] Generating blob creator source (python -> C++).
[ 2%] Generating quantizer creator source (python -> C++).
Scanning dependencies of target pre_build
[ 4%] Linking CXX static library ../../lib/libpre_build.a
[ 4%] Built target pre_build
Scanning dependencies of target caffe
[ 4%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/backend.cpp.o
In file included from /home/naths/srcs/caffe/src/caffe/backend/backend.cpp:1:
In file included from /home/naths/srcs/caffe/include/caffe/backend/backend.hpp:7:
In file included from /home/naths/srcs/caffe/include/caffe/common.hpp:14:
In file included from /home/naths/srcs/caffe/include/caffe/definitions.hpp:25:
In file included from /home/naths/srcs/caffe/include/caffe/trait_helper.hpp:6:
In file included from /home/naths/srcs/caffe/include/caffe/util/half_fp.hpp:5:
/home/naths/srcs/caffe/include/3rdparty/half/half.hpp:1080:12: warning: class
'numeric_limits' was previously declared as a struct [-Wmismatched-tags]
friend class std::numeric_limits<half_fp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.4.0/../../../../include/c++/6.4.0/limits:315:12: note:
previous use is here
struct numeric_limits : public __numeric_limits_base
^
1 warning generated.
[ 4%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/cuda/caffe_cuda.cpp.o
[ 4%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/cuda/cuda_dev_ptr.cpp.o
In file included from /home/naths/srcs/caffe/src/caffe/backend/cuda/cuda_dev_ptr.cpp:1:
In file included from /home/naths/srcs/caffe/include/caffe/common.hpp:14:
In file included from /home/naths/srcs/caffe/include/caffe/definitions.hpp:25:
In file included from /home/naths/srcs/caffe/include/caffe/trait_helper.hpp:6:
In file included from /home/naths/srcs/caffe/include/caffe/util/half_fp.hpp:5:
/home/naths/srcs/caffe/include/3rdparty/half/half.hpp:1080:12: warning: class
'numeric_limits' was previously declared as a struct [-Wmismatched-tags]
friend class std::numeric_limits<half_fp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.4.0/../../../../include/c++/6.4.0/limits:315:12: note:
previous use is here
struct numeric_limits : public __numeric_limits_base
^
1 warning generated.
[ 5%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/cuda/cuda_device.cpp.o
[ 5%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/cuda/cuda_device_kernel.cpp.o
In file included from /home/naths/srcs/caffe/src/caffe/backend/cuda/cuda_device_kernel.cpp:3:
In file included from /home/naths/srcs/caffe/include/caffe/backend/cuda/cuda_device_kernel.hpp:4:
In file included from /home/naths/srcs/caffe/include/caffe/backend/device_kernel.hpp:4:
In file included from /home/naths/srcs/caffe/include/caffe/common.hpp:14:
In file included from /home/naths/srcs/caffe/include/caffe/definitions.hpp:25:
In file included from /home/naths/srcs/caffe/include/caffe/trait_helper.hpp:6:
In file included from /home/naths/srcs/caffe/include/caffe/util/half_fp.hpp:5:
/home/naths/srcs/caffe/include/3rdparty/half/half.hpp:1080:12: warning: class
'numeric_limits' was previously declared as a struct [-Wmismatched-tags]
friend class std::numeric_limits<half_fp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.4.0/../../../../include/c++/6.4.0/limits:315:12: note:
previous use is here
struct numeric_limits : public __numeric_limits_base
^
1 warning generated.
[ 5%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/cuda/cuda_device_program.cpp.o
[ 5%] Building CXX object src/caffe/CMakeFiles/caffe.dir/backend/device.cpp.o
In file included from /home/naths/srcs/caffe/src/caffe/backend/device.cpp:6:
In file included from /home/naths/srcs/caffe/include/caffe/backend/device.hpp:12:
In file included from /home/naths/srcs/caffe/include/caffe/blob.hpp:8:
In file included from /home/naths/srcs/caffe/include/caffe/common.hpp:14:
In file included from /home/naths/srcs/caffe/include/caffe/definitions.hpp:25:
In file included from /home/naths/srcs/caffe/include/caffe/trait_helper.hpp:6:
In file included from /home/naths/srcs/caffe/include/caffe/util/half_fp.hpp:5:
/home/naths/srcs/caffe/include/3rdparty/half/half.hpp:1080:12: warning: class
'numeric_limits' was previously declared as a struct [-Wmismatched-tags]
friend class std::numeric_limits<half_fp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.4.0/../../../../include/c++/6.4.0/limits:315:12: note:
previous use is here
struct numeric_limits : public _numeric_limits_base
^
/home/naths/srcs/caffe/src/caffe/backend/device.cpp:280:50: error: ordered
comparison between pointer and zero ('int32_t *' (aka 'int *') and 'int')
if (*lock_id < buffer_flags
.size() && lock_id > 0) {
~~~~~~~ ^ ~
1 warning and 1 error generated.
src/caffe/CMakeFiles/caffe.dir/build.make:140: recipe for target 'src/caffe/CMakeFiles/caffe.dir/backend/device.cpp.o' failed
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/backend/device.cpp.o] Error 1
CMakeFiles/Makefile2:348: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@naibaf7 naibaf7 self-assigned this Jul 28, 2018
@skn123
Copy link
Author

skn123 commented Aug 15, 2018

Fabian, any update on this?

@naibaf7 naibaf7 added the OpenCL label Aug 15, 2018
@naibaf7
Copy link
Member

naibaf7 commented Aug 15, 2018

Yes, working on it. Not fixed yet.

@skn123
Copy link
Author

skn123 commented Aug 15, 2018

CLFFT is disabled/not working on this. Do you intend on keeping it that way?

@naibaf7
Copy link
Member

naibaf7 commented Aug 15, 2018

Yes, the Intel Spatial and CLFFT layers are dead and not coming back, since their contributors are no longer working at Intel (abandoned), and will be removed subsequently. However, clang, OS X and windows compile issues are parts I am actively working on since the beginning of August. There are currently some issues with the FP16 3rd party inclusion with both windows and clang, for some reason, as well as some compile-time macros not functioning on anything else than gcc right now.

@skn123
Copy link
Author

skn123 commented Aug 16, 2018

What exactly do you need in CLFFT? I can help in that if I know what is the API to be worked on. Looking at other code, I did get a lot of errors when I tried building the code. I hacked my way all the way through and even got it to build. Essentially it required some explicit templates to be instantiated. However, when I ran the code, I was getting crashes. I had posted the error logs in a thread that you had closed earlier. Is there a way I can send you the code? I had stopped working on that since June and reverted back to an older working version of the code.

@naibaf7
Copy link
Member

naibaf7 commented Aug 16, 2018

@skn123 You can submit a pull request if you want. I'm still unsure about why it fails to build for some people. At least with GCC 7 and 8, building of the new branch was never a problem.
But I was kind of expecting regression problems with GCC 6, CLANG and MSVC. If you have some concrete hints how to fix these, please do a pull request.

The issue is mainly the backend changes and ton of features that have been added since the old version, namely quantized integer inference, floating point 16 and complete device abstraction.

@skn123
Copy link
Author

skn123 commented Aug 18, 2018

I am generating a new PR with my changes but on the mainline version of Caffe.

@Jeffwhen
Copy link

I run into this custom literal error in 3rdparty/half/half.hpp using GCC 4.

And wrong number of template arguments error using GCC 7.

What did you do to compile the latest code? @skn123

Or can anyone tell which commit point is compilable?

I am not a expert about this, but maybe a stable release from time to time is helpful.

@skn123
Copy link
Author

skn123 commented Aug 29, 2018

@naibaf7 take a look at this. The code is just compiling for ever! Maybe restructuring needed?
screenshot from 2018-08-29 12-57-38

@skn123
Copy link
Author

skn123 commented Aug 29, 2018

I could build the code and as usual anything related with double gave me error. Double needs to be fixed as there are some API differences.
dump.txt

@skn123
Copy link
Author

skn123 commented Aug 29, 2018

@naibaf7 Here is the PR
#6517

@skn123
Copy link
Author

skn123 commented Sep 1, 2018

@naibaf7 any update?

@naibaf7
Copy link
Member

naibaf7 commented Sep 1, 2018

@skn123 Currently in the process of defending my Master Thesis. There will be a large update mid-September :)

@skn123
Copy link
Author

skn123 commented Sep 21, 2018

@naibaf7 once more...anything?

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

No branches or pull requests

3 participants