# Building ParaView 5.10.1 with onscreen and offscreen support

**URL:** https://discourse.paraview.org/t/building-paraview-5-10-1-with-onscreen-and-offscreen-support/12292
**Category:** ParaView Support
**Tags:** opengl
**Created:** [June 12, 2023, 4:46pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-with-onscreen-and-offscreen-support/12292 "2023-06-12T16:46:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DeX97](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/bbce88/32.png) [@DeX97](https://discourse.paraview.org/u/DeX97)
#### Post date: [June 12, 2023, 4:46pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-with-onscreen-and-offscreen-support/12292/1 "2023-06-12T16:46:42Z")

</div>

Hi,

I am trying to build ParaView 5.10.1 from source with support for both _onscreen_ and _offscreen_ rendering. I used the [ParaView and Offscreen Rendering](https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html) page as a reference. I have a Debian 10 system.

To build ParaView, I use the following CMake settings

```cmake
cmake -GNinja <paraview-source-directory> \
    -DPARAVIEW_USE_PYTHON=ON \
    -DPARAVIEW_USE_MPI=OFF \
    -DPARAVIEW_USE_CUDA=OFF \
    -DPARAVIEW_USE_QT=ON \
    -DVTK_USE_X=ON \
    -DOPENGL_INCLUDE_DIR=<opengl-include-dir> \
    -DOPENGL_gl_LIBRARY=<opengl-library> \
    -DVTK_OPENGL_HAS_EGL=ON \
    -DOPENGL_EGL_opengl_LIBRARY=<egl-opengl-library> \
    -DVTK_SMP_IMPLEMENTATION_TYPE=OPENMP \
    -DCMAKE_BUILD_TYPE=Release

```

I use `VTK_USE_X=ON` to support _onscreen_ rendering (for the desktop Qt client) and `OPENGL_HAS_EGL=ON` to support (headless) _offscreen_ rendering (connecting to `pvserver` from a different machine). If I use remote visualization (using `pvserver`), I do not encounter any issues. However, using `paraview` (on the machine I built it on) gives an error stating

> GLEW could not be initialized: Missing GL version

When I change the value of `VTK_OPENGL_HAS_EGL` to `OFF`, `paraview` no longer gives this error and is working as expected. However, as soon as I try to use remote visualization (`pvserver`), I get the following warning

> Display is not accessible on the server side.  
> Remote rendering will be disabled.

It thus seems as if `VTK_OPENGL_HAS_EGL=ON` causes the GLEW error, as turning it off fixes the issue with `paraview`. However, when it is off, remote rendering using `pvserver` is no longer supported.

In both cases, the CMake variables related to OpenGL point to the proper system libraries.

I would like to build ParaView such that `paraview` does not give the error related to GLEW and that `pvserver` supports remote rendering. Any suggestions are welcome.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 12, 2023, 4:53pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-with-onscreen-and-offscreen-support/12292/2 "2023-06-12T16:53:56Z")

</div>

Despite what this wiki page claims, this is not supported because of this:

[https://gitlab.kitware.com/vtk/vtk/-/issues/18547](https://gitlab.kitware.com/vtk/vtk/-/issues/18547)
