allenai / ai2thor

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

Unable to run a Controller with CloudRendering (as instructed in the getting started docs) #1015

Open mkusold opened 2 years ago

mkusold commented 2 years ago

Hello! I am trying to run Thor locally but am unable to get it to work. I am following the instructions here

Steps Taken:

import ai2thor

from ai2thor.controller import Controller
from ai2thor.platform import CloudRendering

if __name__ == '__main__':
    controller = Controller(platform=CloudRendering, scene='FloorPlan28')
    event = controller.step(action='RotateRight')
    print(event.metadata['agent'])
    print(event, event.metadata.keys())

I get the following Traceback:

(ai2thor) kusold@Ms-MacBook-Pro ai2-thor % python test.py                    
Traceback (most recent call last):
  File "/Users/kusold/Development/ai2thor-model-demo/ai2-thor/test.py", line 7, in <module>
    controller = Controller(platform=CloudRendering, scene='FloorPlan28')
  File "/Users/kusold/.pyenv/versions/ai2thor/lib/python3.9/site-packages/ai2thor/controller.py", line 487, in __init__
    self._build = self.find_build(local_build, commit_id, branch, platform)
  File "/Users/kusold/.pyenv/versions/ai2thor/lib/python3.9/site-packages/ai2thor/controller.py", line 1213, in find_build
    raise Exception("\n".join(error_messages))
Exception: The following builds were found, but had missing dependencies. Only one valid platform is required to run AI2-THOR.
Platform CloudRendering failed validation with the following errors: Vulkan API driver missing.
  CloudRendering requires libvulkan1. Please install by running: sudo apt-get -y install libvulkan1

System OS: OSX 12.3.1 Python version: 3.9.10 ai2thor version: 4.2.0

I can't install libvulkan1 cause it is unavailable via brew

mkusold commented 2 years ago

I followed crumbs based on this thread: https://github.com/neovide/neovide/issues/167 and ran: brew install apenngrace/vulkan/vulkan-sdk
which got me farther but then I encountered a different error:

(ai2thor) kusold@Ms-MacBook-Pro ai2-thor % python test.py  
thor-CloudRendering-22d62af5da45708e7bc40bf07a861e7397f9d2f9.zip: [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 100%  26.7 MiB/s]  of 540.MB
Traceback (most recent call last):
  File "/Users/kusold/Development/ai2thor-model-demo/ai2-thor/test.py", line 7, in <module>
    controller = Controller(platform=CloudRendering, scene='FloorPlan28')
  File "/Users/kusold/.pyenv/versions/ai2thor/lib/python3.9/site-packages/ai2thor/controller.py", line 492, in __init__
    self.start(
  File "/Users/kusold/.pyenv/versions/ai2thor/lib/python3.9/site-packages/ai2thor/controller.py", line 1295, in start
    self._start_unity_thread(env, width, height, unity_params, image_name)
  File "/Users/kusold/.pyenv/versions/ai2thor/lib/python3.9/site-packages/ai2thor/controller.py", line 1002, in _start_unity_thread
    self.server.unity_proc = proc = subprocess.Popen(
  File "/Users/kusold/.pyenv/versions/3.9.10/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/kusold/.pyenv/versions/3.9.10/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/Users/kusold/.ai2thor/releases/thor-CloudRendering-22d62af5da45708e7bc40bf07a861e7397f9d2f9/thor-CloudRendering-22d62af5da45708e7bc40bf07a861e7397f9d2f9'
ekolve commented 2 years ago

The CloudRendering engine will only run on Linux. You should be able to run it in one of the vision servers or you could just run the OSX version locally.

mkusold commented 2 years ago

Excellent information. Thank you. How would I go about running the OSX version locally? Does that mean I'd have to have Unity installed?

mattdeitke commented 2 years ago

You should be able to just use the default platform, that is:

from ai2thor.controller import Controller
controller = Controller()
event = controller.step(action=“RotateRight”)
print(event)