Farama-Foundation / ViZDoom

Reinforcement Learning environments based on the 1993 game Doom :godmode:
https://vizdoom.farama.org/
1.75k stars 404 forks source link

host and agent can't contact to each other #322

Closed howl-anderson closed 6 years ago

howl-anderson commented 6 years ago

Issue

My mocked evaluation host and demo agent are both blocked when try to contact to each other.

My host blocked at :

D_CheckNetGame: Checking network game status. Console player number: 0 Press 'Q' to abort network game synchronization. Waiting for players: . [ 1/ 2]

While the same time, my agent blocked at:

AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse" Press 'Q' to abort network game synchronization. Contacting host: /

detailed environment information:

output of command netstat -tulpn:

tcp 0 0 127.0.0.1:63342 0.0.0.0: LISTEN 3149/java
tcp 0 0 0.0.0.0:80 0.0.0.0:
LISTEN -
tcp 0 0 127.0.0.1:5939 0.0.0.0: LISTEN -
tcp 0 0 127.0.1.1:53 0.0.0.0:
LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:
LISTEN -
tcp 0 0 0.0.0.0:39099 0.0.0.0: LISTEN 3149/java
tcp 0 0 127.0.0.1:6942 0.0.0.0:
LISTEN 3149/java
tcp 0 0 127.0.0.1:44575 0.0.0.0: LISTEN 12958/python
tcp 0 0 0.0.0.0:33577 0.0.0.0:
LISTEN 3149/java
tcp6 0 0 :::80 ::: LISTEN -
tcp6 0 0 :::22 :::
LISTEN -
tcp6 0 0 ::1:631 ::: LISTEN -
udp 0 0 0.0.0.0:45487 0.0.0.0:
-
udp 0 0 192.168.8.155:37589 0.0.0.0: 18467/chromium-brow udp 0 0 0.0.0.0:5353 0.0.0.0: 18467/chromium-brow udp 0 0 0.0.0.0:5353 0.0.0.0: -
udp 0 0 0.0.0.0:38398 0.0.0.0:
19327/vizdoom
udp 0 0 172.17.0.1:55541 0.0.0.0: 18467/chromium-brow udp 0 0 0.0.0.0:39446 0.0.0.0: -
udp 0 0 127.0.1.1:53 0.0.0.0: -
udp 0 0 0.0.0.0:68 0.0.0.0:
-
udp 0 0 0.0.0.0:631 0.0.0.0: -
udp6 0 0 :::37916 :::
-
udp6 0 0 :::5353 ::: 18467/chromium-brow udp6 0 0 :::5353 ::: -

Miffyli commented 6 years ago

My mocked evaluation host and demo agent

I am not sure what you mean by "mocked evaluation host and demo agent". Is this related to the CIG2018 competition?

Have you tried running the example client and host codes with same Docker setup? I am not sure what configurations are needed to make hosting/joining to work with Docker images.

howl-anderson commented 6 years ago

Sorry, I don't say it. I used the docker images provide by https://github.com/crowdAI/vizdoom2018-singleplayer-starter-kit for both host and agent images.

Miffyli commented 6 years ago

I would hazard a guess it has something to do with configuration of Docker, maybe it prevents such communication by default? (Sorry, I am not experienced with Docker)

In any case I suggest you open an issue in that (vizdoom2018 starter kit) repository.

howl-anderson commented 6 years ago

Thank you for the help.

spMohanty commented 6 years ago

@howl-anderson : I have noticed this issue a lot when either of the host or the agent containers do not have a tty attached. Please make sure that the process which is running the actual game has a tty attached, and it should run fine.

howl-anderson commented 6 years ago

@spMohanty It related to crowdAI/vizdoom2018-singleplayer-starter-kit#2

sikiyu27 commented 3 years ago

I also meet this problem. When running on the cloud, the connection fails. Is there a solution?

error: Press 'Q' to abort network game synchronization. Contacting host: Contacting host: /Press 'Q' to abort network game synchronization. Press 'Q' to abort network game synchronization. Waiting for players: Contacting host: Contacting host: / Waiting for players: . [ 1/ 5]Press 'Q' to abort network game synchronization. Press 'Q' to abort network game synchronization. Contacting host: Contacting host: Contacting host: / Contacting host: /

Timeout, network game synchronization aborted.Timeout, network game synchronization aborted.Timeout, network game synchronization aborted.Timeout, network game synchronization aborted.Timeout, network game synchronization

Miffyli commented 3 years ago

@sikiyu27 Check out #417 and the comments in it. Also check sample-factory and its networking code, which trains agents with self-play successfully.

sikiyu27 commented 3 years ago

@Miffyli i have tried all, it work in my personal machine but still not work on cloud.

sikiyu27 commented 3 years ago

D_DoomInit: Static RNGseed 741840231 set. M_LoadDefaults: Load system defaults. Gameinfo scan took 0 ms W_Init: Init WADfiles. adding /root/miniconda3/lib/python3.6/site-packages/vizdoom/vizdoom.pk3, 583 lumps adding /root/miniconda3/lib/python3.6/site-packages/vizdoom/freedoom2.wad, 3649 lumps viz_controlled is write protected. viz_instance_id is write protected. viz_async is write protected. viz_window_hidden is write protected. viz_noxserver is write protected. viz_nosound is write protected. viz_connect_timeout is write protected. I_Init: Setting up machine state. CPU Vendor ID: GenuineIntel Name: Intel(R) Xeon(R) Gold 6266C CPU @ 3.00GHz Family 6, Model 85, Stepping 7 Features: MMX SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 V_Init: allocate screen. S_Init: Setting up sound. ST_Init: Init startup screen. Checking cmd-line parameters... S_InitData: Load sound definitions. G_ParseMapInfo: Load map definitions. Texman.Init: Init texture manager. ViZDoom 1.1.8 (ZDOOM 2.8.1) - SDL version Compiled on Aug 12 2021

D_DoomInit: Static RNGseed -128867033 set. M_LoadDefaults: Load system defaults. Gameinfo scan took 0 ms W_Init: Init WADfiles. adding /root/miniconda3/lib/python3.6/site-packages/vizdoom/vizdoom.pk3, 583 lumps adding /root/miniconda3/lib/python3.6/site-packages/vizdoom/freedoom2.wad, 3649 lumps viz_controlled is write protected. viz_instance_id is write protected. viz_async is write protected. viz_window_hidden is write protected. viz_noxserver is write protected. viz_nosound is write protected. viz_connect_timeout is write protected. I_Init: Setting up machine state. CPU Vendor ID: GenuineIntel Name: Intel(R) Xeon(R) Gold 6266C CPU @ 3.00GHz Family 6, Model 85, Stepping 7 Features: MMX SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 V_Init: allocate screen. S_Init: Setting up sound. ST_Init: Init startup screen. Checking cmd-line parameters... S_InitData: Load sound definitions. G_ParseMapInfo: Load map definitions. Texman.Init: Init texture manager. ParseTeamInfo: Load team definitions. ParseTeamInfo: Load team definitions. LoadActors: Load actor definitions. LoadActors: Load actor definitions. R_Init: Init Doom refresh subsystem. R_Init: Init Doom refresh subsystem. DecalLibrary: Load decals. DecalLibrary: Load decals. Adding dehacked patch freedoom2.wad:DEHACKED Adding dehacked patch freedoom2.wad:DEHACKED Patch installed Patch installed M_Init: Init menus. M_Init: Init menus. P_Init: Init Playloop state. P_Init: Init Playloop state. ParseSBarInfo: Loading default status bar definition. ParseSBarInfo: Loading default status bar definition. ParseSBarInfo: Loading custom status bar definition. ParseSBarInfo: Loading custom status bar definition. This is Freedoom, the free content first person shooter.

============================================================================ D_CheckNetGame: Checking network game status. D_CheckNetGame: Checking network game status. using alternate port 40300 Console player number: 0 Node number 0, address 127.0.0.1 Press 'Q' to abort network game synchronization. Waiting for players: Press 'Q' to abort network game synchronization.

Waiting for players: . [ 1/ 2]Contacting host: Contacting host: / Timeout, network game synchronization aborted. Timeout, network game synchronization aborted.

Miffyli commented 3 years ago

Unfortunately I have no further tips to give :/. One thing you could try is installing an older version of vizdoom in case the recent updates broke anything (but they should not have).

To ensure networking works correctly on your cloud machine I would also try running the sample-factory self-play code. That code is known to work on multiple systems, and if it fails, there might be something odd in your cloud instances.

sikiyu27 commented 3 years ago

Thank you. I'll try again.