[petsc-users] unable to build petsc with cuda / superlu-dist enabled
Barry Smith
bsmith at petsc.dev
Thu Aug 25 10:05:48 CDT 2022
Oh yes, my mistake I misinterpreted the error message. It is actually the nvcc compiler complaining about multiple command line arguments related to optimization (which it is really picky about even if the two arguments are identical.) I reformatted some of the configure output to show this
-ccbin mpicxx -std=c++14 -Xcompiler -fPIC -O3 -gencode arch=compute_75,code=sm_75 -Wno-deprecated-gpu-targets
-I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include
-DDEBUGlevel=0 -DPRNTlevel=0
the next fragment is
-O3 -DNDEBUG
--generate-code=arch=compute_75,code=[compute_75,sm_75]
-Xcompiler=-fPIC -std=c++11 -x cu -rdc=true -c /home/blahblah/Projects/220824-petsc-example-for_forum/petsc/arch-linux-c-opt/externalpackages/git.superlu_dist/SRC/superlu_gpu_utils.cu -o
Hence the -O3 appears twice, once from the CMAKE argument PETSc passes to superlu_dist
-DCMAKE_CUDA_FLAGS=" -ccbin mpicxx -std=c++14 -Xcompiler -fPIC -O3 -gencode arch=compute_75,code=sm_75 -Wno-deprecated-gpu-targets -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -DDEBUGlevel=0 -DPRNTlevel=0"
and then presumably, the superlu_dist cmake process adds its own arguments which overlap.
If I remember correctly this is fixed in the main branch of PETSc, could you do an identical build with the main branch? If that works we will just need to figure out how to get MOOSE to work with main PETSc branch.
Barry
Sadly each one makes different -std=c++11 vs -std=c++14 choices as well.
--------------------
[ 15%] Building CUDA object SRC/CMakeFiles/superlu_dist.dir/superlu_gpu_utils.cu.o
cd /home/blahblah/Projects/220824-petsc-example-for_forum/petsc/arch-linux-c-opt/externalpackages/git.superlu_dist/petsc-build/SRC && /usr/bin/nvcc
-DSUPERLU_DIST_EXPORTS -Dsuperlu_dist_EXPORTS
-I/home/blahblah/Projects/220824-petsc-example-for_forum/petsc/arch-linux-c-opt/externalpackages/git.superlu_dist/petsc-build/SRC
-I/home/blahblah/Projects/220824-petsc-build/installation/include -I/usr/lib/x86_64-linux-gnu/openmpi/lib
-DUSE_VENDOR_BLAS -ccbin mpicxx -std=c++14 -Xcompiler -fPIC -O3 -gencode arch=compute_75,code=sm_75 -Wno-deprecated-gpu-targets
-I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include
-DDEBUGlevel=0 -DPRNTlevel=0 -O3 -DNDEBUG
--generate-code=arch=compute_75,code=[compute_75,sm_75]
-Xcompiler=-fPIC -std=c++11 -x cu -rdc=true -c /home/blahblah/Projects/220824-petsc-example-for_forum/petsc/arch-linux-c-opt/externalpackages/git.superlu_dist/SRC/superlu_gpu_utils.cu -o
CMakeFiles/superlu_dist.dir/superlu_gpu_utils.cu
> On Aug 25, 2022, at 9:38 AM, byron <lbgpublic at gmail.com> wrote:
>
> Hi Barry
>
> There doesn't appear to be any reference to 'optimize' in the only copy of superlu_gpu_utils.cu <http://superlu_gpu_utils.cu/> I could find, I've attached a copy.
>
> Thanks
>
>
>
> On Thu, Aug 25, 2022 at 1:44 PM Barry Smith <bsmith at petsc.dev <mailto:bsmith at petsc.dev>> wrote:
>
> nvcc fatal : redefinition of argument 'optimize'
> make[2]: *** [SRC/CMakeFiles/superlu_dist.dir/build.make:499: SRC/CMakeFiles/superlu_dist.dir/superlu_gpu_utils.cu.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> nvcc fatal : redefinition of argument 'optimize'
> make[2]: *** [SRC/CMakeFiles/superlu_dist-static.dir/build.make:499: SRC/CMakeFiles/superlu_dist-static.dir/superlu_gpu_utils.cu.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
>
> It seems that nvcc is unhappy with something in superlu_gpu_utils.cu <http://superlu_gpu_utils.cu/> Could you check that file for any "redefinition of optimize"? Unfortunately the nvcc compiler isn't kind enough to print the line number of the redefinition or that information is lost somehow in the build process.
>
> Barry
>
>> On Aug 25, 2022, at 6:50 AM, byron <lbgpublic at gmail.com <mailto:lbgpublic at gmail.com>> wrote:
>>
>> Hi All
>>
>> I am having trouble getting petsc to build with cuda / superlu-dist enabled. I have been trying to build it as part of another software tool, moose, hence the choice of options being passed to configure
>>
>> python3 ./configure --download-hypre=1 \
>> --with-shared-libraries=1 \
>> --download-hdf5=1 \
>> --download-hdf5-fortran-bindings=0 \
>> --with-debugging=no \
>> --download-fblaslapack=1 \
>> --download-metis=1 \
>> --download-ptscotch=1 \
>> --download-parmetis=1 \
>> --download-superlu_dist=1 \
>> --download-mumps=1 \
>> --download-strumpack=1 \
>> --download-scalapack=1 \
>> --download-slepc=1 \
>> --with-mpi=1 \
>> --with-openmp=1 \
>> --with-cxx-dialect=C++11 \
>> --with-fortran-bindings=0 \
>> --with-sowing=0 \
>> --with-64-bit-indices \
>> --with-cuda \
>> --prefix=/home/blah/blah
>>
>> it fails with
>>
>> ============================================================================================= Installing PTScotch; this may take several minutes ============================================================================================= ============================================================================================= Trying to download git://https://github.com/xiaoyeli/superlu_dist <https://github.com/xiaoyeli/superlu_dist> for SUPERLU_DIST ============================================================================================= ============================================================================================= Configuring SUPERLU_DIST with cmake; this may take several minutes ============================================================================================= ============================================================================================= Compiling and installing SUPERLU_DIST; this may take several minutes ============================================================================================= *******************************************************************************
>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
>> -------------------------------------------------------------------------------
>> Error running make on SUPERLU_DIST
>> *******************************************************************************
>>
>> I've attached the configure.log.
>>
>> I've tried a few different things but nothing that resulted in a successfull build. The most promising was I tried to build superlu_dist separately with the configure options that petsc passes it and then kept trying the build over and over droping out different configure options until I got it to work. In that case removing a "-std=c++14" entry appeared to fix the problem but then when I made the same change in how petsc builds superlu-dist the make failed on superlu-dist with a different error. I get the feeling I'm dealing with symptoms of the problem rather than the cause.
>>
>> Thanks
>> Byron
>>
>>
>>
>>
>> <configure.log>
>
> <superlu_gpu_utils.cu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220825/b3b77143/attachment.html>
More information about the petsc-users
mailing list