# Straight-forward headless, X-less rendering with EGL + nvidia GPU + ParaView v5.8.1

**URL:** https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879
**Category:** ParaView Support
**Tags:** opengl, python
**Created:** [November 24, 2020, 4:12pm UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879 "2020-11-24T16:12:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [November 24, 2020, 4:12pm UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/1 "2020-11-24T16:12:55Z")

</div>

We have a new workstation that we want to post process large datasets with (combo of pvtm and xdfm/hdf5).

This workstation has an RTX2080 and is running Ubuntu 20.04. The only caveat being we want it done in headless mode, without an X session running, and rendering on the GPU (to make sure I am using these terms appropriately, I want to be able to ssh into this machine without X forwarding, and execute a python script that will output images rendered on the GPU, not the CPU). Last bit, our workflow is using v5.8.1 to create the states that we then run in pvpython, so that’s the version I am building.

After scouring these forums, my understanding is here.

I need to build ParaView with the HAS\_EGL option ON, and USE\_X set to OFF. Ubuntu 20.04 doesn’t have EGL, so we installed them via apt (libegl-dev), we also got the header files from the Khronos website, though it seems that apt provides these headers, as they were found with CMake. We also install OpenGL via apt.

CMake is appeased, and building from source goes smoothly.

However running a known-good python script that outputs an image with the pre-built PV binaries with an active X session, we get the following output:

```auto
( 93.379s) [main thread] vtkEGLRenderWindow.cxx:295 WARN| vtkEGLRenderWindow (0x55e4f4df0b00): EGL device index: 0 is greater than the number 
of supported deviced in the system: 0. Using device 0 ...

```

My interpretation of that is the GPU is not being detected. We do get two ERRs as well

```auto
( 93.379s) [main thread] vtkEGLRenderWindow.cxx:381 ERR| vtkEGLRenderWindow (0x55e4f4df0b00): Only EGL 1.4 and greater allows OpenGL as clien
t API. See eglBindAPI for more information.
( 93.379s) [main thread]vtkOpenGLRenderWindow.c:565 ERR| vtkEGLRenderWindow (0x55e4f4df0b00): GLEW could not be initialized: Missing GL versi
on

```

Assuming these warnings and errors are independent, it seems the EGL version installed by apt is not sufficient. But the EGL is provided by MESA v20 which should be v1.5

There are other EGL libraries on the system,

libEGL\_mesa.so  
libEGL\_nvidia.so

However linking to these libraries over libEGL.so results in unknown symbols when compiling.

I’m a little stuck at this point. I have places that I THINK I can go but its not based on any sort of understanding. Should I have the nvidia proprietary drivers installed, currently we have the default nouveau? Build MESA from source and link to those provided libraries?

I am aware of osmesa options, however, we have the GPU…

I have tried compiling ParaView from source with both RENDERING and CANONICAL Editions, as well as from the superbuild with the same results.

Thanks for taking a look at this, and all the development work on PV.

---

<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: [November 24, 2020, 4:42pm UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/2 "2020-11-24T16:42:06Z")

</div>

Yes, you should use the nvidia proprietary drivers.  
Take a look at:  
[https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html](https://kitware.github.io/paraview-docs/latest/cxx/Offscreen.html)

The ParaView Builds section gives you more information about the variables you need to set.

---

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [November 24, 2020, 6:25pm UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/3 "2020-11-24T18:25:40Z")

</div>

Thanks, Dan

That page has been very valuable in helping my understanding.

I will get the proper drivers installed and report back with the progress after that.

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [November 24, 2020, 9:11pm UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/4 "2020-11-24T21:11:27Z")

</div>

Also, did you try our pre-built version for EGL?  
[https://www.paraview.org/download/?version=v5.9&filter=Linux](https://www.paraview.org/download/?version=v5.9&filter=Linux)

---

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [November 26, 2020, 3:00am UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/5 "2020-11-26T03:00:03Z")

</div>

In fact, I did and was excited about it being included in the prebuild as I have had to do this on several HPC systems I have access to, however it SyntaxedWarning with what I recall was a very clear python typo. Don’t quote me on that as it was a one off last week, but I believe it was an instance of using “is” to compare two ints.

If I recall correctly it was in the numpy\_interface/algorithms.py

Something like

```python
if <variable> is 1:

```

I can revisit it and report once I get this up and running.

---

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [November 26, 2020, 3:01am UTC](https://discourse.paraview.org/t/straight-forward-headless-x-less-rendering-with-egl-nvidia-gpu-paraview-v5-8-1/5879/6 "2020-11-26T03:01:46Z")

</div>

Installing the nvidia drivers was all it took. everything CMake found in terms of EGL, OpenGL, etc. libraries was just fine by default and it ran perfectly after that. Thanks, all.
