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

gymnasium v1.0.0 #41

Merged
merged 23 commits into from
Oct 22, 2024
Merged

Conversation

regro-cf-autotick-bot
Copy link
Contributor

@regro-cf-autotick-bot regro-cf-autotick-bot commented Oct 8, 2024

Fix #39 .
Fix #33 .
Fix #36 .
Fix Farama-Foundation/Gymnasium#1223 .

It is very likely that the current package version for this feedstock is out of date.

Checklist before merging this PR:

  • Dependencies have been updated if changed: see upstream
  • Tests have passed
  • Updated license if changed and license_file is packaged

Information about this PR:

  1. Feel free to push to the bot's branch to update this PR if needed.
  2. The bot will almost always only open one PR per version.
  3. The bot will stop issuing PRs if more than 3 version bump PRs generated by the bot are open. If you don't want to package a particular version please close the PR.
  4. If you want these PRs to be merged automatically, make an issue with @conda-forge-admin,please add bot automerge in the title and merge the resulting PR. This command will add our bot automerge feature to your feedstock.
  5. If this PR was opened in error or needs to be updated please add the bot-rerun label to this PR. The bot will close this PR and schedule another one. If you do not have permissions to add this label, you can use the phrase @conda-forge-admin, please rerun bot in a PR comment to have the conda-forge-admin add it for you.

Pending Dependency Version Updates

Here is a list of all the pending dependency version updates for this repo. Please double check all dependencies before merging.

Name Upstream Version Current Version
gymnasium 1.0.0 Anaconda-Server Badge
pytorch-cpu 137463 Anaconda-Server Badge

This PR was created by the regro-cf-autotick-bot. The regro-cf-autotick-bot is a service to automatically track the dependency graph, migrate packages, and propose package version updates for conda-forge. Feel free to drop us a line if there are any issues! This PR was generated by https://github.com/regro/cf-scripts/actions/runs/11236245327 - please use this URL for debugging.

@conda-forge-admin
Copy link
Contributor

conda-forge-admin commented Oct 8, 2024

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.
I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • Use importlib-metadata instead of importlib_metadata
  • Recipes should usually depend on matplotlib-base as opposed to matplotlib so that runtime environments do not require large packages like qt.

@traversaro
Copy link
Contributor

We can remove the 932.patch as it was merged upstream in Farama-Foundation/Gymnasium#932 .

@traversaro
Copy link
Contributor

pip check is failing on many os with:

+ pip check
proglog 0.1.9 is not supported on this platform

@traversaro
Copy link
Contributor

pip check is failing on many os with:

+ pip check
proglog 0.1.9 is not supported on this platform

Reported in conda-forge/proglog-feedstock#2, the proglog dependency is transitive via moviepy dependency.

@traversaro
Copy link
Contributor

Some failures due to missing dependencies:

==================================== ERRORS ====================================
______________ ERROR collecting tests/envs/functional/test_jax.py ______________
ImportError while importing test module '$SRC_DIR/tests/envs/functional/test_jax.py'.
Hint: make sure your test modules/packages have valid Python names.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/functional/test_jax_cliffwalking.py:10: in <module>
    from gymnasium.envs.tabular.cliffwalking import CliffWalkingFunctional  # noqa: E402
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/tabular/__init__.py:3: in <module>
    from gymnasium.envs.tabular.blackjack import BlackJackJaxEnv
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/tabular/blackjack.py:10: in <module>
    from flax import struct
E   ModuleNotFoundError: No module named 'flax'
_________ ERROR collecting tests/wrappers/test_atari_preprocessing.py __________
tests/wrappers/test_atari_preprocessing.py:18: in <module>
    (gym.make("ALE/Pong-v5"), (210, 160, 3)),
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:687: in make
    env_spec = _find_spec(id)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:531: in _find_spec
    _check_version_exists(ns, name, version)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:397: in _check_version_exists
    _check_name_exists(ns, name)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:360: in _check_name_exists
    _check_namespace_exists(ns)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:354: in _check_namespace_exists
    raise error.NamespaceNotFound(f"Namespace {ns} not found. {suggestion_msg}")
E   gymnasium.error.NamespaceNotFound: Namespace ALE not found. Have you installed the proper package for ALE?
=============================== warnings summary ===============================

@traversaro
Copy link
Contributor

After adding flax:

==================================== ERRORS ====================================
__________ ERROR collecting tests/envs/registration/test_env_spec.py ___________
ImportError while importing test module '$SRC_DIR/tests/envs/registration/test_env_spec.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/envs/registration/test_env_spec.py:8: in <module>
    import dill as pickle
E   ModuleNotFoundError: No module named 'dill'
_________ ERROR collecting tests/wrappers/test_atari_preprocessing.py __________
tests/wrappers/test_atari_preprocessing.py:18: in <module>
    (gym.make("ALE/Pong-v5"), (210, 160, 3)),
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:687: in make
    env_spec = _find_spec(id)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:531: in _find_spec
    _check_version_exists(ns, name, version)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:397: in _check_version_exists
    _check_name_exists(ns, name)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:360: in _check_name_exists
    _check_namespace_exists(ns)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/registration.py:354: in _check_namespace_exists
    raise error.NamespaceNotFound(f"Namespace {ns} not found. {suggestion_msg}")
E   gymnasium.error.NamespaceNotFound: Namespace ALE not found. Have you installed the proper package for ALE?

@traversaro
Copy link
Contributor

Some tests are failing:

FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[100-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[1000-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10000-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_position[HalfCheetah-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_position[Hopper-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_position[Swimmer-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_position[Walker2d-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_y_position[Swimmer-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_velocity[v3-HalfCheetah] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_velocity[v3-Hopper] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_velocity[v3-Swimmer] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_x_velocity[v3-Walker2d] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_y_velocity[Swimmer-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_xy_velocity_xpos[Ant-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_verify_info_xy_velocity_com[Humanoid-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_set_state[v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_set_state[v2] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_distance_from_origin_info[Swimmer-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_model_sensors[v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_model_sensors[v2] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[Ant-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[HalfCheetah-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[Hopper-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[Humanoid-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[Swimmer-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')
FAILED tests/envs/mujoco/test_mujoco_v5.py::test_reset_noise_scale[Walker2d-v3] - gymnasium.error.DependencyNotInstalled: ("No module named 'mujoco_py'. Could not import mujoco_py, which is needed for MuJoCo environments older than V4", 'You could either use a newer version of the environments, or install the (deprecated) mujoco-py packagefollowing the instructions on their GitHub page.')

I think this are the same test that we skipped in #36 .

@h-vetinari
Copy link
Member

Can we check these ones out in more detail before skipping please:

FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[100-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[1000-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10000-human] - ValueError: NULL pointer access

I get confused between which mujoco is the opensource one - I think it was mujuco and the proprietary was mujoco_py? - we should IMO add the FOSS dependency, and skip everything related to the proprietary one (and raise a bug upstream if those tests fail on a default install; they should be automatically skipped if the proprietary mujoco isn't present).

@traversaro
Copy link
Contributor

Can we check these ones out in more detail before skipping please:

FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[100-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[1000-human] - ValueError: NULL pointer access
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10000-human] - ValueError: NULL pointer access

I think they are failing as those test require an X server or something similar, see #36 (comment) .

I get confused between which mujoco is the opensource one - I think it was mujuco and the proprietary was mujoco_py? - we should IMO add the FOSS dependency, and skip everything related to the proprietary one (and raise a bug upstream if those tests fail on a default install; they should be automatically skipped if the proprietary mujoco isn't present).

Yes, mujoco_py is the proprietary one, the FOSS dependency is already there, not sure why the mujoco_py tests are not skipped automatically.

@traversaro
Copy link
Contributor

The mujoco tests are indeed due to glfw:

2024-10-08T22:23:31.6116408Z =================================== FAILURES ===================================
2024-10-08T22:23:31.6119440Z ______________________ test_max_geom_attribute[10-human] _______________________
2024-10-08T22:23:31.6120171Z 
2024-10-08T22:23:31.6120672Z model = <mujoco._structs.MjModel object at 0x7feda1496830>
2024-10-08T22:23:31.6121412Z data = <mujoco._structs.MjData object at 0x7feda0f0dfb0>, render_mode = 'human'
2024-10-08T22:23:31.6122161Z max_geom = 10
2024-10-08T22:23:31.6122292Z 
2024-10-08T22:23:31.6122530Z     @pytest.mark.parametrize("render_mode", ["human", "rgb_array", "depth_array"])
2024-10-08T22:23:31.6122828Z     @pytest.mark.parametrize("max_geom", [10, 100, 1000, 10000])
2024-10-08T22:23:31.6123079Z     def test_max_geom_attribute(
2024-10-08T22:23:31.6123350Z         model: mujoco.MjModel, data: mujoco.MjData, render_mode: str, max_geom: int
2024-10-08T22:23:31.6123588Z     ):
2024-10-08T22:23:31.6123818Z         """Test that the max_geom attribute is set correctly."""
2024-10-08T22:23:31.6124033Z     
2024-10-08T22:23:31.6124231Z         # initialize renderer
2024-10-08T22:23:31.6124466Z         renderer = ExposedViewerRenderer(
2024-10-08T22:23:31.6124742Z             model, data, width=DEFAULT_SIZE, height=DEFAULT_SIZE, max_geom=max_geom
2024-10-08T22:23:31.6124980Z         )
2024-10-08T22:23:31.6125157Z     
2024-10-08T22:23:31.6125346Z         # assert max_geom attribute
2024-10-08T22:23:31.6125585Z         assert renderer.max_geom == max_geom
2024-10-08T22:23:31.6125789Z     
2024-10-08T22:23:31.6125991Z         # initialize viewer via render
2024-10-08T22:23:31.6126232Z >       viewer = renderer.get_viewer(render_mode)
2024-10-08T22:23:31.6126367Z 
2024-10-08T22:23:31.6126588Z tests/envs/mujoco/test_mujoco_rendering.py:78: 
2024-10-08T22:23:31.6126857Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6127136Z tests/envs/mujoco/test_mujoco_rendering.py:21: in get_viewer
2024-10-08T22:23:31.6127407Z     return self._get_viewer(render_mode)
2024-10-08T22:23:31.6128146Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:721: in _get_viewer
2024-10-08T22:23:31.6128617Z     self.viewer = WindowViewer(
2024-10-08T22:23:31.6129312Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:322: in __init__
2024-10-08T22:23:31.6129786Z     monitor_width, monitor_height = glfw.get_video_mode(
2024-10-08T22:23:31.6130054Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6130193Z 
2024-10-08T22:23:31.6130423Z monitor = <glfw.LP__GLFWmonitor object at 0x7feda0eab9c0>
2024-10-08T22:23:31.6130553Z 
2024-10-08T22:23:31.6130753Z     def get_video_mode(monitor):
2024-10-08T22:23:31.6131091Z         """
2024-10-08T22:23:31.6131317Z         Returns the current mode of the specified monitor.
2024-10-08T22:23:31.6131532Z     
2024-10-08T22:23:31.6131815Z         Wrapper for:
2024-10-08T22:23:31.6132070Z             const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
2024-10-08T22:23:31.6132297Z         """
2024-10-08T22:23:31.6132515Z >       videomode = _glfw.glfwGetVideoMode(monitor).contents
2024-10-08T22:23:31.6132768Z E       ValueError: NULL pointer access
2024-10-08T22:23:31.6132893Z 
2024-10-08T22:23:31.6133529Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/glfw/__init__.py:1174: ValueError
2024-10-08T22:23:31.6134085Z ----------------------------- Captured stderr call -----------------------------
2024-10-08T22:23:31.6134386Z error: XDG_RUNTIME_DIR is invalid or not set in the environment.
2024-10-08T22:23:31.6190470Z ______________________ test_max_geom_attribute[100-human] ______________________
2024-10-08T22:23:31.6194590Z 
2024-10-08T22:23:31.6195819Z model = <mujoco._structs.MjModel object at 0x7feda1496830>
2024-10-08T22:23:31.6196416Z data = <mujoco._structs.MjData object at 0x7feda0f0dfb0>, render_mode = 'human'
2024-10-08T22:23:31.6196919Z max_geom = 100
2024-10-08T22:23:31.6197109Z 
2024-10-08T22:23:31.6197418Z     @pytest.mark.parametrize("render_mode", ["human", "rgb_array", "depth_array"])
2024-10-08T22:23:31.6197801Z     @pytest.mark.parametrize("max_geom", [10, 100, 1000, 10000])
2024-10-08T22:23:31.6198131Z     def test_max_geom_attribute(
2024-10-08T22:23:31.6198476Z         model: mujoco.MjModel, data: mujoco.MjData, render_mode: str, max_geom: int
2024-10-08T22:23:31.6198790Z     ):
2024-10-08T22:23:31.6199092Z         """Test that the max_geom attribute is set correctly."""
2024-10-08T22:23:31.6199383Z     
2024-10-08T22:23:31.6199653Z         # initialize renderer
2024-10-08T22:23:31.6199956Z         renderer = ExposedViewerRenderer(
2024-10-08T22:23:31.6200311Z             model, data, width=DEFAULT_SIZE, height=DEFAULT_SIZE, max_geom=max_geom
2024-10-08T22:23:31.6200624Z         )
2024-10-08T22:23:31.6200878Z     
2024-10-08T22:23:31.6201152Z         # assert max_geom attribute
2024-10-08T22:23:31.6201446Z         assert renderer.max_geom == max_geom
2024-10-08T22:23:31.6201884Z     
2024-10-08T22:23:31.6202192Z         # initialize viewer via render
2024-10-08T22:23:31.6202509Z >       viewer = renderer.get_viewer(render_mode)
2024-10-08T22:23:31.6202715Z 
2024-10-08T22:23:31.6203023Z tests/envs/mujoco/test_mujoco_rendering.py:78: 
2024-10-08T22:23:31.6203351Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6203738Z tests/envs/mujoco/test_mujoco_rendering.py:21: in get_viewer
2024-10-08T22:23:31.6204087Z     return self._get_viewer(render_mode)
2024-10-08T22:23:31.6204900Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:721: in _get_viewer
2024-10-08T22:23:31.6205450Z     self.viewer = WindowViewer(
2024-10-08T22:23:31.6206230Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:322: in __init__
2024-10-08T22:23:31.6206797Z     monitor_width, monitor_height = glfw.get_video_mode(
2024-10-08T22:23:31.6207130Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6207341Z 
2024-10-08T22:23:31.6207638Z monitor = <glfw.LP__GLFWmonitor object at 0x7feda0cafd40>
2024-10-08T22:23:31.6207846Z 
2024-10-08T22:23:31.6208119Z     def get_video_mode(monitor):
2024-10-08T22:23:31.6208391Z         """
2024-10-08T22:23:31.6208824Z         Returns the current mode of the specified monitor.
2024-10-08T22:23:31.6209120Z     
2024-10-08T22:23:31.6218814Z         Wrapper for:
2024-10-08T22:23:31.6219308Z             const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
2024-10-08T22:23:31.6219622Z         """
2024-10-08T22:23:31.6219935Z >       videomode = _glfw.glfwGetVideoMode(monitor).contents
2024-10-08T22:23:31.6220247Z E       ValueError: NULL pointer access
2024-10-08T22:23:31.6220447Z 
2024-10-08T22:23:31.6221218Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/glfw/__init__.py:1174: ValueError
2024-10-08T22:23:31.6222033Z ----------------------------- Captured stderr call -----------------------------
2024-10-08T22:23:31.6222630Z error: XDG_RUNTIME_DIR is invalid or not set in the environment.
2024-10-08T22:23:31.6223644Z _____________________ test_max_geom_attribute[1000-human] ______________________
2024-10-08T22:23:31.6223938Z 
2024-10-08T22:23:31.6224252Z model = <mujoco._structs.MjModel object at 0x7feda1496830>
2024-10-08T22:23:31.6224708Z data = <mujoco._structs.MjData object at 0x7feda0f0dfb0>, render_mode = 'human'
2024-10-08T22:23:31.6225037Z max_geom = 1000
2024-10-08T22:23:31.6225419Z 
2024-10-08T22:23:31.6225720Z     @pytest.mark.parametrize("render_mode", ["human", "rgb_array", "depth_array"])
2024-10-08T22:23:31.6226085Z     @pytest.mark.parametrize("max_geom", [10, 100, 1000, 10000])
2024-10-08T22:23:31.6226413Z     def test_max_geom_attribute(
2024-10-08T22:23:31.6226756Z         model: mujoco.MjModel, data: mujoco.MjData, render_mode: str, max_geom: int
2024-10-08T22:23:31.6227069Z     ):
2024-10-08T22:23:31.6227372Z         """Test that the max_geom attribute is set correctly."""
2024-10-08T22:23:31.6227660Z     
2024-10-08T22:23:31.6227928Z         # initialize renderer
2024-10-08T22:23:31.6228229Z         renderer = ExposedViewerRenderer(
2024-10-08T22:23:31.6228582Z             model, data, width=DEFAULT_SIZE, height=DEFAULT_SIZE, max_geom=max_geom
2024-10-08T22:23:31.6228900Z         )
2024-10-08T22:23:31.6229152Z     
2024-10-08T22:23:31.6229467Z         # assert max_geom attribute
2024-10-08T22:23:31.6229799Z         assert renderer.max_geom == max_geom
2024-10-08T22:23:31.6230069Z     
2024-10-08T22:23:31.6230345Z         # initialize viewer via render
2024-10-08T22:23:31.6230662Z >       viewer = renderer.get_viewer(render_mode)
2024-10-08T22:23:31.6230892Z 
2024-10-08T22:23:31.6231198Z tests/envs/mujoco/test_mujoco_rendering.py:78: 
2024-10-08T22:23:31.6231531Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6232020Z tests/envs/mujoco/test_mujoco_rendering.py:21: in get_viewer
2024-10-08T22:23:31.6232383Z     return self._get_viewer(render_mode)
2024-10-08T22:23:31.6233192Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:721: in _get_viewer
2024-10-08T22:23:31.6233736Z     self.viewer = WindowViewer(
2024-10-08T22:23:31.6234516Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:322: in __init__
2024-10-08T22:23:31.6244485Z     monitor_width, monitor_height = glfw.get_video_mode(
2024-10-08T22:23:31.6244989Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6245210Z 
2024-10-08T22:23:31.6245516Z monitor = <glfw.LP__GLFWmonitor object at 0x7feda0cafcc0>
2024-10-08T22:23:31.6245716Z 
2024-10-08T22:23:31.6245990Z     def get_video_mode(monitor):
2024-10-08T22:23:31.6246265Z         """
2024-10-08T22:23:31.6246568Z         Returns the current mode of the specified monitor.
2024-10-08T22:23:31.6247026Z     
2024-10-08T22:23:31.6247294Z         Wrapper for:
2024-10-08T22:23:31.6247615Z             const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
2024-10-08T22:23:31.6247919Z         """
2024-10-08T22:23:31.6248220Z >       videomode = _glfw.glfwGetVideoMode(monitor).contents
2024-10-08T22:23:31.6248545Z E       ValueError: NULL pointer access
2024-10-08T22:23:31.6248743Z 
2024-10-08T22:23:31.6249542Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/glfw/__init__.py:1174: ValueError
2024-10-08T22:23:31.6250202Z ----------------------------- Captured stderr call -----------------------------
2024-10-08T22:23:31.6250584Z error: XDG_RUNTIME_DIR is invalid or not set in the environment.
2024-10-08T22:23:31.6251097Z _____________________ test_max_geom_attribute[10000-human] _____________________
2024-10-08T22:23:31.6251332Z 
2024-10-08T22:23:31.6251629Z model = <mujoco._structs.MjModel object at 0x7feda1496830>
2024-10-08T22:23:31.6252236Z data = <mujoco._structs.MjData object at 0x7feda0f0dfb0>, render_mode = 'human'
2024-10-08T22:23:31.6252571Z max_geom = 10000
2024-10-08T22:23:31.6252748Z 
2024-10-08T22:23:31.6253175Z     @pytest.mark.parametrize("render_mode", ["human", "rgb_array", "depth_array"])
2024-10-08T22:23:31.6253529Z     @pytest.mark.parametrize("max_geom", [10, 100, 1000, 10000])
2024-10-08T22:23:31.6253854Z     def test_max_geom_attribute(
2024-10-08T22:23:31.6254199Z         model: mujoco.MjModel, data: mujoco.MjData, render_mode: str, max_geom: int
2024-10-08T22:23:31.6254510Z     ):
2024-10-08T22:23:31.6254810Z         """Test that the max_geom attribute is set correctly."""
2024-10-08T22:23:31.6255097Z     
2024-10-08T22:23:31.6255367Z         # initialize renderer
2024-10-08T22:23:31.6255666Z         renderer = ExposedViewerRenderer(
2024-10-08T22:23:31.6256017Z             model, data, width=DEFAULT_SIZE, height=DEFAULT_SIZE, max_geom=max_geom
2024-10-08T22:23:31.6256334Z         )
2024-10-08T22:23:31.6256584Z     
2024-10-08T22:23:31.6256864Z         # assert max_geom attribute
2024-10-08T22:23:31.6257172Z         assert renderer.max_geom == max_geom
2024-10-08T22:23:31.6271906Z     
2024-10-08T22:23:31.6272413Z         # initialize viewer via render
2024-10-08T22:23:31.6272752Z >       viewer = renderer.get_viewer(render_mode)
2024-10-08T22:23:31.6272959Z 
2024-10-08T22:23:31.6273268Z tests/envs/mujoco/test_mujoco_rendering.py:78: 
2024-10-08T22:23:31.6273613Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6273956Z tests/envs/mujoco/test_mujoco_rendering.py:21: in get_viewer
2024-10-08T22:23:31.6274304Z     return self._get_viewer(render_mode)
2024-10-08T22:23:31.6275151Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:721: in _get_viewer
2024-10-08T22:23:31.6275692Z     self.viewer = WindowViewer(
2024-10-08T22:23:31.6276468Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py:322: in __init__
2024-10-08T22:23:31.6277039Z     monitor_width, monitor_height = glfw.get_video_mode(
2024-10-08T22:23:31.6277368Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-10-08T22:23:31.6277579Z 
2024-10-08T22:23:31.6277884Z monitor = <glfw.LP__GLFWmonitor object at 0x7feda0a56ec0>
2024-10-08T22:23:31.6278082Z 
2024-10-08T22:23:31.6278355Z     def get_video_mode(monitor):
2024-10-08T22:23:31.6278629Z         """
2024-10-08T22:23:31.6278928Z         Returns the current mode of the specified monitor.
2024-10-08T22:23:31.6279376Z     
2024-10-08T22:23:31.6279640Z         Wrapper for:
2024-10-08T22:23:31.6279958Z             const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
2024-10-08T22:23:31.6280260Z         """
2024-10-08T22:23:31.6280564Z >       videomode = _glfw.glfwGetVideoMode(monitor).contents
2024-10-08T22:23:31.6280898Z E       ValueError: NULL pointer access
2024-10-08T22:23:31.6281095Z 
2024-10-08T22:23:31.6281907Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/glfw/__init__.py:1174: ValueError
2024-10-08T22:23:31.6282591Z ----------------------------- Captured stderr call -----------------------------
2024-10-08T22:23:31.6282913Z error: XDG_RUNTIME_DIR is invalid or not set in the environment.

@traversaro
Copy link
Contributor

(and raise a bug upstream if those tests fail on a default install; they should be automatically skipped if the proprietary mujoco isn't present).

Tests seems to be skipped correctly if I tried on a stock gymnasium and mujoco_py is not installed, there seems to be something strange at the recipe/conda-build level or similar.

@traversaro
Copy link
Contributor

traversaro commented Oct 9, 2024

Python 3.9 builds are failing with:

_____________ ERROR collecting tests/wrappers/test_jax_to_numpy.py _____________
tests/wrappers/test_jax_to_numpy.py:9: in <module>
    jax = pytest.importorskip("jax")
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/jax/__init__.py:25: in <module>
    from jax._src.cloud_tpu_init import cloud_tpu_init as _cloud_tpu_init
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/jax/_src/cloud_tpu_init.py:37: in <module>
    def get_tpu_library_path() -> str | None:
E   TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

this seems a wrong metadata on the minimum version supported in the jax package, that need to be addressed.

@traversaro
Copy link
Contributor

traversaro commented Oct 9, 2024

Other failures seems related to thing we already saw in #36 (comment) .

osx-64 :

FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[10-10] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[10-100] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[10-200] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[10-480] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[100-10] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[100-100] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[100-200] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[100-480] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[200-10] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[200-100] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[200-200] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[200-480] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[480-10] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[480-100] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[480-200] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_offscreen_viewer_custom_dimensions[480-480] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10-rgb_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10-depth_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[100-rgb_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[100-depth_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[1000-rgb_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[1000-depth_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10000-rgb_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_max_geom_attribute[10000-depth_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_camera_id[rgb_array] - mujoco.FatalError: gladLoadGL error
FAILED tests/envs/mujoco/test_mujoco_rendering.py::test_camera_id[depth_array] - mujoco.FatalError: gladLoadGL error

It can't load OpenGL, probably something related to headless environment or similar.

linux-aarch64

/home/conda/feedstock_root/build_artifacts/gymnasium-split_1728462061525/test_tmp/run_test.sh: line 9:  1663 Segmentation fault      (core dumped) pytest -v tests/ -k "not (_not_a_real_test or test_verify_info_x_position or test_verify_info_y_position or test_verify_info_x_velocity or test_verify_info_y_velocity or test_verify_info_xy_velocity_xpos or test_verify_info_xy_velocity_com or test_set_state or test_distance_from_origin_info or test_model_sensors or test_reset_noise_scale or test_max_geom_attribute[10-human] or test_max_geom_attribute[100-human] or test_max_geom_attribute[1000-human] or test_max_geom_attribute[10000-human] or test_render_modes)"

jax segfaults on linux-aarch64 emulated on qemu, this is known and reported in conda-forge/jax-feedstock#144 .

@pseudo-rnd-thoughts
Copy link
Contributor

Thanks @traversaro and @h-vetinari for your work, is there anything I can help with?

@traversaro
Copy link
Contributor

Windows failures:

____________ ERROR collecting tests/envs/mujoco/test_mujoco_v5.py _____________
tests\envs\mujoco\test_mujoco_v5.py:11: in <module>
    from gymnasium.envs.mujoco.utils import check_mujoco_reset_state
..\_test_env\lib\site-packages\gymnasium\envs\mujoco\utils.py:14: in <module>
    state_type: mujoco.mjtState = mujoco.mjtState.mjSTATE_FULLPHYSICS,
E   AttributeError: module 'mujoco' has no attribute 'mjtState'
_________ ERROR collecting tests/wrappers/test_atari_preprocessing.py _________
tests\wrappers\test_atari_preprocessing.py:18: in <module>
    (gym.make("ALE/Pong-v5"), (210, 160, 3)),
..\_test_env\lib\site-packages\gymnasium\envs\registration.py:687: in make
    env_spec = _find_spec(id)
..\_test_env\lib\site-packages\gymnasium\envs\registration.py:531: in _find_spec
    _check_version_exists(ns, name, version)
..\_test_env\lib\site-packages\gymnasium\envs\registration.py:397: in _check_version_exists
    _check_name_exists(ns, name)
..\_test_env\lib\site-packages\gymnasium\envs\registration.py:360: in _check_name_exists
    _check_namespace_exists(ns)
..\_test_env\lib\site-packages\gymnasium\envs\registration.py:354: in _check_namespace_exists
    raise error.NamespaceNotFound(f"Namespace {ns} not found. {suggestion_msg}")
E   gymnasium.error.NamespaceNotFound: Namespace ALE not found. Have you installed the proper package for ALE?

@traversaro
Copy link
Contributor

I think Python 3.9 builds are still failing due to some errors in packaging metadata in flax:

2024-10-20T19:25:03.3748713Z ==================================== ERRORS ====================================
2024-10-20T19:25:03.3749261Z ______________ ERROR collecting tests/envs/functional/test_jax.py ______________
2024-10-20T19:25:03.3749791Z tests/envs/functional/test_jax.py:9: in <module>
2024-10-20T19:25:03.3750248Z     from gymnasium.envs.phys2d.cartpole import (  # noqa: E402
2024-10-20T19:25:03.3751418Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/__init__.py:3: in <module>
2024-10-20T19:25:03.3752191Z     from gymnasium.envs.phys2d.cartpole import CartPoleFunctional, CartPoleJaxEnv
2024-10-20T19:25:03.3753204Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/cartpole.py:10: in <module>
2024-10-20T19:25:03.3753865Z     from flax import struct
2024-10-20T19:25:03.3754784Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/__init__.py:24: in <module>
2024-10-20T19:25:03.3755424Z     from flax import core
2024-10-20T19:25:03.3756353Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/__init__.py:15: in <module>
2024-10-20T19:25:03.3757032Z     from .axes_scan import broadcast as broadcast
2024-10-20T19:25:03.3758386Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/axes_scan.py:41: in <module>
2024-10-20T19:25:03.3759046Z     length: int | None = None,

@traversaro
Copy link
Contributor

I think Python 3.9 builds are still failing due to some errors in packaging metadata in flax:

2024-10-20T19:25:03.3748713Z ==================================== ERRORS ====================================
2024-10-20T19:25:03.3749261Z ______________ ERROR collecting tests/envs/functional/test_jax.py ______________
2024-10-20T19:25:03.3749791Z tests/envs/functional/test_jax.py:9: in <module>
2024-10-20T19:25:03.3750248Z     from gymnasium.envs.phys2d.cartpole import (  # noqa: E402
2024-10-20T19:25:03.3751418Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/__init__.py:3: in <module>
2024-10-20T19:25:03.3752191Z     from gymnasium.envs.phys2d.cartpole import CartPoleFunctional, CartPoleJaxEnv
2024-10-20T19:25:03.3753204Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/cartpole.py:10: in <module>
2024-10-20T19:25:03.3753865Z     from flax import struct
2024-10-20T19:25:03.3754784Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/__init__.py:24: in <module>
2024-10-20T19:25:03.3755424Z     from flax import core
2024-10-20T19:25:03.3756353Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/__init__.py:15: in <module>
2024-10-20T19:25:03.3757032Z     from .axes_scan import broadcast as broadcast
2024-10-20T19:25:03.3758386Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/axes_scan.py:41: in <module>
2024-10-20T19:25:03.3759046Z     length: int | None = None,

This will be fixed by:

@traversaro
Copy link
Contributor

traversaro commented Oct 21, 2024

@pseudo-rnd-thoughts @Kallinteris-Andreas do you have any idea on who to skip just the mujoco_py tests (but still execute the mujoco ones? As the problem boils down to debug many remaining failing tests, being able to (either manually or automatically) just skip mujoco_py while continuing to test the mujoco ones would be great, thanks!

@pseudo-rnd-thoughts
Copy link
Contributor

The v2 and v3 robotics environment are mujoco-py, v4 and v5 are mujoco

@traversaro
Copy link
Contributor

The v2 and v3 robotics environment are mujoco-py, v4 and v5 are mujoco

The problem is that the test_mujoco_v5 also tests the earlier versions of environments, and so some tests contained there fail if mujoco_py is not available.

@traversaro
Copy link
Contributor

Ok, I investigated a bit the offscreen rendering situation for mujoco in conda-forge/mujoco-feedstock#66 .

In a nutshell, Azure runners on macOS and Windows do not have GPUs, so the system OpenGL is not going to work. mujoco supports the MUJOCO_GL=osmesa option to do software rendering bypassing completely the system's OpenGL, but that is not supported on Windows and macOS were instead the name of the system's OpenGL libraries are hardcoded, so headless support for mujoco rendering is currently not possible in Windows and macOS. So I think it make sense to just skip rendering-related tests on macOS and Windows.

@traversaro
Copy link
Contributor

Ok, I investigated a bit the offscreen rendering situation for mujoco in conda-forge/mujoco-feedstock#66 .

In a nutshell, Azure runners on macOS and Windows do not have GPUs, so the system OpenGL is not going to work. mujoco supports the MUJOCO_GL=osmesa option to do software rendering bypassing completely the system's OpenGL, but that is not supported on Windows and macOS were instead the name of the system's OpenGL libraries are hardcoded, so headless support for mujoco rendering is currently not possible in Windows and macOS. So I think it make sense to just skip rendering-related tests on macOS and Windows.

Related upstream issue: google-deepmind/mujoco#2164 .

@Kallinteris-Andreas
Copy link

Regarding the skipping of MuJoCo Py tests, I do not have a clean solution for you.
Also keep in mind that MuJoCo Py is planned for removal in 7 months.

@traversaro
Copy link
Contributor

Regarding the skipping of MuJoCo Py tests, I do not have a clean solution for you. Also keep in mind that MuJoCo Py is planned for removal in 7 months.

Thanks, I asked just in case you could think of something. I think we can survive with out manual skipping for now.

@traversaro
Copy link
Contributor

Ok, the last failure is a segfault on linux-aarch64:

tests/wrappers/test_resize_observation.py::test_resize_observation_wrapper[env0] FAILED [ 97%]
Fatal Python error: Segmentation fault

Current thread 0x00004000012e9000 (most recent call first):
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/gymnasium/wrappers/transform_observation.py", line 380 in __init__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/test_tmp/tests/wrappers/test_resize_observation.py", line 37 in test_resize_observation_wrapper
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/python.py", line 159 in pytest_pyfunc_call
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/python.py", line 1627 in runtest
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 174 in pytest_runtest_call
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 242 in <lambda>
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 341 in from_call
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 241 in call_and_report
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 132 in runtestprotocol
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/main.py", line 362 in pytest_runtestloop
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/main.py", line 337 in _main
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/main.py", line 283 in wrap_session
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/main.py", line 330 in pytest_cmdline_main
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/config/__init__.py", line 175 in main
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/site-packages/_pytest/config/__init__.py", line 201 in console_main
  File "/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/pytest", line 11 in <module>

Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, _cffi_backend, Box2D._Box2D, pygame.base, pygame.constants, pygame.rect, pygame.rwobject, pygame.surflock, pygame.bufferproxy, pygame.math, pygame.surface, pygame.display, pygame.draw, pygame.event, pygame.imageext, pygame.image, pygame.joystick, pygame.key, pygame.mouse, pygame.time, pygame.mask, pygame.pixelcopy, pygame.transform, pygame.font, pygame.mixer_music, pygame.mixer, pygame.scrap, pygame.gfxdraw, scipy._lib._ccallback_c, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg.cython_blas, scipy.linalg._matfuncs_expm, scipy.linalg._decomp_update, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.linalg._propack._spropack, scipy.sparse.linalg._propack._dpropack, scipy.sparse.linalg._propack._cpropack, scipy.sparse.linalg._propack._zpropack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.special._ellip_harm_2, scipy.spatial.transform._rotation, scipy.optimize._group_columns, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._cobyla, scipy.optimize._slsqp, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy.optimize._highs.cython.src._highs_wrapper, scipy.optimize._highs._highs_wrapper, scipy.optimize._highs.cython.src._highs_constants, scipy.optimize._highs._highs_constants, scipy.linalg._interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.optimize._direct, scipy.integrate._odepack, scipy.integrate._quadpack, scipy.integrate._vode, scipy.integrate._dop, scipy.integrate._lsoda, scipy.interpolate._fitpack, scipy.interpolate._dfitpack, scipy.interpolate._bspl, scipy.interpolate._ppoly, scipy.interpolate.interpnd, scipy.interpolate._rbfinterp_pythran, scipy.interpolate._rgi_cython, scipy.special.cython_special, scipy.stats._stats, scipy.stats._biasedurn, scipy.stats._levy_stable.levyst, scipy.stats._stats_pythran, scipy._lib._uarray._uarray, scipy.stats._ansari_swilk_statistics, scipy.stats._sobol, scipy.stats._qmc_cy, scipy.stats._mvn, scipy.stats._rcont.rcont, scipy.stats._unuran.unuran_wrapper, scipy.ndimage._nd_image, _ni_label, scipy.ndimage._ni_label, PIL._imaging, kiwisolver._cext, pygame._freetype (total: 127)
/home/conda/feedstock_root/build_artifacts/gymnasium-split_1729589709034/test_tmp/run_test.sh: line 10:  1686 Segmentation fault      (core dumped) pytest -v tests/ -k "not (_not_a_real_test or test_verify_info_x_position or test_verify_info_y_position or test_verify_info_x_velocity or test_verify_info_y_velocity or test_verify_info_xy_velocity_xpos or test_verify_info_xy_velocity_com or test_set_state or test_distance_from_origin_info or test_model_sensors or test_reset_noise_scale or test_max_geom_attribute[10-human] or test_max_geom_attribute[100-human] or test_max_geom_attribute[1000-human] or test_max_geom_attribute[10000-human] or test_render_modes)"
WARNING: Tests failed for gymnasium-all-1.0.0-py310hbbe02a8_0.conda - moving package to /home/conda/feedstock_root/build_artifacts/broken
Traceback (most recent call last):

this is not the first time we have strange segfaults that only occur in emulation (see conda-forge/jax-feedstock#144), so I think we can just skip this test.

@traversaro
Copy link
Contributor

I think Python 3.9 builds are still failing due to some errors in packaging metadata in flax:

2024-10-20T19:25:03.3748713Z ==================================== ERRORS ====================================
2024-10-20T19:25:03.3749261Z ______________ ERROR collecting tests/envs/functional/test_jax.py ______________
2024-10-20T19:25:03.3749791Z tests/envs/functional/test_jax.py:9: in <module>
2024-10-20T19:25:03.3750248Z     from gymnasium.envs.phys2d.cartpole import (  # noqa: E402
2024-10-20T19:25:03.3751418Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/__init__.py:3: in <module>
2024-10-20T19:25:03.3752191Z     from gymnasium.envs.phys2d.cartpole import CartPoleFunctional, CartPoleJaxEnv
2024-10-20T19:25:03.3753204Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/gymnasium/envs/phys2d/cartpole.py:10: in <module>
2024-10-20T19:25:03.3753865Z     from flax import struct
2024-10-20T19:25:03.3754784Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/__init__.py:24: in <module>
2024-10-20T19:25:03.3755424Z     from flax import core
2024-10-20T19:25:03.3756353Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/__init__.py:15: in <module>
2024-10-20T19:25:03.3757032Z     from .axes_scan import broadcast as broadcast
2024-10-20T19:25:03.3758386Z ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.9/site-packages/flax/core/axes_scan.py:41: in <module>
2024-10-20T19:25:03.3759046Z     length: int | None = None,

This will be fixed by:

* [Align dependencies metadata with upstream's pyproject.toml flax-feedstock#38](https://github.com/conda-forge/flax-feedstock/pull/38)

* [Fix flax 0.9.0 to depend on python >=3.10 conda-forge-repodata-patches-feedstock#887](https://github.com/conda-forge/conda-forge-repodata-patches-feedstock/pull/887)

This fixed the tests on Python 3.9 .

@traversaro
Copy link
Contributor

traversaro commented Oct 22, 2024

Ok, as just skipping one or two tests was not working on aarch64, I actually run the pytest with the --forked option, and with that option there is no segfault, but a lot of tests fail with error:

name = 'cv2', package = None

    def import_module(name, package=None):
        """Import a module.
    
        The 'package' argument is required when performing a relative import. It
        specifies the package to use as the anchor point from which to resolve the
        relative import to an absolute import.
    
        """
        level = 0
        if name.startswith('.'):
            if not package:
                msg = ("the 'package' argument is required to perform a relative "
                       "import for {!r}")
                raise TypeError(msg.format(name))
            for character in name:
                if character != '.':
                    break
                level += 1
>       return _bootstrap._gcd_import(name[level:], package, level)
E       ImportError: $PREFIX/lib/python3.10/site-packages/cv2/python-3.10/../../../.././libgomp.so.1: cannot allocate memory in static TLS block

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.10/importlib/__init__.py:126: ImportError

The above exception was the direct cause of the following exception:

The "libgomp.so.1: cannot allocate memory in static TLS block" seems a recurring problem across the web:

The nice news is:

  • The workaround is just to set LD_PRELOAD=libgomp.so.1
  • The issue was fixed in glibc 2.32, so the problem should not occur in modern distros

Note that probably the problem is not occurring for ppc64le as there is no torch there, and so less libraries are dlopened, wasting less TLS space.

@pseudo-rnd-thoughts
Copy link
Contributor

Amazing, thanks for your hard work @traversaro

Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

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

👏 🚀

@h-vetinari h-vetinari merged commit 719615a into conda-forge:main Oct 22, 2024
26 checks passed
@regro-cf-autotick-bot regro-cf-autotick-bot deleted the 1.0.0_h076fe5 branch October 22, 2024 23:47
@traversaro
Copy link
Contributor

Thanks for all the support!

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