glvis
glvis copied to clipboard
EGL headless visualization
This PR adds headless (no GUI) visualization using EGL standard. The new EglWindow serves as an alternative backend instead of SdlWindow, which is no longer needed directly and the code uses general GLWindow base class instead. The headless rendering is available in the following ways:
- from command line with option
-hl(control keyqshould be used to quit after the visualization is done) - saved streams when started with the above option (end of the input stream closes the visualization)
- from scripts, starting them with the above option or through
headlesscommand before the visualization command(s), which are then performed without autopausing (end of the script files closes the visualization) - server started with the
-hloption, where end of the input streams also closes the visualization(s)
โช๏ธ dependencies:
- #335
๐ bonus features:
- moved SDL-based content to
sdldirectory (and similarly EGL-based toegl), cleaning up file hierarchy - fixed handling of screenshot command in scripts, as criticized in #254
- fixed caching of MFEM in CI tests (MPI option was not recognized)
- removed
using namespace stdpollution (i.e., uncontrolled spreading through header files)
๐ todo:
- [x] CI building (only Ubuntu)
- [x] server mode
- [ ] CI tests?
โ๏ธ testing:
- [x] some cmd lines
- [x] some scripts
- [x] some saved streams
- [x] inline visualization
- [x] js
I have tried headless CI tests with EGL and some pass smoothly, but other fail at initialization. There seems to be some issue on the runners like limited video memory or something, so it is very random. You may compare this run and this. I have removed the tests and only building with EGL support is done on Ubuntu (in the existing runs, tests use SDL normally).
Ok, the headless server works nicely now. It should be tested in combination with parallel applications on clusters. If IP/TCP sockets cause some problems, we could try to use Unix sockets locally on the node ๐ค .
Ok, the headless server works nicely now. It should be tested in combination with parallel applications on clusters. If IP/TCP sockets cause some problems, we could try to use Unix sockets locally on the node ๐ค .
That's awesome, thanks @najlkin !
@justinlaughlin, what happens if we load a steam with "screenshot" command in the web version?
I think an error ๐ , because glvis-js supports only keys and valuerange commands apart from the data loading ones (see #315 ). But you may enter keys S to get a screenshot. I wonder what will happen then ๐ค .
@justinlaughlin, what happens if we load a steam with "screenshot" command in the web version?
I think an error ๐ , because glvis-js supports only
keysandvaluerangecommands apart from the data loading ones (see #315 ). But you may enterkeys Sto get a screenshot. I wonder what will happen then ๐ค .
I think pressing S will "download" the new file that is created by the C++ code, so depending on your browser configuration, the file may be saved directly to your "Downloads" folder without a prompt, or you may get a "save file" dialog box to choose where to save the file.
Hmm, at least in basic.html nothing happens after S. It would be too nice to get a file ๐ . I guess it violates some security policies and the code does not get a writing file handle ๐ซ .
But in glvis live, it works๐ฎ . However, there is a special code for it, handling specifically S, calling saveScreenshot() in index.js. You get glvis.png file for download. It shares SaveAsPNG() with the main code, so there is a potential for headless operation if you are thinking that way ๐ .