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

Build a binary for Apple Silicon #2

Closed
saran-t opened this issue Oct 18, 2021 · 8 comments
Closed

Build a binary for Apple Silicon #2

saran-t opened this issue Oct 18, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@saran-t
Copy link
Member

saran-t commented Oct 18, 2021

MacOS binary releases should also be available for Apple Silicon machines.

@matte-esse
Copy link

matte-esse commented Nov 18, 2021

I don't want to open another duplicate but I do want to add another request for Apple Silicon binaries, please! Is there an ETA for this issue?

@saran-t
Copy link
Member Author

saran-t commented Nov 24, 2021

We have a working (and performant) universal binary build for macOS and have repackaged our macOS release into a proper Framework Bundle, meaning that people will be able to use it more easily in Xcode projects (including Swift ones).

We are now working through our internal release process and intend to make the new build available within the next few weeks.

@bermanboris
Copy link

Thanks a lot!

@wookayin
Copy link

wookayin commented Dec 16, 2021

Excited to hear the great news of the 2.1.1 release! Given that MuJoCo is provided as a framework bundle, which is different from what we used to have before (i.e. ~/.mujoco/mujoco210), would you please provide installation instructions for end users so that one can use other mujoco bindings such as mujoco-py?

UPDATE: The file layout has changed a lot, so any downstream bindings would need a significant update (even for linux x86_64). However, it will be good to provide a canonical, official way of installing the distribution (for example, moving MuJoCo.framework into PYTHON_BASE/lib or putting MuJuCo.app into either /Applications or something like ~/.mujoco/mujoco211). It seems that all the other dependencies just need to be aware of the layout and such changes.

@saran-t
Copy link
Member Author

saran-t commented Dec 16, 2021

This issue is about mujoco-py, which isn't a project that we own or maintain. Having said that, since MuJoCo 2.1.1 doesn't change any public API compared to 2.1.0 we expect existing bindings to continue to work modulo changes in file names and location.

For dm_control, we will very shortly be pushing a small change that fixes the load path for MuJoCo and provide updated installation instructions. For mujoco-py, if the maintainers would like to update their code we'd be more than happy to work with them on it. In the meantime, I suggest that you mount the DMG for 2.1.1 then try the following:

mkdir -p ~/.mujoco/mujoco210/bin
cp /Volumes/MuJoCo/MuJoCo.framework/Versions/Current/libmujoco.2.1.1.dylib ~/.mujoco/mujoco210/bin/libmujoco210.dylib
cp -r /Volumes/MuJoCo/MuJoCo.framework/Versions/Current/Headers ~/.mujoco/mujoco210/include

Let us know if you get anywhere with this!

@wookayin
Copy link

@saran-t Yes I know my question is a bit off-topic. However, I think it's still worth considering having a canonical/standard installation path so that downstream applications can detect the lib properly, and in regard to that my point is mainly about installation process and relevant documentation.

Do you expect users to use MuJoCo where the image is being mounted (which is not permanent)? Why don't we have MuJoCo.framework installed somewhere into the system? We could consider providing an installer, but I think simply letting MuJoCo.app installed to /Applications would be an easier solution (if the volume provides a conventional drag-drop instruction..).

@saran-t
Copy link
Member Author

saran-t commented Dec 16, 2021

This is our proposed installation scheme for dm_control: google-deepmind/dm_control@84fc2fa

Note that this is likely a somewhat temporary solution while we work out proper installation setup (we're considering msi for Windows, deb/rpm for Linux, and possibly pkg for macOS).

@saran-t saran-t reopened this Dec 16, 2021
@ikasou
Copy link

ikasou commented Dec 17, 2021

I have submitted a pull request for openai/mujoco-py that adds support for Xcode clang and uses the new MuJoCo.framework:
[https://github.com/openai/mujoco-py/pull/664]
If anyone wants to try it locally and give some feedback,
git clone -b m1 https://github.com/ikasou/mujoco-py.git
pip3 install -U -e mujoco-py

@saran-t saran-t closed this as completed Mar 15, 2022
liuliu added a commit to liuliu/mujoco that referenced this issue Jun 7, 2022
I am running through simulate.swift (my port of simulate.cc) with
address sanitizer to discover related bugs.

Besides ones in my port, there are two in MuJoCo:

1. in maketext, the logic to find . is not protected against j is less
   than 0 (due to the decreasing logic above), creating out of bound
   access.

2. in mj_printFormattedData, qfrc_applied should use length nv not nq,
   otherwise out of bound access could be triggered.

Test Plan:

Run through the simulate.cc with asan. Before this fix, when presenting
profiler view, it will trigger bug google-deepmind#1. When print data, it will trigger
bug google-deepmind#2. Both are using model/humanoid/22_humanoids.xml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants