[Paraview] Building Paraview for headless rendering

Chuck Atkins chuck.atkins at kitware.com
Wed Mar 21 12:58:44 EDT 2018


Hi Martin,

we have an user who wants to use Paraview in headless mode. We found the
> hard way that the binary does not have the headless rendering enabled.
>

Yes and no.  The pre-built binaries you download do require an X server to
be present.  However, that can be achieved in many different ways.  One
common approach for a headless environment is to use Xvnc to start up a
fake X server that you never actually look at or log in to.  You can then
set the DISPLAY variable to whatever that starts up as and have ParaView
use it.  You can then use the included mesa libraries via the --mesa-swr or
--mesa-llvmpipe flags to pvserver or pvbatch.  Given that, you could get
away with probably using the pre-built binaries as the easiest route. That
being said, if you still want to build your own, I'll go ahead and answer
your remaining questions.



> 1. A more genereal question first - our cluster nodes don't have good GPUs
> so the plan is to render on the CPU. I assume we need Mesa for it, right?


Yes.  CPU based rendering will be via the mesa llvmpipe or swr drivers.  If
you have relatively new Intel CPUs, i.e. SandyBridge or newer, then you'll
want to use the swr driver as it's far more performant and scalable.



> Further, since we want to render on the server, do we need to set the
> DISPLAY variable to :0, or, is there any other way to tell this to Paraview?
>

If you're building using OSMesa tfor off-screen-only rendering then the
DISPLAY variable has no meaning and is not needed.  It's used to tell
ParaView which X server to use for rendering (see above with starting a
virtual X server via vnc).



> 2. As for our attempted build, I tried both the OSMesa and EGL with the
> following results:
>
> a) OSMesa - turn VTK_OPENGL_HAS_OSMESA on, cmake finds my OS installed
> OSMesa (CentOS7 - mesa-libOSMesa-devel-17.0.1-6.20170307.el7.x86_64),
> everything builds, but, when I try to run Paraview, I get:
> ERROR: In /uufs/chpc.utah.edu/sys/srcdir/paraview/5.4.0/VTK/Rendering/
> OpenGL2/vtkOpenGLRenderWindow.cxx, line 831
> vtkXOpenGLRenderWindow (0x425a480): GL version 2.1 with the gpu_shader4
> extension is not supported by your graphics driver but is required for the
> new OpenGL rendering backend. Please update your OpenGL driver. If you are
> using Mesa please make sure you have version 10.6.5 or later and make sure
> your driver in Mesa supports OpenGL 3.2.
>

Try setting both -DVTK_OPENGL_HAS_OSMESA=ON and -DVTK_OPENGL_USE_X=OFF .
If it's still fussy,then set the environment
variable MESA_GL_VERSION_OVERRIDE=3.3 .  It shouldn't be an issue if you
use the latest Mesa but the shipped 17.0.1 with CentOS may be a bit buggy.



> b) EGL
>

The current EGL support is really only for use with offscreen rendering on
NVidia GPUs and does not yet work with the Mesa EGL implementation.



> As I mentioned, we are running a fairly stock CentOS 7.4.
>

You're best bet is to build your own Mesa rather than rely on the system
package since a newer release will include the swr driver and be more
performant.

Or if you can use use the pre-built binaries with a dummy X server, you
might save yourself a lot of headaches.

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180321/79ab1cf0/attachment.html>


More information about the ParaView mailing list