apex icon indicating copy to clipboard operation
apex copied to clipboard

CUDA_HOME not checked before use

Open x0152 opened this issue 2 years ago • 1 comments

Trying to install apex: pip3 install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ and get error:

  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/my/path/apex/setup.py", line 132, in <module>
      _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME)
    File "/my/path/apex/setup.py", line 17, in get_cuda_bare_metal_version
      raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This happened because my CUDA_HOME isn't specified and equal to None and cuda_dir + "/bin/nvcc" -> None + str CUDA_HOME not checked before use.

x0152 avatar Apr 05 '23 18:04 x0152

Traceback (most recent call last): File "E:/project/MIST_VAD-master/apex-master/setup.py", line 136, in raise_if_cuda_home_none("get_cuda_bare_metal_version") File "E:/project/MIST_VAD-master/apex-master/setup.py", line 53, in raise_if_cuda_home_none f"{global_option} was requested, but nvcc was not found. Are you sure your environment has nvcc available? " RuntimeError: get_cuda_bare_metal_version was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.

OneQinG12 avatar Jul 02 '23 02:07 OneQinG12