question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Ai2thor in a docker container (ubuntu 20.04 system) And access GUI on windows 10 host

See original GitHub issue

Hi @ekolve @synapticarbors @Lucaweihs @dirkgr @schmmd

Thank you so much for creating this powerful simulator!

Since I have a Windows laptop, and it seems AI2THOR support Linux, so I create a docker container with a Ubuntu 20.04 system and install ai2thor using pip install. Then I try to convey the GUI of simulator from container to Windows X server.

I already configured the correct DISPLAY variable and launch a VcXsrv on Windows. I try first to run some X11-apps in container, such as xeyes, xclock, and I can successfully see the GUI of them from Windows. But when I try to run ai2thor example, it always said Platform Linux64 failed validation with the following errors: Invalid display, non-existent screen:192.168.1.67:0.0. But this `“192.168.1.67:0.0” is just what I use for xeyes or xclock and they all work.

The I trace back from the error and found that the ai2thor program tries to validate my screen using this function from ai2thor.platform.py @classmethod def _valid_x_displays(cls, width, height): \\ open_display_strs = [ int(os.path.basename(s)[1:]) for s in glob.glob("/tmp/.X11-unix/X[0-9]*") ] valid_displays = [] for display_str in open_display_strs: try: disp = Xlib.display.Display(":%s" % display_str) for screen in range(0, disp.screen_count()): disp_screen_str = ":%s.%s" % (display_str, screen) if cls._is_valid_screen(disp_screen_str, width, height): valid_displays.append(disp_screen_str) except Xlib.error.DisplayConnectionError as e: warnings.warn( "could not connect to X Display: %s, %s" % (display_str, e) ) return valid_displays

And I double-check the ubuntu container and found out I have no “/tmp/.X11-unix/X[0-9]*” exist. I guess this unix socket is probably the reason but I don’t know how to fix. Since my X server is actually on Windows, not in the ubuntu container.

Could you please take a look and help me with it? Thanks a lot! (it took me two days)

p.s. I know there is a ai2thor-docker but on my Windows machine I don’t have Nvidia-GPU and CUDA things, so I didn’t try that.

Best Xubo

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xubo92commented, Jul 7, 2021

Hi @mattdeitke

Thank you so much for providing this alternative! I’ve configured in windows following your steps and it works!

1reaction
mattdeitkecommented, Jul 6, 2021

Hi @xubo92,

We don’t currently publicly support Windows, but it should be possible, and is something I’ve looked into.

AI2-THOR Colab

First, if you are just looking to experiment with AI2-THOR on a Windows device, and not training any models, I’d suggest using ai2thor-colab. It will handle all the dependency installations and setup, and provides a nice environment to play around with AI2-THOR. Granted, using Colab probably will not be fast enough to train any models.

Running Locally on Windows

This is a bit more manually involved. Hopefully at some point soon, we will officially support Windows, so one doesn’t need to manually open up Unity. But, here are the steps:

  1. Download the Unity Editor version 2019.4.20 LTS from the Unity Download Archive
  2. Clone AI2-THOR locally (e.g., git clone https://github.com/allenai/ai2thor.git)
  3. Open up the ai2thor/unity/ folder in Unity.
  4. Go to File -> Build Settings. You should see a screen similar to what is shown below. Click Build and save the build to some path. This will take at least a couple of minutes to save. image
  5. Install ai2thor v3.1.0 (e.g., pip install ai2thor==3.1.0). Note: There have since been some updates that break this with the lastest Python version, hence why v3.1.0 of the Python API must be installed. Specifically, build.py not expecting a Windows OS.
  6. Step 4 will save a file called AI2-THOR.exe into the provided directory. Now in Python, make sure ai2thor is installed (e.g., pip install ai2thor), and point the Controller to that AI2-THOR.exe path:
from ai2thor.controller import Controller
controller = Controller(local_executable_path="AI2-THOR.exe")

image

This creates a Controller and should have everything working with Windows.

Also Note: Windows tends to be slower than a Linux based system because one cannot utilize the FIFO Server speedups from AI2-THOR v2.7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run GUI app in linux docker container on windows host
I use Arch Linux on my private computer at home and Windows 10 at work. I wanted to be able to use the...
Read more >
Running Ai2thor from Docker Container · Issue #931
Hey, I'm trying to run Ai2thor from custom docker container (NOT via ... System config: Ubuntu Version inside docker: 20.04 LTS Host Ubuntu...
Read more >
Full Ubuntu GUI in a Container Displayed on Windows (XServer)
Run Ubuntu Desktop Environment in a Docker Container and Display on Windows. WANT TO SUPPORT?
Read more >
How To Remotely Access GUI Applications Using Docker ...
By using noVNC and TigerVNC, you can run native applications inside a Docker container and access them remotely using a web browser.
Read more >
A Guide to Running GUI Applications in a Docker Container
Getting a GUI application to run in a container requires several distinct steps: Installing the application and its dependencies in a container.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found