Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Compile error with glibc 2.26 #1194

Closed
dbermond opened this issue Sep 9, 2017 · 4 comments
Closed

Compile error with glibc 2.26 #1194

dbermond opened this issue Sep 9, 2017 · 4 comments

Comments

@dbermond
Copy link
Contributor

dbermond commented Sep 9, 2017

Compiling with the newly released gblic 2.26 gives the following errors:

  1. Without enabling gloo, the error is:
[ 59%] Built target Caffe2_CPU
[ 59%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o
[ 59%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_abs_op.cu.o
[ 59%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/core/Caffe2_GPU_generated_context_gpu.cu.o
[ 60%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_accumulate_op.cu.o
[ 60%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_accuracy_op.cu.o
[ 60%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_batch_gather_ops.cu.ocaffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_batch_gather_ops.cu.o
/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

2 errors detected in the compilation of "/tmp/tmpxft_0000619e_00000000-19_math_gpu.compute_61.cpp1.ii".
2 errors detected in the compilation of "/tmp/tmpxft_00006182_00000000-19_accumulate_op.compute_61.cpp1.ii".
CMake Error at Caffe2_GPU_generated_math_gpu.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/utils/./Caffe2_GPU_generated_math_gpu.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:583: caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at Caffe2_GPU_generated_accumulate_op.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/operators/./Caffe2_GPU_generated_accumulate_op.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:79: caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_accumulate_op.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_00006163_00000000-19_abs_op.compute_61.cpp1.ii".
CMake Error at Caffe2_GPU_generated_abs_op.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/operators/./Caffe2_GPU_generated_abs_op.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:72: caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_abs_op.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_00006195_00000000-19_context_gpu.compute_61.cpp1.ii".
CMake Error at Caffe2_GPU_generated_context_gpu.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/core/./Caffe2_GPU_generated_context_gpu.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:65: caffe2/CMakeFiles/Caffe2_GPU.dir/core/Caffe2_GPU_generated_context_gpu.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_00006178_00000000-19_batch_gather_ops.compute_61.cpp1.ii".
CMake Error at Caffe2_GPU_generated_batch_gather_ops.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/operators/./Caffe2_GPU_generated_batch_gather_ops.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:93: caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_batch_gather_ops.cu.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_0000618b_00000000-19_accuracy_op.compute_61.cpp1.ii".
CMake Error at Caffe2_GPU_generated_accuracy_op.cu.o.Release.cmake:278 (message):
  Error generating file
  /storage/linux/abs/caffe2-git/src/caffe2-git/build/caffe2/CMakeFiles/Caffe2_GPU.dir/operators/./Caffe2_GPU_generated_accuracy_op.cu.o


make[2]: *** [caffe2/CMakeFiles/Caffe2_GPU.dir/build.make:86: caffe2/CMakeFiles/Caffe2_GPU.dir/operators/Caffe2_GPU_generated_accuracy_op.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:237: caffe2/CMakeFiles/Caffe2_GPU.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
  1. enabling gloo support, the error is:
[  8%] Built target gloo
[  9%] Building NVCC (Device) object third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o
[  9%] Building NVCC (Device) object third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o
/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

2 errors detected in the compilation of "/tmp/tmpxft_00005432_00000000-19_cuda.compute_61.cpp1.ii".
CMake Error at gloo_cuda_generated_cuda.cu.o.Release.cmake:278 (message):
  Error generating file
  /home/user/abs/caffe2-git/src/caffe2-git/build/third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir//./gloo_cuda_generated_cuda.cu.o


make[2]: *** [third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/build.make:65: third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
2 errors detected in the compilation of "/tmp/tmpxft_0000542a_00000000-19_cuda_private.compute_61.cpp1.ii".
CMake Error at gloo_cuda_generated_cuda_private.cu.o.Release.cmake:278 (message):
  Error generating file
  /home/user/abs/caffe2-git/src/caffe2-git/build/third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir//./gloo_cuda_generated_cuda_private.cu.o


make[2]: *** [third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/build.make:72: third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:148: third_party/gloo/gloo/CMakeFiles/gloo_cuda.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  9%] Built target Caffe_PROTO
make: *** [Makefile:141: all] Error 2

OS: Arch Linux x86_64
Compiler: gcc 5.4.0
glibc: 2.26

@dbermond
Copy link
Contributor Author

dbermond commented Sep 9, 2017

It seems that this error occurs due to CUDA/NVCC 8.0.61 not being compatible with glibc 2.26.
Not Caffe2 related.
Closing.

@dbermond dbermond closed this as completed Sep 9, 2017
@uchwings
Copy link

uchwings commented Sep 19, 2017

If you aren't using 128-bit floats in your code and can't wait for one party or the other to fix their software, you can modify floatn.h:

diff --git a/floatn.h b/floatn.h
index f93a9f8..96db3c3 100644
--- a/floatn.h
+++ b/floatn.h
@@ -34,6 +34,11 @@
 # define __HAVE_FLOAT128 0
 #endif
 
+#if CUDART_VERSION
+#undef __HAVE_FLOAT128
+#define __HAVE_FLOAT128 0
+#endif
+
 /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
    from the default float, double and long double types in this glibc.  */
 #if __HAVE_FLOAT128

@yxchng
Copy link

yxchng commented Sep 25, 2017

@dbermond Have you figure out how to solve the problem?

@dbermond
Copy link
Contributor Author

@yxchng
CUDA package on Arch Linux received a fix to be able to work with glibc 2.26. It works nice for me after the fix.

The fix was classified by the package maintainer as a "super dirty hack" in order for it to work.

You can see details on the following links:
https://bugs.archlinux.org/task/55580

https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/cuda&id=ae90e4d243510e9565e66e9e8e08c509f5719fe0

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

No branches or pull requests

3 participants