Unity Window frozen/blank using quickstart example
garfieldnate opened this issue · comments
- Python 3.11.4
- ai2thor 5.0.0 and 4.3.0
- Mac M2 (tested both in x86_64 emulation and in regular ARM64 modes)
- I don't see anything particularly suspicious in Player.log, but I also don't know what to look for specifically
I installed ai2thor with pip3 install ai2thor
. Then I ran the example from https://ai2thor.allenai.org/ithor/documentation/initialization:
from ai2thor.controller import Controller
controller = Controller(
agentMode="default",
visibilityDistance=1.5,
scene="FloorPlan212",
# step sizes
gridSize=0.25,
snapToGrid=True,
rotateStepDegrees=90,
# image modalities
renderDepthImage=False,
renderInstanceSegmentation=False,
# camera properties
width=300,
height=300,
fieldOfView=90
)
The console showed me that the ai2thor binaries and assets were downloaded:
thor-OSXIntel64-a634e28ea55b149ce5f746f19f45dd6f43e5878b.zip: [|||||||||||||||||||||||| 100% 1.2 MiB/s] of 534.MB
However, when I created the Controller
instance, the Unity window that is opened is blank and completely unresponsive (frozen, with the cursor being the beachball of death):
![image](https://private-user-images.githubusercontent.com/778453/266156051-32c4a03c-86a6-42b2-955d-8390c26333af.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTM5ODI4NzIsIm5iZiI6MTcxMzk4MjU3MiwicGF0aCI6Ii83Nzg0NTMvMjY2MTU2MDUxLTMyYzRhMDNjLTg2YTYtNDJiMi05NTVkLTgzOTBjMjYzMzNhZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNDI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDQyNFQxODE2MTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYmUzZDEyYTRiNjY5OWI1Y2RmYThhMThhODZjNWQ1YWFhZDg1NGQ0YThkNmJiZmIzMzRhM2RiYTNjZDJkOTQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.DNsNuBzIT1eEJfFZ1_7Ddw4LuCywivGs0etu7Q229BA)
I thought it was curious that the downloaded zip said OSXIntel64
, considering I'm using an ARM64, but switching to X86_64 emulation mode did not fix the issue. Downgrading ai2thor from 5.0.0 to 4.3.0 did not fix the issue either.
The really weird thing to me is that I can run the ai2thor application directly (not from Python):
$ /Users/nathanglenn/.ai2thor/releases/thor-OSXIntel64-a634e28ea55b149ce5f746f19f45dd6f43e5878b/thor-OSXIntel64-a634e28ea55b149ce5f746f19f45dd6f43e5878b.app/Contents/MacOS/AI2-THOR
The above command opens a responsive AI2Thor window:
![image](https://private-user-images.githubusercontent.com/778453/266156792-72022e74-8b8e-443e-938b-1d206bfe41ee.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTM5ODI4NzIsIm5iZiI6MTcxMzk4MjU3MiwicGF0aCI6Ii83Nzg0NTMvMjY2MTU2NzkyLTcyMDIyZTc0LThiOGUtNDQzZS05MzhiLTFkMjA2YmZlNDFlZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNDI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDQyNFQxODE2MTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03NmY5MDBlY2Y0ZmJlNmM0NDA0ZDgwZDkxMTE5YTFlODgyMmE4MmIxNDYzYTdhNmZiYTY1ZTc5YmVjMTA3NzViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.e8jzMCG5pKHLAZ4ILANxdSTA_NVLEeg0luDxjh3xbL0)
Okay, it turns out that I had not set up the x86 version of Python on my machine correctly. When an ARM64 Python calls executables, they run in ARM64 mode, and ai2thor is only available in x86_64.
Now that I have Python set up correctly, the scene renders. The Unity window is unresponsive and the cursor is always the beachball of death, but I can still control it from Python.
So there are two issues here, which ideally would be fixed but a note in the documentation about known issues/constraints would also be helpful:
- ai2thor is only distributed in x86_64, so it must be used from an x86_64 Python. Setting up two Pythons for different architectures is actually a fairly big ask for most users, and it would be much better to have a build for ARM64 available. Otherwise, noting that this architecture is not supported would at least be a heads-up for the next person.
- The Unity window that opens is unresponsive. This makes it a bit difficult to work on Mac because the OS wants to hide it behind other windows, and the top menus don't work. To be clear, it's responsive to Python code, just not to the user's cursor.