diambra / arena

DIAMBRA Arena: a New Reinforcement Learning Platform for Research and Experimentation
https://docs.diambra.ai
Other
313 stars 22 forks source link

Can't run DIAMBRA from remote #5

Closed rssalessio closed 3 years ago

rssalessio commented 3 years ago

I open this ticket because I don't think it is an easy bug to fix (or maybe not?)

I have tried to run DIAMBRA from remote using SSH, and it seems like it's not working. I get the error message "Could not initialize SDL No available video device". Perhaps this is an error due to the fact that the game is not able to open a window?

After few minutes another message pops up "terminate called without an active exception".

Most likely this has something to do with mame, I think.

What I have tried to do so far:

diambra commented 3 years ago

Thank you for the feedback @rssalessio. There is a dedicated parameter for the gym environment to handle this specific situation, we tested it and it works. The parameter is a boolean variable named headless and is False by default, you can set it to True when running from remote (e.g. using ssh). You can test the base example script directly: https://github.com/diambra/DIAMBRAenvironment/blob/main/examples/core/diambraGymGist.py

Please confirm it works for you too.

diambra commented 3 years ago

In addition to using headless=True is now possible, thanks to commit 30773e183f7f80ed7500e3f54d9a582cee8fa626 specify the display you want to use when launching Xvfb. Defaulted to 1 can be increased to find the first free slot.

rssalessio commented 3 years ago

Correct, one needs to use the option headless=True when calling diambraGym (alternatively, you should set diambra_gym_kwargs['headless']=True when you call make_diambra_env ).

Moreover, there is no need to use X11 forwarding in ssh. Just make sure to have Xvfb installed on your ubuntu computer sudo apt-get install xvfb.

This should be tested also on MacOS systems i guess.