Jiayuan-Gu / hab-mobile-manipulation

Mobile manipulation in Habitat
https://sites.google.com/view/hab-m3
62 stars 9 forks source link

Why do I get an error when I run this command: python setup.py install --bullet --headless? #2

Open MaYuan777 opened 1 year ago

MaYuan777 commented 1 year ago

When I run this command, the terminal prompts me:

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help

error: option --bullet not recognized

Thanks to the people who will be able to inform me of the solution in the future.🙏🙏🙏

Jiayuan-Gu commented 1 year ago

Hi. Can you ensure that you use the same version of habitat-sim (habitat-sim @ ccbfa32) if you install it from the source?

Habitat-sim and habitat-lab have made some breaking changes in their latest versions. However, this repository's codes mainly leverage class inheritance of the official codes, and thus may only need a few changes to be compatible with the latest version.

MaYuan777 commented 1 year ago

Thanks for your reply, I solved the issue. But I ran into a new problem, and when I ran the command: "conda install habitat-sim withbullet headless -c conda-forge -c aihabitat-nightly", the interface kept saying "solving environment". Please tell me how I can solve this problem? (Sorry, my basic code skills are not very good, but I am interested in your work and look forward to your reply.)

Jiayuan-Gu commented 1 year ago

Would you mind trying the docker image (docker pull jiayuangu/hab-mm) I provide? Docker image can avoid installation issue. It is a little tricky to install habitat-sim. Unfortunately, the Habitat team does not keep their nightly built packages on conda. Thus, building from the source can be the safest way to install certain version of habitat-sim. I can provide instructions (https://github.com/Jiayuan-Gu/hab-mobile-manipulation#installation) about how to install from the source (since it is reproducible).

MaYuan777 commented 1 year ago

Thanks for the reply, I took some time to learn how to use docker because I've never used it before. I have some more questions to bother you with:

Currently, I have pulled the image you provided on the server and created the container. I mounted the hab-mobile-manipulation folder into the container. Does this mean that this container is already an environment where the code can run perfectly, and I don't need to run any instructions in the "Installation" section of the README.md in this container?

And I have another question about how to install the "habitat" and "habitat_baselines" modules, and in which part of the README are installed into the environment?

Looking forward to your reply, I wish you all the best in your studies and life🙂!

Jiayuan-Gu commented 1 year ago

The docker image (with hab-mobile-manipulation mounted) should include an environment where the code can run. The source of Dockerfile is here. habitat-sim is already installed. habitat-lab is not installed since you might use your own version. Its requirements are already installed in docker. You still need to make sure habitat-lab and hab-mobile-manipulation can be found in $PYTHONPATH. For example, you might need to run the following:

# Install habitat-lab
cd habitat-lab && python setup.py develop && cd ..
# Install habitat manipulation
python setup.py develop

But at least the docker image can save your efforts to install habitat-sim, which can be hard sometimes.


how to install the "habitat" and "habitat_baselines" modules

In the Installation section,

# Install habitat-sim from source
conda install cmake=3.14.0 patchelf ninja
cd habitat-sim && pip install -r requirements.txt && python setup.py install --bullet --headless && cd ..
# Install habitat-lab
cd habitat-lab && pip install -r requirements.txt && python setup.py develop && cd ..

Feel free to let me know if you have more questions.

Jiayuan-Gu commented 1 year ago

BTW, if you are looking for some challenging but out-of-box environments, you can also have a look at our new benchmark ManiSkill2.

MaYuan777 commented 1 year ago

Hello, at the moment I have solved the problem mentioned earlier, I have probably installed the required packages and datasets. Previously, when I ran the command in Install I got an error because I didn't add "root privilege" when I entered the container. After fixing this, I ran into some difficulties when trying to run the code python habitat_extensions/tasks/rearrange/play.py in Interactive play in the container:

Platform::WindowlessEglApplication::tryCreateContext(): unable to find EGL device for CUDA device 0 WindowlessContext: Unable to create windowless context

I looked at the EGL information of the container and it looks like this: Loaded EGL 1.4 after reload. GL_VENDOR=VMware, Inc. GL_RENDERER=llvmpipe (LLVM 10.0.0, 256 bits) GL_VERSION=3.1 Mesa 20.0.8 GL_SHADING_LANGUAGE_VERSION=1.40 At the same time, I checked the EGL information of my server: Loaded EGL 1.5 after reload. GL_VENDOR=NVIDIA Corporation GL_RENDERER=NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 GL_VERSION=4.6.0 NVIDIA 470.86 GL_SHADING_LANGUAGE_VERSION=4.60 NVIDIA I would like to ask you if you have encountered such a problem when using habitat_sim and how did you solve it? Or do you have any suggested solutions?

Looking forward to your reply and wishing you all the best in life :)!

MaYuan777 commented 1 year ago

And, thank you for recommending ManiSkill2, I'll try it out after I'm able to run the habitat-mobile-manipulation successfully👍 .

Jiayuan-Gu commented 1 year ago

I didn't add "root privilege"

It is because I use a non-root user in docker. The relevant section in Dockerfile is https://github.com/Jiayuan-Gu/hab-mobile-manipulation/blob/main/docker/Dockerfile#L25-L27. You can remove those if using root permission is fine in your case.

python habitat_extensions/tasks/rearrange/play.py in Interactive play in the container:

Running the GL application in the docker is a little tricky. Here is a good example: http://wiki.ros.org/docker/Tutorials/GUI. In short, try something like

# At the root directory of the repo
docker run -i -d --rm --gpus all --name hab-m3 \
    -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1 -e XAUTHORITY -e NVIDIA_DRIVER_CAPABILITIES=all\
    -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
    -v `pwd`:/workspace/habitat-manipulation \
    jiayuangu/hab-mm
xhost +local:`docker inspect --format='{{ .Config.Hostname }}' hab-m3`

Besides, make sure the machine has a display. To test whether a GL window can be used, you can run glxgears, which can be installed by apt-get install mesa-utils.

Another issue I encountered before: Could not find an EGL device for CUDA device 0: reinstalling nvidia driver works for me.