hypre icon indicating copy to clipboard operation
hypre copied to clipboard

Setting HIP compiler

Open artv3 opened this issue 3 years ago • 3 comments

Hello Team Hypre,

I was wondering how one can manually set the hip compiler. Looking at the configure file:

https://github.com/hypre-space/hypre/blob/514c72be691b8698df7e7069d54458831cbc531e/src/config/configure.in#L1574

It looks like if we use the variable for the CUDA compiler it will set it for HIP. Is CUCC supposed to be a generic device compiler?

https://github.com/hypre-space/hypre/blob/514c72be691b8698df7e7069d54458831cbc531e/src/config/configure.in#L564

artv3 avatar Jan 14 '22 19:01 artv3

HI @artv3 Currently, you can't control the HIP compiler explicitly. The only knob here is ROCM_PATH which is what configure looks for for your ROCm installation (and defaults to /opt/rocm if it is not set). You can also control the flags passed to the HIP compiler using HIPCXXFLAGS. What issue are you running into that you're wanting to switch the HIP compiler?

pbauman avatar Feb 04 '22 18:02 pbauman

If only configure with ROCM_PATH only it looks like HYPRE files which require MPI get build with the hip compiler resulting an in an error:

In file included from cuda_utils.c:8:
In file included from ./_hypre_utilities.h:7:
./HYPRE_utilities.h:20:10: fatal error: 'mpi.h' file not found
#include "mpi.h"

artv3 avatar Feb 07 '22 18:02 artv3

The primary HYPRE developers can comment, but you can build with HIP and without MPI. This requires the --without-MPI configure flag. On the other hand, when I build with MPI, I need to explicitly use --with-MPI-include, --with-MPI-lib-dirs, and --with-MPI-libs`, e.g.

--with-MPI-include=/usr/include/x86_64-linux-gnu/mpich --with-MPI-lib-dirs=/usr/lib/x86_64-linux-gnu --with-MPI-libs=mpich

HTH

pbauman avatar Feb 08 '22 12:02 pbauman