Compile GPU version on OSC #5048
-
Hi WarpX Developers, I have successfully compiled the CPU version of WarpX on the Ohio Supercomputer Center (OSC). However, I encountered a relocation truncation error during the linking phase of the GPU build. I believe this error is due to the large code size, as explained here. The total size of Here is my building script: module reset
ml gnu/9.1.0
ml cuda/11.8.0
ml cmake/3.25.2
ml openmpi/4.0.3-hpcx
ml mkl/2019.0.5
ml hdf5/1.12.0
export CC=$(which gcc)
export CXX=$(which g++)
export FC=$(which gfortran)
export CUDACXX=$(which nvcc)
export CUDAHOSTCXX=${CXX}
export CUDAFLAGS="--host-linker-script=use-lcs" # https://github.com/ECP-WarpX/WarpX/pull/3673
export AMReX_CUDA_ARCH=7.0 # 7.0: V100, 8.0: A100, 9.0: H100 https://github.com/ECP-WarpX/WarpX/issues/3214
cmake -S . -B build_gpu -DWarpX_DIMS="1" -DWarpX_COMPUTE=CUDA
cmake --build build_gpu -j 48 I attempted to resolve the relocation truncation error by following the suggestions in #3673 and #3214, but the error persists. Thank you for your time! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Awesome, congratulations!
Ah, this is an error we sometimes see with some compilers. Yes, the approach to set export CUDAFLAGS="--host-linker-script=use-lcs" could solve it - did you run |
Beta Was this translation helpful? Give feedback.
-
Alternatively, you can try using a newer GNU GCC compiler, e.g., 10 or 11 also work with CUDA 11.8: https://gist.github.com/ax3l/9489132 |
Beta Was this translation helpful? Give feedback.
-
Do not load |
Beta Was this translation helpful? Give feedback.
-
One of your lines contains a typo: our environment variables need to be all-CAPS, so it should read: export AMREX_CUDA_ARCH=7.0 (note the |
Beta Was this translation helpful? Give feedback.
One of your lines contains a typo: our environment variables need to be all-CAPS, so it should read:
export AMREX_CUDA_ARCH=7.0
(note the
E
inAMREX
.)https://amrex-codes.github.io/amrex/docs_html/GPU.html?highlight=amrex_cuda_arch#enabling-cuda-support