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

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:

(  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

(  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

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,

However linking to these libraries over 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.

Yes, you should use the nvidia proprietary drivers.
Take a look at:

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

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.

Also, did you try our pre-built version for EGL?

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/

Something like

if <variable> is 1:

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

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.