You are not logged in.

#1 2013-04-04 10:14:47

zenixls2
Member
Registered: 2013-04-04
Posts: 3

CUDA compile issues

I tried to compile my cuda program with these flags:

/opt/cuda/bin/nvcc -g -G -pg -L/opt/cuda/lib64 -L../lib -L../common/lib/linux  -lcudart     -L/opt/cuda/lib64 -L../lib -L../common/lib/linux  -lnvToolsExt -lcuinj64  --compiler-options -fno-strict-aliasing   -I. -I/opt/cuda/include -I../common/inc -I/opt/cuda/samples/common/inc -DUNIX -O3   -o obj/release/medianFilter_kernel.cu.o -c medianFilter_kernel.cu

and the debug message says:

/usr/include/c++/4.8.0/cstdlib(178): error: identifier "__int128" is undefined
/usr/include/c++/4.8.0/cstdlib(179): error: identifier "__int128" is undefined

I add #undef _GLIBCXX_USE_INT128 in front of my code but still get these errors...
before 4/2, this code is still compilable
it seems there's some changes to the related packages in repository

Offline

#2 2013-04-04 18:04:17

numasan
Member
Registered: 2009-11-13
Posts: 23

Re: CUDA compile issues

I also just got this error, trying to compile Blender-SVN.

Looks like CUDA (5.0) doesn't like GCC 4.8 ...

I don't know if this is fixable or if we need Nvidia to update Cuda.

Offline

#3 2013-04-04 23:53:54

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,592
Website

Re: CUDA compile issues

I ran into this compiling BlenderSVN as well. I wonder if recompiling CUDA would help -- but I am doubting it.


Matt

"It is very difficult to educate the educated."

Offline

#4 2013-04-05 01:58:25

numasan
Member
Registered: 2009-11-13
Posts: 23

Re: CUDA compile issues

I went back to gcc 4.7 with this command:

cd /var/cache/pacman/pkg
pacman -U gcc-4.7.2-4-x86_64.pkg.tar.xz gcc-libs-4.7.2-4-x86_64.pkg.tar.xz lib32-gcc-libs-4.7.2-4-x86_64.pkg.tar.xz \
libtool-2.4.2-7-x86_64.pkg.tar.xz

I don't care too much if it's not the newest gcc, and I don't want to wait on nVidia for updating cuda.

Offline

#5 2013-04-05 08:45:15

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: CUDA compile issues

I fixed this in release -4. Please try it and report a bug if it errors.

Offline

#6 2013-04-05 14:30:50

numasan
Member
Registered: 2009-11-13
Posts: 23

Re: CUDA compile issues

Svenstaro wrote:

I fixed this in release -4. Please try it and report a bug if it errors.

Hi, thank you!

The updated cuda + gcc 4.8 works - I can compile Blender and render using cuda GPU again.

Offline

#7 2013-04-05 15:00:17

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: CUDA compile issues

Why don't you use blender from [community]?

Offline

#8 2013-04-05 15:06:41

numasan
Member
Registered: 2009-11-13
Posts: 23

Re: CUDA compile issues

Svenstaro wrote:

Why don't you use blender from [community]?

I like to compile Blender straight from SVN and keep up with the newest developments. While I'm not a developer I have touched the source occasionally, and in any case like to have the possibility.

Offline

#9 2013-04-05 15:40:17

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: CUDA compile issues

Fair enough. smile

Offline

#10 2013-04-05 23:21:28

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,592
Website

Re: CUDA compile issues

Ditto for me, also. I compile Blender usually weekly if not more often. I like the latest toys!


Matt

"It is very difficult to educate the educated."

Offline

#11 2013-04-07 05:23:09

cym
Member
Registered: 2013-04-07
Posts: 1

Re: CUDA compile issues

Svenstaro wrote:

I fixed this in release -4. Please try it and report a bug if it errors.

Excellent work! But there are still some problems.
If I don't #include <iostream>, everything is fine. But if I did that, gcc 4.8 complains:
    /usr/include/c++/4.8.0/ext/atomicity.h(47): error: identifier "__atomic_fetch_add" is undefined
    /usr/include/c++/4.8.0/ext/atomicity.h(51): error: identifier "__atomic_fetch_add" is undefined

Adding the following two lines doesn't work:
    #undef _GLIBCXX_ATOMIC_BUILTINS
    #undef _GLIBCXX_USE_INT128
The prompt information changes to:
    /usr/include/c++/4.8.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:236:119: error: expected initializer before ‘__asm__’
     __gthrw2(__gthrw_(__pthread_key_create),
                                                                                                                           ^
    /usr/include/c++/4.8.0/x86_64-unknown-linux-gnu/bits/gthr-default.h: In function ‘int __gthread_active_p()’:
    /usr/include/c++/4.8.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:249:68: error: ‘__gthrw___pthread_key_create’ was not declared in this scope
       static void *const __gthread_active_ptr
                                                                        ^
    make: *** [1] Error 1

Offline

#12 2013-04-08 10:51:27

neunon
Member
From: Seattle, WA
Registered: 2011-01-25
Posts: 15
Website

Re: CUDA compile issues

I discovered that I can get the CUDA samples to compile by adding this line after those two #undefs mentioned by cym:

#define _GLIBCXX_GTHREAD_USE_WEAK 0

Offline

#13 2013-04-08 13:24:31

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: CUDA compile issues

Thank you for that. I hope the new cuda version in [community] fixes the issue for everyone without changing your own source files.

Offline

#14 2013-06-05 13:07:23

matt42
Member
Registered: 2013-06-05
Posts: 2

Re: CUDA compile issues

Hello all
For those who also have problems compiling boost header with NVCC, add the following undef before
including boost headers:

#undef  __SIZEOF_INT128__

Offline

Board footer

Powered by FluxBB