Skip to content

[Bug]: Render Tests Failure (SDL_RumbleMotor Deps Duplicate)#2255

Description

@jvoids

馃悰 Bug

Hi guys.
For whatever reason the tests started to fail for tests/test_vec_envs.py::test_render
I'm not really sure what could really changed to cause the issue as it definitely run well lately (all the tests)

Previously it was actually normal silent run. But now for the render tests it forces screen switching to a visual displays and then crushes. due Class SDL_RumbleMotor is implemented in both opencv and pygame

Is it maybe just a matter of reconfigure env to disable visual display as it ran previously?

Thanks

To Reproduce

git clone https://github.com/DLR-RM/stable-baselines3.git --depth 1
cd stable-baselines3
python -m venv .sb3-venv
. .sb3-venv/bin/activate
pip install -e '.[docs,tests,extra]'
python3 -m pytest -v tests/test_vec_envs.py::test_render

Relevant log output / Error message

python3 -m pytest -v tests/test_vec_envs.py::test_render
======================================================================================================================================= test session starts ========================================================================================================================================
platform darwin -- Python 3.13.3, pytest-9.0.3, pluggy-1.6.0 -- ./.sb3-venv/bin/python3
cachedir: .pytest_cache
rootdir: .
configfile: pyproject.toml
plugins: cov-7.1.0, xdist-3.8.0, env-1.6.0, anyio-4.13.0
collected 2 items

tests/test_vec_envs.py::test_render[DummyVecEnv] PASSED                                                                                                                                                                                                                                      [ 50%]
tests/test_vec_envs.py::test_render[SubprocVecEnv] FAILED                                                                                                                                                                                                                                    [100%]

============================================================================================================================================= FAILURES =============================================================================================================================================
____________________________________________________________________________________________________________________________________ test_render[SubprocVecEnv] ____________________________________________________________________________________________________________________________________

vec_env_class = <class 'stable_baselines3.common.vec_env.subproc_vec_env.SubprocVecEnv'>

    @pytest.mark.parametrize("vec_env_class", VEC_ENV_CLASSES)
    def test_render(vec_env_class):
        # Skip if no X-Server
        if not os.environ.get("DISPLAY"):
            pytest.skip("No X-Server")

        env_id = "Pendulum-v1"
        # DummyVecEnv human render is currently
        # buggy because of gym:
        # https://github.com/carlosluis/stable-baselines3/pull/3#issuecomment-1356863808
        n_envs = 2
        # Human render
        vec_env = make_vec_env(
            env_id,
            n_envs,
            vec_env_cls=vec_env_class,
            env_kwargs=dict(render_mode="human"),
        )

>       vec_env.reset()

tests/test_vec_envs.py:610:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stable_baselines3/common/vec_env/subproc_vec_env.py:145: in reset
    results = [remote.recv() for remote in self.remotes]
               ^^^^^^^^^^^^^
../../../.brew/Cellar/python@3.13/3.13.3_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/connection.py:250: in recv
    buf = self._recv_bytes()
          ^^^^^^^^^^^^^^^^^^
../../../.brew/Cellar/python@3.13/3.13.3_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/connection.py:430: in _recv_bytes
    buf = self._recv(4)
          ^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <multiprocessing.connection.Connection object at 0x1447aa120>, size = 4, read = <built-in function read>

    def _recv(self, size, read=_read):
        buf = io.BytesIO()
        handle = self._handle
        remaining = size
        while remaining > 0:
            chunk = read(handle, remaining)
            n = len(chunk)
            if n == 0:
                if remaining == size:
>                   raise EOFError
E                   EOFError

../../../.brew/Cellar/python@3.13/3.13.3_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/connection.py:399: EOFError
--------------------------------------------------------------------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------------------------------------------------------------------
objc[27303]: Class SDL_RumbleMotor is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cd40) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1c9c8). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_RumbleMotor is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148d40) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf89c8). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_RumbleContext is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cd90) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1ca18). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_RumbleContext is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148d90) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8a18). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLApplication is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106c890) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1ca68). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLApplication is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148890) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8a68). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLAppDelegate is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106c8e0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cab8). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLAppDelegate is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x1311488e0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8ab8). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLTranslatorResponder is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106c958) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cb30). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLTranslatorResponder is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148958) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8b30). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLMessageBoxPresenter is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106c980) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cb58). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLMessageBoxPresenter is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148980) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8b58). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_cocoametalview is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106c9d0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cba8). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_cocoametalview is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x1311489d0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8ba8). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLOpenGLContext is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106ca20) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cbf8). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLOpenGLContext is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148a20) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8bf8). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_ShapeData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106ca98) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cc70). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_ShapeData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148a98) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8c70). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_CocoaClosure is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cae8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1ccc0). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_CocoaClosure is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148ae8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8cc0). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_VideoData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cb38) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cd10). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_VideoData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148b38) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8d10). One of the two will be used. Which one is undefined.
objc[27303]: Class SDL_WindowData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cb88) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cd60). One of the two will be used. Which one is undefined.
objc[27304]: Class SDL_WindowData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148b88) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8d60). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLWindow is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cbb0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cd88). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLWindow is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148bb0) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8d88). One of the two will be used. Which one is undefined.
objc[27303]: Class Cocoa_WindowListener is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cbd8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cdb0). One of the two will be used. Which one is undefined.
objc[27304]: Class Cocoa_WindowListener is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148bd8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8db0). One of the two will be used. Which one is undefined.
objc[27303]: Class SDLView is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cc50) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1ce28). One of the two will be used. Which one is undefined.
objc[27304]: Class SDLView is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148c50) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8e28). One of the two will be used. Which one is undefined.
objc[27303]: Class METAL_RenderData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106ccc8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cea0). One of the two will be used. Which one is undefined.
objc[27304]: Class METAL_RenderData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148cc8) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8ea0). One of the two will be used. Which one is undefined.
objc[27303]: Class METAL_TextureData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x13106cd18) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132b1cef0). One of the two will be used. Which one is undefined.
objc[27304]: Class METAL_TextureData is implemented in both ./.sb3-venv/lib/python3.13/site-packages/cv2/.dylibs/libSDL2-2.0.0.dylib (0x131148d18) and ./.sb3-venv/lib/python3.13/site-packages/pygame/.dylibs/libSDL2-2.0.0.dylib (0x132cf8ef0). One of the two will be used. Which one is undefined.
===================================================================================================================================== short test summary info ======================================================================================================================================
FAILED tests/test_vec_envs.py::test_render[SubprocVecEnv] - EOFError
=================================================================================================================================== 1 failed, 1 passed in 4.09s ====================================================================================================================================

System Info

  • OS: macOS-14.6.1-arm64-arm-64bit-Mach-O Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  • Python: 3.13.3
  • Stable-Baselines3: 2.8.0
  • PyTorch: 2.11.0
  • GPU Enabled: False
  • Numpy: 2.4.4
  • Cloudpickle: 3.1.2
  • Gymnasium: 1.2.3

Checklist

  • My issue does not relate to a custom gym environment. (Use the custom gym env template instead)
  • I have checked that there is no similar issue in the repo
  • I have read the documentation
  • I have provided a minimal and working example to reproduce the bug
  • I've used the markdown code blocks for both code and stack traces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions