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

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!

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

(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

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

Cc: @martink

1 Like

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:

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

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

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

Thanks! That makes everything quite clear.

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

It might be useful to add a note in the docs here about it only working with NVIDIA’s OpenGL libs.