mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Add renderer info query API

Open devshahofficial opened this issue 5 months ago • 2 comments

Split out from #3254 in response to Haroon's request for smaller Filament PRs.

Summary

  • Adds mjrRendererInfo plus mjr_defaultRendererInfo and mjr_getRendererInfo to report the active renderer family and graphics backend.
  • Reports classic as classic / opengl, noop as noop / none, and Filament as filament with its selected backend.
  • Adds Python raw alias, pybind struct exposure, render function bindings, introspection metadata, and a binding smoke test.

Validation

  • git diff --check
  • python3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.py
  • PYTHONPATH=/tmp/mujoco-check-pydeps:python/mujoco python3 python/mujoco/codegen/generate_function_traits.py >/tmp/mujoco-function-traits-check.h
  • PYTHONPATH=/tmp/mujoco-check-pydeps:python/mujoco python3 python/mujoco/codegen/generate_enum_traits.py >/tmp/mujoco-enum-traits-check.h
  • cmake -S . -B /tmp/mujoco-renderer-info-build -DMUJOCO_BUILD_TESTS=ON -DMUJOCO_TEST_PYTHON_UTIL=OFF -DCMAKE_BUILD_TYPE=Release
  • cmake --build /tmp/mujoco-renderer-info-build --target mujoco -j2

Notes

  • Draft PR: full Python wheel/binding build was not completed locally; standalone Python CMake expects setup.py's copied source layout.
  • backend_version is reserved and currently returns an empty string until backend-specific version extraction is added.

devshahofficial avatar Jun 13 '26 22:06 devshahofficial

I guess once this PR is merged, wheels will be built, and the render version will be queryable?

Leaving a note here so I get updated.

Looking forward to this functionality. šŸ™Œ

BlGene avatar Jun 22 '26 16:06 BlGene

Thanks!

haroonq avatar Jun 23 '26 09:06 haroonq

Rebased this onto current main and marked it ready.

Validated with:

  • git diff --check
  • python3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.py
  • PYTHONPATH=/tmp/mujoco-pr3340-pydeps:python/mujoco python3 python/mujoco/codegen/generate_function_traits.py >/tmp/mujoco-pr3340-function-traits.h
  • PYTHONPATH=/tmp/mujoco-pr3340-pydeps:python/mujoco python3 python/mujoco/codegen/generate_enum_traits.py >/tmp/mujoco-pr3340-enum-traits.h
  • cmake -S . -B /tmp/mujoco-pr3340-build -DMUJOCO_BUILD_TESTS=ON -DMUJOCO_TEST_PYTHON_UTIL=OFF -DCMAKE_BUILD_TYPE=Release
  • cmake --build /tmp/mujoco-pr3340-build --target mujoco -j2
  • small ctypes smoke against the built libmujoco.dylib: mjr_getRendererInfo returns classic, empty backend, empty backend version before a context exists.

I also tried a narrow Filament/MJR-compat configure. It still hits the separate dear_imgui/SDL2 source-build issue covered by #3252, so I’m not mixing that fix into this API PR.

devshahofficial avatar Jun 29 '26 20:06 devshahofficial

Rebased this onto current main and fixed the conflict in filament_context.cc. The resolution keeps both sides: upstreams larger Filament command buffers and this PRs stored backend_ for the renderer info API.

Local validation:

  • git diff --check
  • python3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.py
  • PYTHONPATH=python/mujoco python/mujoco/codegen/generate_function_traits.py in a fresh venv

@haroonq once fresh CI goes green again, I think this is unblocked for submit. šŸ™

devshahofficial avatar Jul 07 '26 18:07 devshahofficial