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

Stop using CDTs for OpenGL and run render test when Python tests are run #66

Merged
merged 10 commits into from
Oct 22, 2024

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Oct 21, 2024

mujoco should have full support for headless rendering, so I guess rendering tests should pass fine also in CI. This is important to ensure that testing of downstream libraries (such as conda-forge/gymnasium-feedstock#41) assume that mujoco render works in CI.

This PR also:

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

We were able to reproduce the failures that we saw in conda-forge/gymnasium-feedstock#41 . Windows and osx are failing, while Linux is hanging.

@traversaro traversaro changed the title Also run render test when Python tests are run Stop using CDTs for OpenGL and run render test when Python tests are run Oct 21, 2024
@traversaro
Copy link
Contributor Author

osx error:

_______________________ MuJoCoRenderTest.test_can_render _______________________

self = <mujoco.render_test.MuJoCoRenderTest testMethod=test_can_render>

    def setUp(self):
      super().setUp()
>     self.gl = mujoco.GLContext(640, 480)

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.10/site-packages/mujoco/render_test.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.10/site-packages/mujoco/cgl/__init__.py:47: in __init__
    cgl.CGLChoosePixelFormat(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<mujoco.cgl.c_int_Array_17 object at 0x1050ee440>, <cparam 'P' (0x1050ee110)>, <cparam 'P' (0x1050ee610)>)
err = 10002

    def checked_func(*args):
      err = func(*args)
      if err:
>       raise CGLError(_CGLErrorString(err).decode())
E       mujoco.cgl.cgl.CGLError: invalid pixel format

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.10/site-packages/mujoco/cgl/cgl.py:132: CGLError

Windows error:

2024-10-21T14:43:43.7355505Z ______________________ MuJoCoRenderTest.test_can_render _______________________
2024-10-21T14:43:43.7355938Z 
2024-10-21T14:43:43.7362898Z self = <mujoco.render_test.MuJoCoRenderTest testMethod=test_can_render>
2024-10-21T14:43:43.7363387Z 
2024-10-21T14:43:43.7367174Z     def test_can_render(self):
2024-10-21T14:43:43.7367893Z       """Test that the bindings can successfully render a simple image.
2024-10-21T14:43:43.7368371Z     
2024-10-21T14:43:43.7369191Z       This test sets up a basic MuJoCo rendering context similar to the example in
2024-10-21T14:43:43.7369753Z       https://mujoco.readthedocs.io/en/latest/programming#visualization
2024-10-21T14:43:43.7370275Z       It calls `mjr_rectangle` rather than `mjr_render` so that we can assert an
2024-10-21T14:43:43.7374141Z       exact rendered image without needing golden data. The purpose of this test
2024-10-21T14:43:43.7374778Z       is to ensure that the bindings can correctly return pixels in Python, rather
2024-10-21T14:43:43.7375603Z       than to test MuJoCo's rendering pipeline itself.
2024-10-21T14:43:43.7376091Z       """
2024-10-21T14:43:43.7376511Z     
2024-10-21T14:43:43.7377088Z       self.model = mujoco.MjModel.from_xml_string('<mujoco><worldbody/></mujoco>')
2024-10-21T14:43:43.7377602Z       self.data = mujoco.MjData(self.model)
2024-10-21T14:43:43.7381908Z     
2024-10-21T14:43:43.7382561Z       scene = mujoco.MjvScene(self.model, maxgeom=0)
2024-10-21T14:43:43.7383103Z       mujoco.mjv_updateScene(
2024-10-21T14:43:43.7383457Z           self.model, self.data, mujoco.MjvOption(), mujoco.MjvPerturb(),
2024-10-21T14:43:43.7383832Z           mujoco.MjvCamera(), mujoco.mjtCatBit.mjCAT_ALL, scene)
2024-10-21T14:43:43.7384146Z     
2024-10-21T14:43:43.7384480Z >     context = mujoco.MjrContext(self.model, mujoco.mjtFontScale.mjFONTSCALE_150)
2024-10-21T14:43:43.7384850Z E     mujoco.FatalError: gladLoadGL error
2024-10-21T14:43:43.7385042Z 
2024-10-21T14:43:43.7388603Z ..\_test_env\Lib\site-packages\mujoco\render_test.py:54: FatalError

@traversaro
Copy link
Contributor Author

@conda-forge-admin please rerender

@@ -30,7 +30,7 @@ source:
build:
# See https://github.com/conda-forge/mujoco-feedstock/issues/22
skip: true # [(aarch64 or ppc64le or osx) and python_impl == 'pypy']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, you can get rid of that skip and all traces of pypy/python_impl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to do that in a follow up PR, thanks!

@traversaro traversaro merged commit 20b8d2c into conda-forge:main Oct 22, 2024
33 checks passed
@traversaro traversaro deleted the testrender branch October 22, 2024 09:14
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

Successfully merging this pull request may close these issues.

3 participants