[petsc-dev] cuda 4.1 errors with sm_20

Satish Balay balay at mcs.anl.gov
Tue Mar 27 22:23:07 CDT 2012


Chetan, thanks for the note. I guess I should have first searched
petsc archives :).

Looks like we default to -g3 for gcc, but -g for g++/gfortran [due to
bugs in some version of these compilers]. However -g3 is usefull for
debugging macros - so its a good default.

For now - I'm switching the default from -g3 to -g for cuda
builds [one can always override this with COPTFLAGS options]

Satish

On Tue, 27 Mar 2012, Chetan Jhurani wrote:

> Satish,
> 
> This is because of -g3 option to nvcc.  Attaching my
> earlier mail to petsc-maint.
> 
> Chetan
> 
> > -----Original Message-----
> > From: petsc-dev-bounces at mcs.anl.gov [mailto:petsc-dev-bounces at mcs.anl.gov] On Behalf Of Satish Balay
> > Sent: Tuesday, March 27, 2012 7:31 PM
> > To: petsc-dev at mcs.anl.gov
> > Subject: [petsc-dev] cuda 4.1 errors with sm_20
> > 
> > I get errors with building petsc using cuda-4.1 with 'sm_20' on
> > linux. Reverting to cuda-4.0 [with cusp-v0.3.1, thrust-1.6.0]
> > overcomes this issue.
> > 
> > >From
> > http://developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/docs/CUDA_Toolkit_Release_Notes_And_
> > Errata.txt
> > * For target architecture sm_2x, a new compiler component 'cicc' is used instead of 'nvopencc'.
> > 
> > So the new compiler used for sm20 - 'cicc' is perhaps buggy.
> > 
> > Matt,Sean or Barry, Do you see the same behavior on Mac?
> > 
> > Satish
> > ---------------------------
> > balay at bb30:~/petsc-dev/src/mat/impls/aij/seq/seqcusp>nvcc -g -arch=sm_20  -c --compiler-options="-Wall
> > -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0   -I/home/balay/petsc-
> > dev/include -I/home/balay/petsc-dev/arch-cuda-double/include -I/usr/local/cuda/include -
> > I/home/balay/petsc-dev/arch-cuda-double/include/txpetscgpu/include -I/usr/local/cusp-v0.3.1/  -
> > D__INSDIR__=src/mat/impls/aij/seq/seqcusp/"  aijcusp.cu
> > <built-in>(2): error: "__STDC_HOSTED__" is predefined; attempted redefinition ignored
> > 
> > <built-in>(8): error: "__WCHAR_TYPE__" is predefined; attempted redefinition ignored
> > 
> > <built-in>(115): error: "__x86_64" is predefined; attempted redefinition ignored
> > 
> > <built-in>(116): error: "__x86_64__" is predefined; attempted redefinition ignored
> > 
> > <built-in>(126): error: "__linux__" is predefined; attempted redefinition ignored
> > 
> > <built-in>(129): error: "__unix__" is predefined; attempted redefinition ignored
> > 
> > <built-in>(130): error: "unix" is predefined; attempted redefinition ignored
> > 
> > 7 errors detected in the compilation of "/tmp/tmpxft_00003334_00000000-7_aijcusp.cpp3.i".
> 




More information about the petsc-dev mailing list