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

Update INSTALL.md to fix error with unsupported Microsoft Visual Studio version #156

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

jhj0517
Copy link
Contributor

@jhj0517 jhj0517 commented Aug 6, 2024

Related issues

This PR suggests a way to resolve the error of unsupported Microsoft Visual Studio version! in INSTALL.md.
Adding -allow-unsupported-compiler argument for the nvcc worked.

Editing setup.py is required to add the -allow-unsupported-compiler argument for nvcc.

def get_extensions():
    srcs = ["sam2/csrc/connected_components.cu"]
    compile_args = {
        "cxx": [],
        "nvcc": [
            "-DCUDA_HAS_FP16=1",
            "-D__CUDA_NO_HALF_OPERATORS__",
            "-D__CUDA_NO_HALF_CONVERSIONS__",
            "-D__CUDA_NO_HALF2_OPERATORS__",
            "-allow-unsupported-compiler"  # Add this argument
        ],
    }
    ext_modules = [CUDAExtension("sam2._C", srcs, extra_compile_args=compile_args)]
    return ext_modules

@facebook-github-bot
Copy link

Hi @jhj0517!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Copy link
Contributor

@ronghanghu ronghanghu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ronghanghu ronghanghu merged commit 0bac418 into facebookresearch:main Aug 6, 2024
2 checks passed
@jhj0517 jhj0517 deleted the fix/update-install.md branch August 7, 2024 06:41
fbcotter added a commit to wayveai/segment-anything-2 that referenced this pull request Sep 6, 2024
… into facebookresearch-main

* 'main' of github.com:facebookresearch/segment-anything-2: (40 commits)
  open `README.md` with unicode (to support Hugging Face emoji); fix various typos (facebookresearch#218)
  accept kwargs in auto_mask_generator
  Fix HF image predictor
  improving warning message and adding further tips for installation (facebookresearch#204)
  better support for non-CUDA devices (CPU, MPS) (facebookresearch#192)
  Update hieradet.py
  add Colab support to the notebooks; pack config files in `sam2_configs` package during installation (facebookresearch#176)
  also catch errors during installation in case `CUDAExtension` cannot be loaded (facebookresearch#175)
  Add interface for box prompt in SAM 2 video predictor (facebookresearch#174)
  Address comment
  Update hieradet.py
  Update docstrings
  Revert code snippet
  Updated INSTALL.md with CUDA_HOME-related troubleshooting (facebookresearch#140)
  Format using ufmt
  Update INSTALL.md (facebookresearch#156)
  Update README
  Make it optional to build CUDA extension for SAM 2; also fallback to all available kernels if Flash Attention fails (facebookresearch#155)
  Clean up
  Address comment
  ...
yanyilyu pushed a commit to yanyilyu/segment-anything-2 that referenced this pull request Sep 17, 2024
This PR suggests a way to resolve the error of `unsupported Microsoft Visual Studio version!` in INSTALL.md.
Adding `-allow-unsupported-compiler` argument for the `nvcc` worked. 

Editing [setup.py](https://github.com/facebookresearch/segment-anything-2/blob/main/setup.py) is required to add the `-allow-unsupported-compiler` argument for `nvcc`.

```python
def get_extensions():
    srcs = ["sam2/csrc/connected_components.cu"]
    compile_args = {
        "cxx": [],
        "nvcc": [
            "-DCUDA_HAS_FP16=1",
            "-D__CUDA_NO_HALF_OPERATORS__",
            "-D__CUDA_NO_HALF_CONVERSIONS__",
            "-D__CUDA_NO_HALF2_OPERATORS__",
            "-allow-unsupported-compiler"  # Add this argument
        ],
    }
    ext_modules = [CUDAExtension("sam2._C", srcs, extra_compile_args=compile_args)]
    return ext_modules
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants