1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.36 Bug Reporting thread
    Solutions and more information may already be available.

Issue when running multiple instances

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by leo099, Mar 8, 2024.

  1. leo099

    leo099
    Expand Collapse

    Joined:
    Mar 8, 2024
    Messages:
    2
    Hi,
    I am using BeamNG.tech v0.31.3.0 for academic research. I need to run parallel simulations, I already setup all the needed infrastructure with the Python API, but I am encountering strange issues with the simulator itself.
    I am running one scenario after the other in 11 parallel instances of the simulator where a single car drives from start to end of a road generated at runtime on a flat map. There is a camera sensor mounted on the car and it is in shared memory mode. The instances are restarted after 20 scenarios have been completed to circumvent memory leaks, as I need to run this for several days. It usually works fine, but sometimes after the CreateScenario message the scenario start overlay goes away, but the timer does not start and the simulator stops replying to the Python library. The simulator does not crash or hang and the socket used to communicate with BeamNGpy is still open and functional (TCP ACKs are sent correctly). The issue seems to appear more often (only?) when I just restarted that instance of the simulator.

    I set different userpaths and ports for each parallel instance, an example start log from one instance is like this:
    Code:
    [17:57:31 INFO] Opening BeamNGpy instance.
    [17:57:31 DEBUG] Determined BeamNG.* binary to be: C:\Users\sdq\Desktop\BeamNG\BeamNG.tech.v0.31.3.0\Bin64\BeamNG.tech.x64.exe
    [17:57:31 DEBUG] Created system call for starting BeamNG process: `C:\Users\sdq\Desktop\BeamNG\BeamNG.tech.v0.31.3.0\Bin64\BeamNG.tech.x64.exe -nosteam -console -tcom-listen-ip 127.0.0.1 -lua extensions.load('tech/techCore');tech_techCore.openServer(65001) -userpath C:\Users\sdq\Desktop\deepjanus\DeepJanus-BNG\data\simulations\beamng\instance1`
    [17:57:31 INFO] Started BeamNG.
    [17:57:41 INFO] Connecting to BeamNG.tech at: (localhost, 65001)
    [17:57:42 INFO] Successfully connected to BeamNG.tech.
    [17:57:42 INFO] BeamNGpy successfully connected to BeamNG.
    I noticed that when I encounter the problem there is this error in the game logs, that is not present when the scenario can start successfully:
    Code:
    0.30200|I|GELua.| ============== Game Engine Lua VM started ==============
      0.34257|D|GELua.gameplay_missions_progress.| Loaded 0 condition types from 0 files.
      0.34318|D|GELua.gameplay_missions_missions.| Loaded 2 procedural Mission Generators from 2 files.
      0.34432|D|GELua.gameplay_missions_unlocks.| Loaded 9 condition types from 4 files.
      0.34731|D|engine::GFXInit::init| GFX Init:
      0.34733|D|engine::_GFXInitReportAdapters|    Null device found
      0.34738|D|engine::ModuleManager::initializeSystem| ... all modules loaded in 0.11704089999999999 seconds
      0.34745|E|CommandListener| CommandListener not working. Unable to open Pipe. Is another instance of BeamNG still running?
      0.34745|E|engine::GameEngineLua::startCommandListener| Failed to start command listener
    I am trying to look into the Lua code to understand what could be causing this issue, but any pointers are appreciated.

    Thank you for the help.
    --- Post updated ---
    I could not find CommandListener or GameEngineLua::startCommandListener in any Lua file in "BeamNG.tech.v0.31.3.0\lua", I suppose that it is internal engine code.
     
    #1 leo099, Mar 8, 2024
    Last edited: Mar 8, 2024
  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,085
    UPDATE: looking into it! :)
     
    #2 tdev, Mar 8, 2024
    Last edited: Mar 8, 2024
  3. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,085
    I just added a new command line option for the next update that will disable the listener: -nocmdlistener
     
  4. leo099

    leo099
    Expand Collapse

    Joined:
    Mar 8, 2024
    Messages:
    2
    Thank you for the quick reply and fix.
    Just for curiosity, what is the listener for?
     
  5. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,085
    It opens a pipe to listen for commands, so that custom download buttons in the online repo work with the game running.

    For example: beamng:v1/subscriptionMod/MOF4J5HQB
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice