How to build VTK on a supercomputer without X-Server and no root previliges

If you have no X server, you will indeed need to build against osmesa. Setting the OffScreenRendering option in vtkRenderWindow is not sufficient - that option still relies on X being present.

I recommend a couple options:

  1. Download and install ParaView 5.6.0 for linux built against osmesa. If you want to run Python scripts that use VTK, you can run pvpython and run
>>> import paraview.vtk as vtk
>>> from vtk import *

It isn’t the ideal way to import VTK, but it will get you running.

  1. Follow how ParaView’s superbuild process builds osmesa. You can start here and get clues as to which configuration flags are needed in the files that script includes, which are located here.
1 Like