Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring sam2 environment on Linux system #108

Closed
dehaozhou opened this issue Aug 2, 2024 · 1 comment
Closed

Configuring sam2 environment on Linux system #108

dehaozhou opened this issue Aug 2, 2024 · 1 comment

Comments

@dehaozhou
Copy link

Firstly, you need to use the nvcc -V command to confirm your CUDA version. Please ensure that the CUDA version is 12.1 or higher.
conda create --name sam2 python==3.10
conda activate sam2
pip3 install torch torchvision torchaudio
Be careful not to specify the version, as automatically installed versions will match each other.
pip install --no-build-isolation -e .
pip install -e ".[demo]"
Installation successful.
Note: Ensure that your CUDA environment variables are set at the bottom of the .bashrc file, otherwise, you may encounter unexpected errors.

@ronghanghu
Copy link
Contributor

Hi, this is likely due to a failure in SAM 2 CUDA extension building. We have recently made the CUDA extension step optional (in #155) as a workaround to this problem.

You can pull the latest code and reinstall via

# run the line below inside the SAM 2 repo
git pull;
pip uninstall -y SAM-2;
rm -f sam2/*.so;
pip install -e ".[demo]"

which allows using SAM 2 without CUDA extension (the results should stay the same in most cases, see INSTALL.md for details).

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

No branches or pull requests

2 participants