Catalyst image write error using osmesa llvmpipe on Power9 cluster

We have a Paraview Catalyst v5.8.1 pipeline based on RectilinearGrid fields. Everything works on x86 platforms, while on the Power9 cluster we found random but very frequent failures, especially with a high number of MPI processes. The code is written in Fortran with CUDA-Fortran hpc-sdk compiler v20.7, paraview is compiled with gnu compiler v8.4.0 and the error occurs with both spectrum_mpi and openmpi pre-compiled in the hpc-sdk suite of NVIDIA. The fail occurs at the IceT level (radixkr/MPI call) or at the osmesa or vtk rendering level, and occurs only when trying to export rendered images (everything works by only exporting .vtr for example). By setting osmesa’s GALLIUM_DRIVER on softpipe, everything also works when exporting images, but unfortunately it is terribly slow. We tried to recompile paraview with different osmesa versions (13, 18, 20) but the result is always negative with llvmpipe. Activating the osmesa debugging some errors are reported like:

Mesa: User error: GL_INVALID_OPERATION in glReadBuffer (invalid buffer GL_BACK_LEFT)
Mesa: User error: GL_INVALID_ENUM in glDrawBuffers (invalid buffer GL_FRONT)

Errors are also signaled in the event of a softpipe run which is successful.

Could you recommend debugging tips and/or particular recipes for the Power9 build of paraview or its dependencies? Unfortunately it is not easy to produce a minimal example to reproduce the error but we can try if necessary.

Thanks, Francesco