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

[BUG] Error when building from source on Linux #333

Closed
RBNXI opened this issue Sep 10, 2023 · 6 comments · Fixed by #379
Closed

[BUG] Error when building from source on Linux #333

RBNXI opened this issue Sep 10, 2023 · 6 comments · Fixed by #379
Labels
bug Something isn't working

Comments

@RBNXI
Copy link

RBNXI commented Sep 10, 2023

Conda environment with python 3.10.9 (tried also 3.11.4).
Since I'm on Arch I have installed opencl-amd-dev which contains all dependencies to build this (supposedly)
When I try to run ROCM_VERSION=5.4.2 pip install -v . I get an error:


INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=cQIGen -D_GLIBCXX_USE_CXX11_ABI=0
  cc1plus: fatal error: autogptq_extension/qigen/backend.cpp: No such file or directory
  compilation terminated.
  error: command '/usr/bin/g++' failed with exit code 1
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /run/media/ruben/Prime/CharacterAI/oobabooga_linux/text-generation-webui/miniconda/envs/textgen/bin/python -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/run/media/ruben/Prime/CharacterAI/oobabooga_linux/text-generation-webui/text-generation-webui/repositories/AutoGPTQ/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-b1iphocr
  cwd: /run/media/ruben/Prime/CharacterAI/oobabooga_linux/text-generation-webui/text-generation-webui/repositories/AutoGPTQ/
  Building wheel for auto-gptq (setup.py) ... error
  ERROR: Failed building wheel for auto-gptq

setuptools is correctly installed and detected if I do a manual import. I made all the exports to set the ROCM version and gfx.

@RBNXI RBNXI added the bug Something isn't working label Sep 10, 2023
@CrashTD
Copy link

CrashTD commented Sep 15, 2023

very similar problem here in a venv.

relevant part seems to be

ninja: error: '/AutoGPTQ/autogptq_extension/qigen/backend.cpp', needed by '/AutoGPTQ/build/temp.linux-x86_64-cpython-311/autogptq_extension/qigen/backend.o', missing and no known rule to make it

@CodeStillBroken
Copy link

I have the same issue :(

1 similar comment
@online2311
Copy link

I have the same issue :(

@metacarbon
Copy link

Error: autogptq_extension/qigen/backend.cpp: No such file or directory

The backend.cpp should be generated from line 100 in setup.py:
subprocess.call(["python", "./autogptq_extension/qigen/generate.py", "--module", "--search", "--p", str(p)])

This error of missing backend.cpp might be caused whtn this subprocess cost too much time, the generate process does not finish before the ext buildup.

To solve this, I first build the backend.cpp proior when running the setup.py (and also delete line 100-101 since the backend.cpp is already compiled in dir).

@fxmarty
Copy link
Collaborator

fxmarty commented Oct 20, 2023

Kind of crazy this has made it into main

@fxmarty
Copy link
Collaborator

fxmarty commented Oct 25, 2023

@RBNXI @CrashTD @CodeStillBroken @online2311 @metacarbon Could you share your FULL build log? The issue is that the subprocess subprocess.call(["python", "./autogptq_extension/qigen/generate.py", "--module", "--search", "--p", str(p)]) errors out but the build continues.

subprocess.call should not timeout, so it is hard to know what's wrong without a full log.

I had the same issues a few days ago but don't have it anymore. Anyway I will fix setup.py to rightfully raise an error, and possibly give the option to disable QiGen build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants