Hey there,
It’s Robin from CFD Engine fresh from another week masquerading as a teaching assistant in the UK’s most-mediocre home school.
This email was intended to be a quick guide to using ParaView Superbuild (bear with me) but, whilst updating my notes, it turns out that things have changed and that’s knowledge you’ll never need 🤷♂️
So let’s go with headless ParaView instead. If you ever need to run ParaView on a machine that doesn’t have graphics hardware or an X-server (whether it’s in the cloud or in your closet) then stick with me.
I’ll also throw in a neat way to connect to said machine (especially if you’re behind a firewall).
Niche ParaView knowledge? Sure, but the cool kids aren’t reading this, so let’s geek out…
Headless ParaView
I’ve mentioned before that I do everything on the cluster – mesh, solve and post-pro. This means that I’m often running ParaView on machines that have no graphics provision at all – no graphics card, no X-server, no ability to show anything graphical on a screen 🙈
In the past you had to get a bit creative to get this to work. One option would be to rig up a separate post-processing queue on a machine with decent graphics hardware. Another option would be to compile a version of ParaView that doesn’t need graphics hardware or an X-server – headless ParaView.
Note: When I say headless ParaView, I mean
pvbatch
,pvserver
&pvpython
– you can’t actually build a headless ParaView – a graphical user interface without graphics has some usability issues.
We can do lots with these utilities though – pvbatch
can be used to create unattended post-pro using python scripts, pvserver
is one half of a client/server arrangement & pvpython
gives us a way to interact with the ParaView Python API.
The headless versions actually perform (almost) as well you’d expect from a machine with graphics hardware.
Superbuild
In the olden days, if you wanted a version of ParaView that ran headless then you had to compile your own 🥶
Enter, ParaView Superbuild a neat project that takes the sting out of building ParaView (and it’s many dependencies) and (optionally) packaging it up so that you can easily install it on other machines.
That’s what I was going to write about – how to build your own headless ParaView using Superbuild. But, whilst doing my homework & checking my Superbuild notes, I noticed that ParaView now provide headless Linux binaries for download 🥳
They’re available for the current version (5.9.0) all the way back to version 5.6.0 – check them out here. Download & unpack them on your headless machines for instant ParaView. You will miss all the fun of a superbuild though.
FYI: These binaries can also be run in Docker containers, which often don’t have access to their host’s graphics.
By the way, let me know if you want my up-to-date (but probably obsolete) Superbuild crib sheet.
Remote Connections
ParaView is built for running in a client/server mode. Fire up a server on the machine that has access to your data, fire up a client on your local machine, connect the two & you’re off to the races. Once connected, the experience is pretty much like having everything on your local machine – slick.
There are various ways to start the server, but I usually just SSH into a remote machine & start pvserver
manually. It sits there listening on port 11111 (you can change this) until I fire up a local ParaView client and point it at the server. The problem comes when you can’t (or don’t want to open ports on your firewall).
Try this tweak (thanks to this comment on the ParaView mailing list) 🙏
When you SSH to the remote machine, use the -L
switch to forward the port along the SSH connection (rather than having to open any additional ports). Change <user>@<host>
to whatever your user & host are called. If you can’t SSH to the machine, then you’ve got bigger problems, sorry.
ssh -L 11111:127.0.0.1:11111 <user>@<host>
Once connected, start pvserver
and it’ll patiently wait for you to start ParaView on your local machine (leave the SSH connection open).
In your local ParaView, go to File > Connect & click Add Server. The defaults should look something like this…
Change the name to something more original & click Configure.
Leave the startup type as Manual (you’ve already started it) & click Save.
Select your new configuration from the list & either double-click it or click Connect. If you go back to your SSH connection you should see a success message reporting your newly made connection.
You should be all set – go, go, post-pro.
Using this method there’s no need to open any additional ports & you also won’t need to keep updating the server address in ParaView.
Let me know
If I’m doing any of this wrong then please let me know, partly so that I can improve, but also so that I can share it with the rest of the class. I’m always keen to hear other ways of doing things & your experience with this stuff.
Similarly, I’m also keen to know if you’ve found any of these emails particularly useful. Let me know your takeaways & perhaps I can do more on those subjects.
Until next week, CFD safely,