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

CUDA_HOME not checked before use #1633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

x0152
Copy link

@x0152 x0152 commented Apr 5, 2023

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.

@OneQinG12
Copy link

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.

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

Successfully merging this pull request may close these issues.

2 participants