Page MenuHome

Fail to compile CUDA code. Can't enable c++11 in cmake-gui (I guess...)
Closed, ArchivedPublic

Description

Linux, CUDA 7.5.18, GCC 6.1.1

Long story, short:

http://pastebin.com/K1wPjiK7

or right here:

[278/2506] Generating kernel_sm_30.cubin
FAILED: intern/cycles/kernel/kernel_sm_30.cubin
cd /home/igor/src/blender/build-gcc/intern/cycles/kernel && /opt/cuda/bin/nvcc -arch=sm_30 -m64 --cubin /home/igor/src/blender/blender/intern/cycles/kernel/kernels/cuda/kernel.cu -o /home/igor/src/blender/build-gcc/intern/cycles/kernel/kernel_sm_30.cubin --ptxas-options="-v" -DKERNEL_CUDA_VERSION=75 --use_fast_math -I/home/igor/src/blender/blender/intern/cycles/kernel/../util -I/home/igor/src/blender/blender/intern/cycles/kernel/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include/stddef.h(436): error: identifier "nullptr" is undefined

/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include/stddef.h(436): error: expected a ";"

/usr/include/c++/6.1.1/x86_64-pc-linux-gnu/bits/c++config.h(202): error: expected a ";"

/usr/include/c++/6.1.1/exception(63): error: expected a ";"

/usr/include/c++/6.1.1/exception(69): error: expected a ";"

/usr/include/c++/6.1.1/exception(77): error: expected a ";"

/usr/include/c++/6.1.1/exception(85): error: expected a ";"

/usr/include/c++/6.1.1/exception(95): error: expected a "{"

/usr/include/c++/6.1.1/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"

/usr/include/c++/6.1.1/bits/exception_ptr.h(64): error: expected a "{"

/usr/include/c++/6.1.1/bits/exception_ptr.h(71): error: namespace "std" has no member "rethrow_exception"

/usr/include/c++/6.1.1/bits/exception_ptr.h(81): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(83): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(84): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(86): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(88): error: declaration is incompatible with previous "std::current_exception"
(64): here

/usr/include/c++/6.1.1/bits/exception_ptr.h(88): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(88): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(89): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(92): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(94): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(97): error: incomplete type is not allowed

/usr/include/c++/6.1.1/bits/exception_ptr.h(97): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(118): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(128): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(145): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(146): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(149): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(154): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(155): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(158): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(159): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(162): error: use of a local type to declare a function

/usr/include/c++/6.1.1/bits/exception_ptr.h(163): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(171): error: expected a ";"

/usr/include/c++/6.1.1/bits/exception_ptr.h(197): error: expected a ";"

/usr/include/c++/6.1.1/bits/move.h(47): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(71): error: identifier "constexpr" is undefined

/usr/include/c++/6.1.1/type_traits(71): error: template parameter "_Tp" may not be redeclared in this scope

/usr/include/c++/6.1.1/type_traits(71): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(72): error: member "std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/6.1.1/type_traits(73): error: member "std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/6.1.1/type_traits(74): error: identifier "constexpr" is undefined

/usr/include/c++/6.1.1/type_traits(79): error: identifier "constexpr" is undefined

/usr/include/c++/6.1.1/type_traits(79): error: "value_type" has already been declared in the current scope

/usr/include/c++/6.1.1/type_traits(79): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(84): error: identifier "constexpr" is undefined

/usr/include/c++/6.1.1/type_traits(84): error: "_Tp" is not a function or static data member

/usr/include/c++/6.1.1/type_traits(93): error: expected a declaration

/usr/include/c++/6.1.1/type_traits(93): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(126): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(235): error: identifier "char16_t" is undefined

/usr/include/c++/6.1.1/type_traits(239): error: identifier "char32_t" is undefined

/usr/include/c++/6.1.1/type_traits(239): error: class "std::__is_integral_helper<<error-type>>" has already been defined

/usr/include/c++/6.1.1/type_traits(337): error: identifier "__float128" is undefined

/usr/include/c++/6.1.1/type_traits(453): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(457): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(465): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(469): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(477): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(481): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(489): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(493): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(501): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(505): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(513): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(517): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(525): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(529): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(537): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(541): error: expected a ">"

/usr/include/c++/6.1.1/type_traits(551): error: namespace "std" has no member "nullptr_t"

/usr/include/c++/6.1.1/type_traits(572): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(578): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(585): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(592): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(602): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(628): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(738): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(752): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(767): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(777): error: expected a ")"

/usr/include/c++/6.1.1/type_traits(788): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6.1.1/type_traits(788): error: expected a type specifier

/usr/include/c++/6.1.1/type_traits(788): error: function returning function is not allowed

/usr/include/c++/6.1.1/type_traits(788): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(794): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(795): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(825): error: identifier "noexcept" is undefined

/usr/include/c++/6.1.1/type_traits(825): error: function call is not allowed in a constant expression

/usr/include/c++/6.1.1/type_traits(825): error: function call is not allowed in a constant expression

/usr/include/c++/6.1.1/type_traits(825): error: this operator is not allowed in a template argument expression

/usr/include/c++/6.1.1/type_traits(836): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6.1.1/type_traits(836): error: expected a type specifier

/usr/include/c++/6.1.1/type_traits(836): error: function returning function is not allowed

/usr/include/c++/6.1.1/type_traits(836): error: expected a ";"

/usr/include/c++/6.1.1/type_traits(842): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(843): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6.1.1/type_traits(868): error: function returning function is not allowed

/usr/include/c++/6.1.1/type_traits(879): error: an explicit template argument list is not allowed on this declaration

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00007a49_00000000-7_kernel.cpp1.ii".
Compilation terminated.
[283/2506] Building CXX object intern/cycles/kernel/CMakeFiles/cycles_kernel.dir/kernels/cpu/kernel_avx.cpp.o
ninja: build stopped: subcommand failed.

Details

Type
Bug

Event Timeline

Igor Valorin (igvalor2) set Type to Bug.
Igor Valorin (igvalor2) created this task.
Igor Valorin (igvalor2) raised the priority of this task from to Needs Triage by Developer.
Brecht Van Lommel (brecht) closed this task as Archived.
Brecht Van Lommel (brecht) claimed this task.

It appears that CUDA 7.5 does not support GCC 6, see also here: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1402263.html

This usually happens with new major GCC / Clang / MSVC versions, the CUDA toolkit only supports specific C++ compiler versions. We can't do anything about it, we have to wait for NVidia to fix it in a new CUDA release.

You can work around this if you have an older gcc installed

This is what i use to forward nvcc:

contents of my: /usr/local/bin/nvcc

#!/bin/bash

export PATH=$PATH:/opt/cuda-6.5/bin

/opt/cuda-6.5/bin/nvcc -ccbin `which gcc-4.8` $*