Skip to content

Running on macos with MPS #5

Closed
Closed

Description

@danydev

This project looks so promising, but I'm wondering, is there a way to run it on macos? So by leveraging MPS?

nice job, keep up the good work!

Activity

  1. changed the title [-]Running on macos[/-] [+]Running on macos with MPS[/+] on Apr 23, 2025
  2. DonggeonKim1012 commented on Apr 28, 2025

    @DonggeonKim1012
    Contributor

    Thank you for taking interest in our repository :)

    We removed the lines enabling MPS from the original SAM code,
    but I don't think we've made changes that would make using MPS impossible.

    My suggestion is

    1. Changing device='cuda' to device='mps', and .cuda() to .to('mps') inside tam_app.py & efficienttam_camera_predictor.py
    2. Setting device in build_efficienttam.py's build_efficienttam_camera_predictor()

    I'm sorry I can't provide much assistance as we don't have access to macos at the moment.
    Let us know how it goes!

  3. danydev commented on Apr 28, 2025

    @danydev
    ContributorAuthor

    Thank you, I was able to make it work.
    I pushed https://github.com/robrosinc/REALTIME_SAM2/pull/6/files with all the relevant changes needed.

    Other than using that code I just needed to create the env with conda create -n rtsam2dan python=3.10 --platform osx-arm64 since the default platform for me wasn't arm64.

    Also I changed the port since 5000 is occupied by AirPlay (I didn't change it in the PR anyway, since it gave me a warning about it specific for mac to disable AirPlay, so at least was something already known)

  4. DonggeonKim1012 commented on Apr 29, 2025

    @DonggeonKim1012
    Contributor

    I'm glad it all worked out! 🚀

    Thanks for the changes, I've merged them to main.

    I will refer to this issue in the README for future mac users.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions