allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.09k stars 210 forks source link

Running ai2thor on Lambda compute #1168

Closed jennyzzt closed 8 months ago

jennyzzt commented 8 months ago

Hi, I have been trying to setup AI2Thor on Lambda, but I keep getting errors when trying to run the headless version. I am using ai2thor version 2.1.0

First, when I just run

controller = Controller(headless=True)
controller.start()
event = controller.step("MoveAhead")

I get:

xdpyinfo:  unable to open display ":0.0".
Traceback (most recent call last):
  File "test_thor.py", line 9, in <module>
    controller.start()
  File "/home/ubuntu/venv_thor/lib/python3.8/site-packages/ai2thor/controller.py", line 855, in start
    self.check_x_display(env['DISPLAY'])
  File "/home/ubuntu/venv_thor/lib/python3.8/site-packages/ai2thor/controller.py", line 714, in check_x_display
    assert subprocess.call("xdpyinfo", stdout=dn, env=env, shell=True) == 0, \
AssertionError: Invalid DISPLAY :0.0 - cannot find X server with xdpyinfo

when I try to run startx.py, I get

X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
Build Operating System: linux Ubuntu
Current Operating System: Linux 192-9-137-1 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-67-generic root=UUID=cb2e0849-89f9-4590-a9b1-61e8b92fc308 ro console=tty1 console=ttyS0
Build Date: 29 March 2023  12:53:02PM
xorg-server 2:1.20.13-1ubuntu1~20.04.8 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Oct 18 00:11:41 2023
(++) Using config file: "/tmp/tmpjf9lk1s9"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

where /var/log/Xorg.0.log is:

[  2227.945] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  2227.945] (II) FBDEV: driver for framebuffer: fbdev
[  2227.945] (II) VESA: driver for VESA chipsets: vesa
[  2227.948] (EE) [drm] Failed to open DRM device for (null): -2
[  2227.948] (EE) [drm] Failed to open DRM device for pci:0000:06:00.0: -2
[  2227.949] (WW) Falling back to old probe method for modesetting
[  2227.950] (II) modeset(1): using default device
[  2227.950] (WW) Falling back to old probe method for fbdev
[  2227.950] (II) Loading sub module "fbdevhw"
[  2227.950] (II) LoadModule: "fbdevhw"
[  2227.950] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[  2227.950] (II) Module fbdevhw: vendor="X.Org Foundation"
[  2227.950]    compiled for 1.20.13, module version = 0.0.2
[  2227.950]    ABI class: X.Org Video Driver, version 24.1
[  2227.950] (EE) [drm] Failed to open DRM device for (null): -2
[  2227.950] (II) modeset(G0): using drv /dev/dri/card0
[  2227.950] (EE) Screen 0 deleted because of no matching config section.
[  2227.950] (II) UnloadModule: "modesetting"
[  2227.950] (EE) 
Fatal server error:
[  2227.950] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[  2227.950] (EE) 
[  2227.950] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[  2227.950] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  2227.950] (EE) 
[  2227.957] (EE) Server terminated with error (1). Closing log file.

Help!

Kajiih commented 2 months ago

@jennyzzt Can I ask you how you solved this? I'm running into the same error in Docker at the moment.

jennyzzt commented 2 months ago

I solved it by using ai2thor>=5.0.0 and

sudo apt-get update
sudo apt-get -y install libvulkan1

Hope this helps!