STK 11.1 introduced a new capability to STK Engine: the NoGraphics mode.
Targeted Use Case
The targeted use case for this feature is any application that only consumes STK Engine analytical results, and not its 2D and 3D graphics artefacts. One typical example is a service performing computations on a server or a compute node. This blog post briefly describes the NoGraphics mode, and then explores its benefits:
- Improves runtime performance
- Reduces memory footprint
- Facilitates deployment on headless machines
Activating the NoGraphics Mode
The NoGraphics mode is easily activated. Using the STK programming interface, set the NoGraphics property after instantiating the STK Engine application object and before exercising any other STK Engine operation. With that flag set, STK Engine skips the loading of all graphics code and libraries as well as all initializations and operations related to 2D and 3D graphics. Since STK Engine then no longer handles graphics properties, it does not spend resources managing fonts, models, textures, etc. The creation of background threads to perform those operations is also avoided.
The exclusion of graphics processes improves performance across the board. For instance, when loading scenarios, the 2D and 3D properties do not get loaded. There is no time spent producing graphics. The following figures show the performance differences on both Windows and Linux, using STK Engine 11.1 64-bit configured in offline mode. The two scenarios used are example scenarios shipped with STK (Scenario 1 is the Intro_STK_Space_Systems example, and Scenario 2 is the Intro_STK_COP example). Note that the Windows and Linux machines used for those benchmarks have different hardware, and therefore the results between the two environments should not be compared.
Reduced Memory Footprint
An Additional Benefit on Linux
On Linux, an additional benefit is that dependencies on xlib/OpenGL are avoided. This allows the engine to run on headless servers with no graphics cards and no OpenGL support. Previously this could have been achieved by using X virtual framebuffer (Xvfb), but the setup was complicated and required administrator privileges to configure the X server. Now deployment on a Linux headless server is as simple as “un-tar-ing” the archives and running your application.
Improves STK Parallel Computing Extension Performance
Internally we use this new mode to speed up the STK Parallel Computing Extension. The STK Parallel Computing Extension works by spawning worker processes either on the local machine (standalone mode) or on several machines (cluster mode). The worker processes spawned by the STK Parallel Computing Extension now make use of the “NoGraphics” mode. This has greatly reduced the latency and memory footprint of the parallel computations, and therefore makes parallel computing useful to shorter STK computations.
Ready to Try It?
In summary, the new STK Engine NoGraphics mode does not apply to all use cases, but if your specific application does not need graphics it can provide a significant performance boost. So if your application falls into this category, give it a shot and email email@example.com to let us know!