Fix running server and GUI together on macOS#3405
Merged
azeey merged 2 commits intogazebosim:mainfrom Mar 20, 2026
Merged
Conversation
The server has to run as the main thread in order for Metal APIs to initialize properly Generated-By: Gemini 2.5 Pro Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
arjo129
approved these changes
Mar 19, 2026
Contributor
arjo129
left a comment
There was a problem hiding this comment.
Nice! Tested it on my mac and it works. We seem to have broken Bazel for mac os in gz-common?
11 tasks
Contributor
gazebosim/gz-common#795 should fix the bazel builds |
Contributor
Author
|
@Mergifyio backport gz-sim10 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Mar 25, 2026
On macOS the Metal API requires initialization from the main thread. As a result, we currently cannot run worlds with rendering sensors on macOS without running the server and GUI seprately. This PR fixes this be ensuring the server runs on the main thread (using the blocking=true flag on Server::Run) and creating a separate thread to monitor the GUI process. Generated-By: Gemini 2.5 Pro Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai> Co-authored-by: Arjo Chakravarty <arjoc@intrinsic.ai> (cherry picked from commit 7dd25f6)
11 tasks
azeey
added a commit
that referenced
this pull request
Mar 25, 2026
On macOS the Metal API requires initialization from the main thread. As a result, we currently cannot run worlds with rendering sensors on macOS without running the server and GUI seprately. This PR fixes this be ensuring the server runs on the main thread (using the blocking=true flag on Server::Run) and creating a separate thread to monitor the GUI process. Generated-By: Gemini 2.5 Pro Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai> Co-authored-by: Arjo Chakravarty <arjoc@intrinsic.ai> (cherry picked from commit 7dd25f6)
jasmeet0915
pushed a commit
to jasmeet0915/gz-sim
that referenced
this pull request
Mar 28, 2026
On macOS the Metal API requires initialization from the main thread. As a result, we currently cannot run worlds with rendering sensors on macOS without running the server and GUI seprately. This PR fixes this be ensuring the server runs on the main thread (using the blocking=true flag on Server::Run) and creating a separate thread to monitor the GUI process. Generated-By: Gemini 2.5 Pro Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai> Co-authored-by: Arjo Chakravarty <arjoc@intrinsic.ai> (cherry picked from commit 7dd25f6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Summary
On macOS Metal API is requires initialization from the main thread. As a result, we currently cannot run worlds with rendering sensors on macOS without running the server and GUI seprately, i.e,
gz sim camera_sensors.sdfcrashes with the following stacktraceThis PR fixes this be ensuring the server runs on the main thread (using the
blocking=trueflag onServer::Run) and creating a separate thread to monitor the GUI process.joint_server_gui.mp4
Checklist
codecheckpassed (See contributing)Generated-By: Gemini 2.5 Pro
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.Backports: If this is a backport, please use Rebase and Merge instead.
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸