Skip to content

fix: MetaDrive sim on macOS (#33207)#38156

Open
imperatormk wants to merge 1 commit into
commaai:masterfrom
imperatormk:metadrive-macos
Open

fix: MetaDrive sim on macOS (#33207)#38156
imperatormk wants to merge 1 commit into
commaai:masterfrom
imperatormk:metadrive-macos

Conversation

@imperatormk

Copy link
Copy Markdown

Makes pytest tools/sim/tests/test_metadrive_bridge.py pass on macOS, no test changes. Fixes #33207. Requires commaai/metadrive#15 (without it the road is invisible to the model on macOS and the car won't drive).

Three points worked on:

  • manager dies silently at startup: prepare() pre-imports the ui module (pyray -> Cocoa) inside the forkpty child, which aborts on macOS. Pre-importing only helps with fork start method, so skip it under spawn
  • locationd rejects every cameraOdometry, so openpilot never engages: sim camerad's synthetic eof = frame_id * 0.05 is in a different clock domain than the IMU timestamps. Stamp eof from time.monotonic_ns()
  • modeld only hits 13Hz on plain DEV=CPU, starving locationd. Use CPU:LLVM like everywhere else, with a probe fallback since libLLVM isn't guaranteed on macOS (afaik but safer anyway)

Verification

Verified on M1 Pro (macOS 27 beta)

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get MetaDrive simulator working on macOS

1 participant