GYM_XPLANE_ML icon indicating copy to clipboard operation
GYM_XPLANE_ML copied to clipboard

X-Plane in headless mode saving GPU power?

Open opt12 opened this issue 6 years ago • 2 comments

Hello adderbyte, very interesting work! I'm really curious to try out your GYM environment as I'm about to code something very similar.

I just wonder, whether using X-Plane in headless mode really saves any GPU resources. As far as I understood, X-Plane still renders the entire scene, but instead of displaying it, it just dumps the graphics to /dev/null. Is that understanding correct? Thanks a lot, Felix

opt12 avatar Apr 29 '19 19:04 opt12

Hi opt12, Thanks for the feedback !

Yes you are right. I ought to have mentioned the changes to be made in XPlane settings before launching in headless mode (it is these settings that might help save GPU resources). Headless mode is just to launch XPlane from a docker or other terminals (amazon cloud for example) without display (which might be needed when launching different models or agents in parallel).

To save GPU resources, the graphics settings in XPlane might help. This improves the frame rate which is important for the simulation and reduce GPU resource usage. The following are the settings changes made before launching the headless mode:

  • [ ] navigate to settings then choose graphics (Settings -> Graphics):

Change the visual effects and other parameters under this : (I select this to be minimal):

illustartion2

Change the monitor Usage (Under monitor configuration) to 2D panel only: illustration

On selecting the 2D panel only, the graphics rendering is reduced to a black display (for Cessna aircraft --as shown below) improving frame rate from 19 /sec to ~60 /sec which helps the simulation run faster while consuming less GPU resources :

2DPanel

Use the map icon in the 2D panel only to view progression of the aircraft

aircraft

  • [ ] Make sure to disable Display main menu on startup option ( under settings -> General settings) before launching in headless mode
  • [ ] After the above changes are made, then launch in headless mode. Note that in this case there would be no display at all and no map to check the progression of the aircraft.
  • [ ] Use the headless mode when launching in cloud (or other terminals without display) or after you have verified all settings are correct and you need the agent to train for long period.

XPlane saves these settings in its Preferences and makes sure it is same when launched in headless mode.

Hope this helps ! Please do let me know if there is any other thing I could add or elaborate more.

Best Regards.

adderbyte avatar May 01 '19 09:05 adderbyte

you can use vglrun to visualize with GPU.

chnclsr avatar Jun 09 '23 07:06 chnclsr