Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

Not a directory: hipconfig

Open sramroach opened this issue 2 years ago • 7 comments

Hello,

I'm trying to install via python3 -m pip install -e GroundingDINO but I'm getting the error:

ERROR: Command errored out with exit status 1:
     command: /home/sterling/.pyenv/versions/sam/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/sterling/Documents/External_Repos/SAM/Grounded-Segment-Anything/GroundingDINO/setup.py'"'"'; __file__='"'"'/home/sterling/Documents/External_Repos/SAM/Grounded-Segment-Anything/GroundingDINO/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /home/sterling/Documents/External_Repos/SAM/Grounded-Segment-Anything/GroundingDINO/
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/sterling/Documents/External_Repos/SAM/Grounded-Segment-Anything/GroundingDINO/setup.py", line 29, in <module>
        from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension
      File "/home/sterling/.pyenv/versions/sam/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 19, in <module>
        from .hipify import hipify_python
      File "/home/sterling/.pyenv/versions/sam/lib/python3.8/site-packages/torch/utils/hipify/hipify_python.py", line 34, in <module>
        from .cuda_to_hip_mappings import CUDA_TO_HIP_MAPPINGS
      File "/home/sterling/.pyenv/versions/sam/lib/python3.8/site-packages/torch/utils/hipify/cuda_to_hip_mappings.py", line 34, in <module>
        rocm_path = subprocess.check_output(["hipconfig", "--rocmpath"]).decode("utf-8")
      File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/lib/python3.8/subprocess.py", line 493, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    NotADirectoryError: [Errno 20] Not a directory: 'hipconfig'

I can run and generate masks with SAM already so all of those dependencies are met.

sramroach avatar Apr 14 '23 15:04 sramroach

have you set the CUDA_HOME variable? Moreover, can you help to provide more details about the torch and python versions?

SlongLiu avatar Apr 16 '23 13:04 SlongLiu

I also appeal problems, the following is my torch and python version.

certifi                  2022.12.7
charset-normalizer       3.1.0
cmake                    3.26.3
Deprecated               1.2.13
filelock                 3.12.0
idna                     3.4
Jinja2                   3.1.2
lit                      16.0.2
MarkupSafe               2.1.2
mpmath                   1.3.0
networkx                 3.1
numpy                    1.24.3
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-cupti-cu11   11.7.101
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
nvidia-cufft-cu11        10.9.0.58
nvidia-curand-cu11       10.2.10.91
nvidia-cusolver-cu11     11.4.0.1
nvidia-cusparse-cu11     11.7.4.91
nvidia-nccl-cu11         2.14.3
nvidia-nvtx-cu11         11.7.91
opencv-python            4.7.0.72
Pillow                   9.5.0
pip                      23.0.1
pyarrow                  10.0.1
requests                 2.28.2
rerun-sdk                0.5.0
segment-anything         1.0
setuptools               66.0.0
sympy                    1.11.1
torch                    2.0.0
torchvision              0.15.1
tqdm                     4.65.0
triton                   2.0.0
typing_extensions        4.5.0
urllib3                  1.26.15
wheel                    0.38.4
wrapt                    1.15.0

sharkls avatar Apr 26 '23 06:04 sharkls

I also have the same problem

Obtaining file:///home/ai/Grounded-Segment-Anything/GroundingDINO Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/ai/Grounded-Segment-Anything/GroundingDINO/setup.py", line 29, in from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension File "/home/ai/miniconda3/envs/sam/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 19, in from .hipify import hipify_python File "/home/ai/miniconda3/envs/sam/lib/python3.10/site-packages/torch/utils/hipify/hipify_python.py", line 34, in from .cuda_to_hip_mappings import CUDA_TO_HIP_MAPPINGS File "/home/ai/miniconda3/envs/sam/lib/python3.10/site-packages/torch/utils/hipify/cuda_to_hip_mappings.py", line 34, in rocm_path = subprocess.check_output(["hipconfig", "--rocmpath"]).decode("utf-8") File "/home/ai/miniconda3/envs/sam/lib/python3.10/subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/ai/miniconda3/envs/sam/lib/python3.10/subprocess.py", line 503, in run with Popen(*popenargs, **kwargs) as process: File "/home/ai/miniconda3/envs/sam/lib/python3.10/subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/home/ai/miniconda3/envs/sam/lib/python3.10/subprocess.py", line 1847, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) NotADirectoryError: [Errno 20] Not a directory: 'hipconfig' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

weijiafs avatar May 05 '23 12:05 weijiafs

Same issue occurs when I installed apex by pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./, refer to: apex

image image

jiqing-feng avatar May 08 '23 07:05 jiqing-feng

兄弟们 你们解决了吗

pyh007 avatar Jul 10 '23 09:07 pyh007

export PATH=$PATH:/usr/local/bin/aws export PATH=$PATH:[MYHIP]/bin

I don't know why, but this helps

Mrhetsko avatar Jul 10 '23 09:07 Mrhetsko

export PATH=$PATH:/usr/local/bin/aws export PATH=$PATH:[MYHIP]/bin

I don't know why, but this helps

Great! Also helps in the process of installing detectron2.

YiZhiTangZong avatar Aug 03 '24 07:08 YiZhiTangZong