Skip to content

Commit

Permalink
[misc] Move to macos-14 on Github Action (forcing panda3d tinydisplay…
Browse files Browse the repository at this point in the history
… driver).
  • Loading branch information
duburcqa committed Nov 16, 2024
1 parent ba556b7 commit 188e48a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
strategy:
matrix:
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
OS: ['macos-13'] # 'macos-13': Intel (x86), 'macos-14+': Apple Silicon (arm64)
OS: ['macos-14'] # 'macos-13': Intel (x86), 'macos-14+': Apple Silicon (arm64)
PYTHON_VERSION: ['3.10', '3.11', '3.12'] # `setup-python` does not support Python<3.10 on Apple Silicon
BUILD_TYPE: ['Release']
include:
Expand Down Expand Up @@ -183,12 +182,20 @@ jobs:
ctest --output-on-failure --test-dir "${RootDir}/build/core/unit"
cd "${RootDir}/python/jiminy_py/unit_py"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
"${PYTHON_EXECUTABLE}" -m unittest discover -v
- name: Run unit tests for gym jiminy base module
run: |
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
# FIXME: Disabling `test_pipeline_control.py` on MacOS because `test_pid_standing` is
# failing for 'panda3d-sync' backend due to meshes still loading at screenshot time.
if [[ "${{ matrix.BUILD_TYPE }}" == 'Debug' ]] ; then
Expand All @@ -202,6 +209,10 @@ jobs:
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
cd "${RootDir}/python/gym_jiminy/examples/rllib"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
"${PYTHON_EXECUTABLE}" acrobot_ppo.py
#########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@
CLOCK_SCALE = 0.1
WIDGET_MARGIN_REL = 0.02

PANDA3D_FRAMERATE_MAX = 40
PANDA3D_REQUEST_TIMEOUT = 30.0
FRAMERATE_MAX = 40
REQUEST_TIMEOUT = 30.0

FORCE_TINYDISPLAY_DRIVER = "JIMINY_PANDA3D_FORCE_TINYDISPLAY" in os.environ


Tuple3FType = Union[Tuple[float, float, float], np.ndarray]
Expand Down Expand Up @@ -411,11 +413,14 @@ def __init__(self, # pylint: disable=super-init-not-called
# config.set_value('want-pstats', True)
config.set_value('framebuffer-software', False)
config.set_value('framebuffer-hardware', False)
config.set_value('load-display', 'pandagl')
config.set_value('aux-display',
'p3headlessgl'
'\naux-display pandadx9'
'\naux-display p3tinydisplay')
if FORCE_TINYDISPLAY_DRIVER:
config.set_value('load-display', 'p3tinydisplay')
else:
config.set_value('load-display', 'pandagl')
config.set_value('aux-display',
'p3headlessgl'
'\naux-display pandadx9'
'\naux-display p3tinydisplay')
config.set_value('window-type', 'offscreen')
config.set_value('sync-video', False)
config.set_value('default-near', 0.1)
Expand Down Expand Up @@ -652,7 +657,7 @@ def open_window(self) -> None:
self.picker_traverser.addCollider(picker_np, self.picker_queue)

# Limit framerate to reduce computation cost
self.set_framerate(PANDA3D_FRAMERATE_MAX)
self.set_framerate(FRAMERATE_MAX)

# Create resizeable offscreen buffer
self._open_offscreen_window(size)
Expand Down Expand Up @@ -2054,7 +2059,7 @@ def _send(*args: Any, **kwargs: Any) -> Any:
self._host_conn.send((name, args, kwargs, self._is_async))
if self._is_async:
return None
if self._host_conn.poll(PANDA3D_REQUEST_TIMEOUT):
if self._host_conn.poll(REQUEST_TIMEOUT):
reply = self._host_conn.recv()
else:
# Something is wrong... aborting to prevent potential deadlock
Expand Down

0 comments on commit 188e48a

Please sign in to comment.