MuJoCo XLA (MJX) support in Unity #2302
-
The feature, motivation and pitchHi guys, Thanks! Love your product AlternativesNo response Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hello, this is already partially possible. The process involves:
@joanllobera and I have been experimenting with this process, with no full end-to-end solution demonstrated yet. You can check out our WIP brax-to-ML-Agents converter scripts here: https://github.com/Balint-H/modular-agents/tree/fix/deepmimic-training/mjx-to-unity , we welcome feedback and contributions. You can also find a lot of other MuJoCo in Unity with RL tools in that repo. |
Beta Was this translation helpful? Give feedback.
-
Or did you mean to perform the learning and inference directly in a Unity scene? |
Beta Was this translation helpful? Give feedback.
-
Could you elaborate on what role would Unity play in your expected use case? You could use Unity to help build a scene (the editor serving as a GUI) then export the MuJoCo scene and use that in MJX, which runs parallelized on the GPU. Or run MJX inference and pipe its state to its Unity equivalent for rendering or interactivity. There is no support currently for GPU parallelized physics directly in a Unity app. Unity has support for GPU computations via e.g., compute shaders, but I think there is no straightforward way to bridge those features to run JAX code (what MJX is written with). It would need a complete reimplementation of the engine the GPU code (which is strenuous, and the reason why MuJoCo didn't come to GPU prior to JAX). |
Beta Was this translation helpful? Give feedback.
Could you elaborate on what role would Unity play in your expected use case?
You could use Unity to help build a scene (the editor serving as a GUI) then export the MuJoCo scene and use that in MJX, which runs parallelized on the GPU. Or run MJX inference and pipe its state to its Unity equivalent for rendering or interactivity.
There is no support currently for GPU parallelized physics directly in a Unity app. Unity has support for GPU computations via e.g., compute shaders, but I think there is no straightforward way to bridge those features to run JAX code (what MJX is written with). It would need a complete reimplementation of the engine the GPU code (which is strenuous, and the reaso…