Hi everyone,
I would like to know if anyone has already successfully run GetFEM on a GPU, or integrated GetFEM with a GPU-based computing framework.
My goal is to accelerate computationally intensive FEM simulations by taking advantage of GPU parallelization. In particular, I am interested in knowing whether there is currently a way to offload parts of the GetFEM computation (assembly, linear algebra, nonlinear solver, etc.) to a GPU, for example using CUDA, HIP, PETSc, or another framework.
Has anyone already experimented with this, or developed a working implementation?
I would be very interested in hearing about your experience, including any practical approach, limitations, or recommendations on where to start.
Thanks in advance!
Assembly and linsolve are 2 very distinct areas.
For linsolve, you do not need to use the solvers provided by GetFEM. With very small adaptations you can couple it to any linear solver, also the ones that use GPU. GetFEM is mainly an assembler for linear and nonlinear problem it will give you a matrix and a rhs.
Regarding assembly, this is where we could talk about GPU offloading in GetFEM. Currently there is no support for performing the assembly on a GPU. The computation graph produced by GWFL in GetFEM has two modes:
- printing to std out (for debugging)
- compute on CPU
it is not unthinkable to support a GPU compute path as well, but it would require quite some work. I would rather base such an implementation on some portable GPU framework (not CUDA). From what I see, Vulkan is becoming more and more viable as an alternative for GPU compute.
Thank you very much for your detailed explanation and for the suggestion regarding Vulkan.
My current idea is to keep the assembly process in GetFEM++, extract the assembled matrix and right-hand side, and then pass them to a custum GPU-based solver. This seems like a reasonable starting point for exploring GPU acceleration without having to modify GetFEM++'s assembly framework.
I will also look into Vulkan as a potential alternative to CUDA, as you suggested.
I suspect you are currently using GetFEM in its fully sequential version, which is quite slow. You can try to enable openmp, so that at least assemblies will be run on several threads.
Yes, I have already parallelized my code. The main issue is that the problem is multiphysics and computationally very large, which is why I am considering using the GPU to further improve the computational performance.
Hello Konstantinos,
Following the instructions from a previous discussion, I had installed the dependencies for GetFEM using the following command:
sudo apt install libmumps-ptscotch-dev libmumps-ptscotch-5.6t64 libopenmpi-dev libopenblas-serial-dev libqhull-dev autoconf automake libtool python3-dev
I had then configured, compiled, and installed GetFEM as follows:
./autogen.sh
./configure --prefix=/opt/gf20251104_libmumps_ptscotch --with-blas=openblas --with-optimization=-O3 --with-pic --enable-python --disable-matlab --disable-superlu LIBS="-lmumps_common_ptscotch -lpord_ptscotch" --enable-paralevel=2 --with-mumps="-lsmumps_ptscotch -ldmumps_ptscotch -lcmumps_ptscotch -lzmumps_ptscotch"
make -j4
make install
Could you please confirm whether these dependencies and configuration options are sufficient to build and use GetFEM with its Python interface and parallel MUMPS support? Are any additional packages or configuration steps required?
Thank you for your help.