Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add conda installation support for ManiSkill #695

Open
songyuc opened this issue Nov 13, 2024 · 3 comments
Open

Feature Request: Add conda installation support for ManiSkill #695

songyuc opened this issue Nov 13, 2024 · 3 comments

Comments

@songyuc
Copy link
Contributor

songyuc commented Nov 13, 2024

Hi ManiSkill Developers,

Thank you for your amazing work on ManiSkill! This tool has been incredibly helpful for robotics simulation and training.

I am a beginner in Python and use conda environments frequently for managing dependencies and isolating my projects. While the current pip-based installation method works well, I believe adding support for conda installation could provide significant benefits, including:

  1. Beginner-friendliness: conda simplifies dependency management and avoids many common installation issues, especially for users less familiar with Python.
  2. Improved compatibility: Precompiled packages in conda reduce the chances of dependency conflicts or system compatibility issues.
  3. Wider adoption: Many researchers and students in the robotics and machine learning community rely on conda for managing environments.

Would it be possible to consider adding a conda installation method for ManiSkill in the future? For example, providing a Conda Forge recipe or maintaining a channel with the necessary builds.

Thank you for considering this suggestion, and I look forward to ManiSkill's future development!

Best regards,
Yucheng Song

@traversaro
Copy link

traversaro commented Nov 18, 2024

I looked a bit if this was easy to do at some point in the past, I think I can share a few notes in case somebody is interested in working on this.

ManifSkill by itself should be easy to package, as it is a pure python package (beside not having a stable release, but there are way around that). The tricky part is its dependency https://github.com/haosulab/SAPIEN, or actually the dependencies of SAPIEN itself (SAPIEN is itself a classical C++/Python project).

I tried to follow SAPIEN docs, but the "Build without Docker" documentation in https://github.com/haosulab/SAPIEN/blob/ab1d9a9fa1428484a918e61185ae9df2beb7cb30/docker/Dockerfile#L5 seems to assume that a PhysX folder to be available somehow, but beside the info "Note that PhysX needs to be compiled with clang-9 into static libraries before building the Docker image.". By looking into the ./docker_build_wheels.sh, it seems that for building wheels a docker image fxiangucsd/sapien-build-env is used, but at this point I got a bit lost as I could not find any Dockerfile for fxiangucsd/sapien-build-env. Based on some info on the web and by checking the related physx vcpkg port at https://github.com/microsoft/vcpkg/blob/84a143e4caf6b70db57f28d04c41df4a85c480fa/ports/physx/portfile.cmake#L2 , I guess that sapien-build-env probably builds PhysX CPU from https://github.com/NVIDIA-Omniverse/PhysX (probably via https://github.com/sapien-sim/physx-precompiled) and the repackages the PhysX GPU library from https://github.com/sapien-sim/physx-gpu, but it is not clear to me where the original source of the PhysX GPU library is. Based on the vcpkg port I guess the source url could be https://d4i3qtqj3r0z5.cloudfront.net/PhysXGpu%40105.1-5.3.4207.33265367-windows-public.7z, that does not even if it does not sounds like an official Nvidia source, it is referenced even in the Nvidia PhysX repo: https://github.com/NVIDIA-Omniverse/PhysX/blob/6e8ce6bb3208eb4ab0e4f266284e5b34fc9c3227/physx/buildtools/packman/config.packman.xml#L3 .

To recap, the major steps for building a manifskill conda-forge package probably are:

  • Add a physx conda-forge package, compiling the CPU version and binary repackaging the GPU version
  • Add a sapien conda-forge package
  • Add a manifskill conda-forge package

@fbxiang
Copy link
Contributor

fbxiang commented Nov 19, 2024

SAPIEN and ManiSkill should be fully compatible with conda if you use the pip provided by conda. We carefully engineered the packages to not rely on system packages. And pip is the only choice for people who do not or cannot use conda.

If you find yourself compiling SAPIEN from source, could you provide more insights on what you are trying to achieve? If you are trying to get SAPIEN to work on Windows or Python3.13, you can get the nightly build here https://github.com/haosulab/SAPIEN/releases (there is practically no difference from the pypi released version).
This is actually built by GitHub CI, and as long as you follow the build steps in CI, you can also build it yourself. If your goal is to build it for a non x86 platform, you can share your experience. If you are targeting MacOS, please note that SAPIEN renderer will not be compatible with the latest M series since many Vulkan features are currently missing for the GPUs, so I really do not recommend building on MacOS.

@traversaro
Copy link

SAPIEN and ManiSkill should be fully compatible with conda if you use the pip provided by conda. We carefully engineered the packages to not rely on system packages. And pip is the only choice for people who do not or cannot use conda.

Thanks a lot for that! I know from direct experience that this is not straightforward, so thanks a lot for that. I think that is indeed is that the OP was referencing with "pip-based installation method works well". And just to be super-clear, a conda package for manifskill/sapien would not be a replacement or something that can be replacing the pip package (my bad if I gave that impression).

If you find yourself compiling SAPIEN from source, could you provide more insights on what you are trying to achieve?

This is just speaking for me/the lab were I work, I definitely not speaking for the OP. When we add dependency for a mixed C++/Python package, we typically prefer to depend on it via conda-forge rather then pypi for several reasons, the main is that we typically use a lot of C++ dependencies (with a depth of the dependency tree that can reach ~5/10), along Python dependencies. Having all our dependencies on conda-forge permits us to upload to conda-forge any new open source package that we develop in a simple a straightforward way. As soon as we add a dependency that is not on conda-forge, we can't package the resulting downstream package on conda-forge, and typically if the downstream package also have a non-trivial C++ dependency chain (either directly or indirectly), we can't easily package it on PyPI either.

Just to clarify, I do not want to convince you to work on preparing/maintaining a conda-forge package, just explaining why I looked in this in the past (and I did not went forward on working on it, at least for now : ) ). I just dumped some details as I could not find these details anywhere, and they could be interesting if anyone was also looking in making a conda/conda-forge package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants