# Compiling ParaView with EGL for the conda-forge (Python) community

**URL:** https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315
**Category:** ParaView Support
**Tags:** opengl, python, vtk
**Created:** [May 28, 2021, 8:34am UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315 "2021-05-28T08:34:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![basnijholt](https://discourse.paraview.org/user_avatar/discourse.paraview.org/basnijholt/32/6785_2.png) [@basnijholt](https://discourse.paraview.org/u/basnijholt)
#### Post date: [May 28, 2021, 8:34am UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/1 "2021-05-28T08:34:04Z")

</div>

Hi all,

My team and I all develop on a remote Python environment on the Azure cloud. Would like to run ParaView on these headless machines to visualize the systems we are engineering.

Since everyone is using conda + conda-forge (broadly used package manager in the Python community) to install libraries and modules, I would like to compile ParaView with EGL support for easy installation. To give you an idea of how widely this is used, ParaView from conda-forge [has been downloaded 330k times](https://anaconda.org/conda-forge/paraview)!

Right now, paraview with EGL compiles without error but there is still an issue when running code:

```python
(test-paraview2) cw-a-banijh ➜ ~ python
Python 3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import Sphere, Show, GetActiveView, Render

>>> sphere = Sphere(ThetaResolution=16, PhiResolution=32)
>>> Show(sphere)
( 22.097s) [paraview]vtkOpenGLRenderWindow.c:458 ERR| vtkEGLRenderWindow (0x55827ecaa2d0): GLEW could not be initialized: Unknown error
<paraview.servermanager.GeometryRepresentation object at 0x2b69cb1baf70>
>>> view = GetActiveView()
>>> Render(view)
( 22.195s) [paraview]vtkOpenGLRenderWindow.c:458 ERR| vtkEGLRenderWindow (0x55827ec3e4a0): GLEW could not be initialized: Unknown error
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.195s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.199s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.199s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.199s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.203s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.203s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.203s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.205s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.205s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.205s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
( 22.205s) [paraview] vtkOpenGLState.cxx:1785 WARN| Hardware does not support the number of textures defined.
<paraview.servermanager.RenderView object at 0x2b69d5084c10>

```

This indicates an issue with GLEW, which I believe means an issue with OpenGL still.

At this point, I have no idea what to attempt to fix it. Any ideas or suggestions would be greatly appreciated.

For reference

- [the conda-forge pull-request that adds the ParaView EGL package](https://github.com/conda-forge/paraview-feedstock/pull/126)
- [the build.sh script where `cmake` and `make` are called](https://github.com/basnijholt/paraview-feedstock/blob/egl/recipe/build.sh)
- [the dependencies installed with `yum`](https://github.com/basnijholt/paraview-feedstock/blob/egl/recipe/yum_requirements.txt)
- [the compilation outputs on Azure DevOps Pipelines](https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=328178&view=logs&jobId=d0d954b5-f111-5dc4-4d76-03b6c9d0cf7e&j=d0d954b5-f111-5dc4-4d76-03b6c9d0cf7e&t=841356e0-85bb-57d8-dbbc-852e683d1642) or [raw build log.txt](https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/328178/logs/37)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 28, 2021, 11:20am UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/2 "2021-05-28T11:20:27Z")

</div>

What OpenGL backend is being used. I believe that EGL with anything other than nvidia as the driver is not fully working.

Cc: @martink

---

<div class="post-metadata">

### Author: ![basnijholt](https://discourse.paraview.org/user_avatar/discourse.paraview.org/basnijholt/32/6785_2.png) [@basnijholt](https://discourse.paraview.org/u/basnijholt)
#### Post date: [May 28, 2021, 11:43am UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/3 "2021-05-28T11:43:15Z")

</div>

I am linking to `.../sysroot/usr/lib64/libGL.so` which is installed via `yum install mesa-libGL-devel`. I am not 100% sure whether that answers the question, I am not really at home with OpenGL stuff.

Additionally, I am installing:

```auto
mesa-libGL-devel
mesa-libGLU-devel
mesa-libEGL-devel
mesa-libgbm
mesa-dri-drivers
libselinux-devel
libXdamage
libXxf86vm
libX11-devel
libXt-devel
libXtst-devel
libXrender-devel
libXext-devel
libXdmcp-devel
libXcomposite-devel
libXcursor-devel
libxcb-devel
libXau-devel
libXi-devel
libXScrnSaver-devel
libXrandr-devel
alsa-lib-devel
xcb-util-devel
xorg-x11-server-Xvfb
pciutils-devel
libuuid-devel
xorg-x11-server-Xorg

```

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [May 28, 2021, 6:31pm UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/4 "2021-05-28T18:31:21Z")

</div>

This seems to be Mesa EGL, which was not tested AFAIK. As Ben mentioned, we only tested EGL for nvidia.  
If you need headless mesa, use OSMesa instead.

Dan

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [May 28, 2021, 6:33pm UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/5 "2021-05-28T18:33:53Z")

</div>

Here is the documentation for the cmake parameters needed:  
[https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html](https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html)

---

<div class="post-metadata">

### Author: ![basnijholt](https://discourse.paraview.org/user_avatar/discourse.paraview.org/basnijholt/32/6785_2.png) [@basnijholt](https://discourse.paraview.org/u/basnijholt)
#### Post date: [May 31, 2021, 2:31pm UTC](https://discourse.paraview.org/t/compiling-paraview-with-egl-for-the-conda-forge-python-community/7315/6 "2021-05-31T14:31:29Z")

</div>

Thanks! That makes everything quite clear.

I have tested building ParaView and linking against the `libglvnd-devel` package and now ParaView works as expected! 🎉

It might be useful to add a note in the docs [here](https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html) about it only working with NVIDIA’s OpenGL libs.
