When using nvc++ -cuda
to build AMReX with NVHPC 24.3, it fails to compile with the following error message:
cd /u/bwibking/amrex-fork/build/Src && /u/bwibking/hpc_sdk/Linux_x86_64/24.3/compilers/bin/nvc++ -DAMREX_SPACEDIM=3 -I/u/bwibking/amrex-fork/Src/Base -I/u/bwibking/amrex-fork/Src/Base/Parser -I/u/bwibking/amrex-fork/Src/Boundary -I/u/bwibking/amrex-fork/Src/AmrCore -I/u/bwibking/amrex-fork/Src/Amr -I/u/bwibking/amrex-fork/Src/LinearSolvers -I/u/bwibking/amrex-fork/Src/LinearSolvers/MLMG -I/u/bwibking/amrex-fork/Src/LinearSolvers/OpenBC -I/u/bwibking/amrex-fork/Src/Particle -I/u/bwibking/amrex-fork/build -I/sw/spack/deltas11-2023-03/apps/linux-rhel8-zen3/gcc-11.4.0/openmpi-4.1.5-ejhvyny/include -I/sw/spack/deltas11-2023-03/apps/linux-rhel8-zen3/gcc-11.4.0/cuda-11.8.0-vfixfmc/include -cuda --gcc-toolchain=/sw/spack/deltas11-2023-03/apps/linux-rhel8-x86_64/gcc-8.5.0/gcc-11.4.0-yycklku/bin/gcc -pthread -c /u/bwibking/amrex-fork/Src/Base/AMReX_BlockMutex.cpp -o CMakeFiles/amrex_3d.dir/Base/AMReX_BlockMutex.cpp.o
nvdd-Fatal-/sw/spack/deltas11-2023-03/apps/linux-rhel8-zen3/gcc-11.4.0/cuda-11.8.0-vfixfmc/bin/ptxas TERMINATED by signal 11
NVC++-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (/u/bwibking/amrex-fork/Src/Base/AMReX_BlockMutex.cpp: 14)
NVC++/x86-64 Linux 24.3-0: compilation aborted
Is there an option to emit the full preprocessed source (including all headers) so that I can upload a standalone reproducer?
Alternatively, it is possible to reproduce this with the full code with the following commands:
git clone https://github.com/AMReX-Codes/amrex.git
cd amrex
wget https://github.com/AMReX-Codes/amrex/commit/e832f1f32d91cfad44ffe7d9eaf2006f069d9504.patch
patch -p1 < e832f1f32d91cfad44ffe7d9eaf2006f069d9504.patch
mkdir build && cd build
cmake .. -DAMReX_GPU_BACKEND=CUDA -DCMAKE_C_COMPILER=nvc -DCMAKE_CXX_COMPILER=nvc++ -DCMAKE_CUDA_COMPILER=nvc++ -DCMAKE_CUDA_COMPILER_ID=NVCXX -DCMAKE_CUDA_ARCHITECTURES=80 -DCMAKE_CUDA_COMPILER_FORCED=ON -DCMAKE_CUDA_COMPILE_FEATURES=cuda_std_17 -DAMReX_GPU_RDC=OFF -DCMAKE_CXX_FLAGS="-cuda --gcc-toolchain=$(which gcc)" -DCMAKE_CUDA_FLAGS="-cuda --gcc-toolchain=$(which gcc)" -DAMReX_ENABLE_TESTS=ON -DCMAKE_CUDA_HOST_LINK_LAUNCHER=nvc++ -DCMAKE_CUDA_LINK_EXECUTABLE="<CMAKE_CUDA_HOST_LINK_LAUNCHER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
make VERBOSE=1