Headless mode is a feature of BeamNG that allows you to run the simulation with no window shown. This can be useful in server or cloud environments where no displays are connected. To control the simulation, you can use BeamNGpy or your custom Lua extension.
In this mode, CEF (the web UI framework) is not running and therefore UI is not rendered. Other than that, the full rendering pipeline runs but the presentation is skipped.
You still need a GPU which supports all the features required by non-headless BeamNG. If you are interested in a mode where BeamNG does not use GPU (and therefore no rendering happens),
To run headless you have to launch BeamNG with the -headless command-line argument
. It is common to add the -tcom argument to be able to control the simulation from BeamNGpy (see the Connect to BeamNGpy
section).
BinLinux/BeamNG.tech.x64 -headless -tcom
Bin64\BeamNG.tech.x64.exe -headless -tcom
from beamngpy import BeamNGpy
beamng = BeamNGpy('localhost', 25252, headless=True)
beamng.open()
In no-GPU mode, all rendering is skipped and the GPU is not used. BeamNG.tech capabilities are limited in this mode
(sensor using camera information cannot be used). To run in no-GPU mode, you have to launch BeamNG with the
-gfx null command-line argument
.
BinLinux/BeamNG.tech.x64 -gfx null -tcom
Bin64\BeamNG.tech.x64.exe -gfx null -tcom
from beamngpy import BeamNGpy
beamng = BeamNGpy('localhost', 25252, nogpu=True) # note: the Python version also adds -headless
beamng.open()
You can use the Docker Compose templates which are included with instructions in the BeamNG.tech /tech/docker directory.
Inside you find templates for the headless mode and for the no-GPU mode.
To run without a visible window on Linux but still render the UI, you can use the X Virtual Framebuffer (Xvfb):
sudo apt-get install xvfb # install Xvfb
xvfb-run --auto-servernum BinLinux/BeamNG.tech.x64 # put other command-line arguments here, -headless is not needed
Was this article helpful?