adderbyte / GYM_XPLANE_ML

GYM Environment for XPlane. Reinforcement Learning and Autonomous Piloting.
GNU General Public License v3.0
65 stars 21 forks source link

X-Plane in headless mode saving GPU power? #1

Open opt12 opened 5 years ago

opt12 commented 5 years ago

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

adderbyte commented 5 years ago

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 theframe rate which is important for the simulation and reduce GPU resource usage. The following are the settings changes made before launching the headless mode:

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

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.

chnclsr commented 1 year ago

you can use vglrun to visualize with GPU.