[GH-ISSUE #1022] [Bug] ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers) #724

Closed
opened 2026-10-29 14:43:33 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @alkalimc on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1022

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed.
  • 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed.

Describe the bug

[3/3] /usr/local/cuda/bin/nvcc --generate-dependencies-with-compile --dependency-output /test/KT
ransformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/home/test/anaconda3/envs/ktran
sformers/lib/python3.11/site-packages/torch/include -I/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/torch
/csrc/api/include -I/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/TH -I/home/test/a
naconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/test/anaconda3/envs/ktransformers
/include/python3.11 -c -c /test/KTransformers/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_ma
rlin.cu -o /test/KTransformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marli
n/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-rela
xed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libst
dcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=sm_89 -gencode=arch=compute_9
0,code=compute_90 -gencode=arch=compute_90,code=sm_90 -std=c++17
  g++ -pthread -B /home/test/anaconda3/envs/ktransformers/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/MoE-DeepSeek-R1-
Qwen2.5-VL/anaconda3/envs/ktransformers/include -fPIC -O2 -isystem /home/test/anaconda3/envs/ktransformers/include -pthread -B /home/MoE-DeepS
eek-R1-Qwen2.5-VL/anaconda3/envs/ktransformers/compiler_compat -shared /test/KTransformers/ktransf
ormers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /test/KTransformers/ktrans
formers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /test/KTr
ansformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/home/test/anaconda3/envs/k
transformers/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.l
inux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so
  CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux
-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMER
S_USE_CUDA=ON']
  CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux
-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMER
S_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']
  build_temp: /test/KTransformers/ktransformers/csrc/balance_serve/build
  Traceback (most recent call last):
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 3
89, in <module>
      main()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 3
73, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 2
80, in build_wheel
      return _build_backend().build_wheel(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 468, in <module>
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
      self.run_command(cmd)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "<string>", line 245, in run
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run
      self.run_command("build")
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
      self.distribution.run_command(command)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run
      self.run_command(cmd_name)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
      self.distribution.run_command(command)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run
      _build_ext.run(self)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run
      self.build_extensions()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions
      build_ext.build_extensions(self)
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions
      self._build_extensions_serial()
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial
      self.build_extension(ext)
    File "<string>", line 396, in build_extension
    File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/subprocess.py", line 571, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['cmake', '/test/KTransformers/ktransformers/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1.
  error: subprocess-exited-with-error
   
  × Building wheel for ktransformers (pyproject.toml) 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: /home/test/anaconda3/envs/ktransformers/bin/python /home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp1q__d8__
  cwd: /test/KTransformers/ktransformers
  Building wheel for ktransformers (pyproject.toml) ... error
  ERROR: Failed building wheel for ktransformers
Failed to build ktransformers
ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers)

Reproduction

conda create --name ktransformers python=3.11
conda activate ktransformers
conda install -c conda-forge libstdcxx-ng
sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf
git clone https://github.com/kvcache-ai/ktransformers.git
cd ktransformers
git submodule update --init --recursive
sudo env USE_BALANCE_SERVE=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh

Environment

  • OS: Ubuntu 22.04.5 LTS x86_64
  • GPU: Nvidia GeForce RTX 4090
  • CPU: Intel Xeon Gold 5418Y (96) @ 3.800GHz
  • $PATH=/usr/local/cuda/bin:$PATH
  • $CUDA_PATH=/usr/local/cuda
  • $CUDA_HOME=/usr/local/cuda
  • $LD_LIBRARY_PATH=/usr/local/cuda/lib64
  • NVCC: 12.4
  • GCC: 11.4.0
  • CMAKE: 3.22.1
Originally created by @alkalimc on GitHub (Apr 3, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1022 ### Checklist - [x] 1. I have searched related issues but cannot get the expected help. - [x] 2. The bug has not been fixed in the latest version. - [x] 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback. - [x] 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed. - [x] 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed. ### Describe the bug ``` [3/3] /usr/local/cuda/bin/nvcc --generate-dependencies-with-compile --dependency-output /test/KT ransformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/home/test/anaconda3/envs/ktran sformers/lib/python3.11/site-packages/torch/include -I/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/torch /csrc/api/include -I/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/TH -I/home/test/a naconda3/envs/ktransformers/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/test/anaconda3/envs/ktransformers /include/python3.11 -c -c /test/KTransformers/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_ma rlin.cu -o /test/KTransformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marli n/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-rela xed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libst dcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=sm_89 -gencode=arch=compute_9 0,code=compute_90 -gencode=arch=compute_90,code=sm_90 -std=c++17 g++ -pthread -B /home/test/anaconda3/envs/ktransformers/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/MoE-DeepSeek-R1- Qwen2.5-VL/anaconda3/envs/ktransformers/include -fPIC -O2 -isystem /home/test/anaconda3/envs/ktransformers/include -pthread -B /home/MoE-DeepS eek-R1-Qwen2.5-VL/anaconda3/envs/ktransformers/compiler_compat -shared /test/KTransformers/ktransf ormers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /test/KTransformers/ktrans formers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /test/KTr ansformers/ktransformers/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/home/test/anaconda3/envs/k transformers/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.l inux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux -x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMER S_USE_CUDA=ON'] CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux -x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMER S_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy'] build_temp: /test/KTransformers/ktransformers/csrc/balance_serve/build Traceback (most recent call last): File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 3 89, in <module> main() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 3 73, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 2 80, in build_wheel return _build_backend().build_wheel( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir self.run_setup() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) File "<string>", line 468, in <module> File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands self.run_command(cmd) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "<string>", line 245, in run File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run self.run_command("build") File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run self.run_command(cmd_name) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run self.build_extensions() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions build_ext.build_extensions(self) File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions self._build_extensions_serial() File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial self.build_extension(ext) File "<string>", line 396, in build_extension File "/home/test/anaconda3/envs/ktransformers/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '/test/KTransformers/ktransformers/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error × Building wheel for ktransformers (pyproject.toml) 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: /home/test/anaconda3/envs/ktransformers/bin/python /home/test/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp1q__d8__ cwd: /test/KTransformers/ktransformers Building wheel for ktransformers (pyproject.toml) ... error ERROR: Failed building wheel for ktransformers Failed to build ktransformers ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers) ``` ### Reproduction `conda create --name ktransformers python=3.11` `conda activate ktransformers` `conda install -c conda-forge libstdcxx-ng` `sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf` `git clone https://github.com/kvcache-ai/ktransformers.git` `cd ktransformers` `git submodule update --init --recursive` `sudo env USE_BALANCE_SERVE=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh` ### Environment - OS: Ubuntu 22.04.5 LTS x86_64 - GPU: Nvidia GeForce RTX 4090 - CPU: Intel Xeon Gold 5418Y (96) @ 3.800GHz - $PATH=/usr/local/cuda/bin:$PATH - $CUDA_PATH=/usr/local/cuda - $CUDA_HOME=/usr/local/cuda - $LD_LIBRARY_PATH=/usr/local/cuda/lib64 - NVCC: 12.4 - GCC: 11.4.0 - CMAKE: 3.22.1
Author
Owner

@CYSTEV-chn commented on GitHub (Apr 3, 2025):

sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf

改成:
sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf

这个软件包libaio1单独安装deb版本的。

<!-- gh-comment-id:2774077374 --> @CYSTEV-chn commented on GitHub (Apr 3, 2025): sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf 改成: sudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelf 这个软件包libaio1单独安装deb版本的。
Author
Owner

@bocawu commented on GitHub (Apr 3, 2025):

手动执行cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有
以下信息:
Target "cmTC_a83d0" requires the language dialect "CUDA20" (with compiler
extensions), but CMake does not know the compile flags to use to enable it.

就在ktransformers/csrc/balance_serve/CMakeLists.txt里加上一行set(CMAKE_CUDA_STANDARD 17),应该就可以编译过去。

<!-- gh-comment-id:2774101555 --> @bocawu commented on GitHub (Apr 3, 2025): 手动执行cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有 以下信息: Target "cmTC_a83d0" requires the language dialect "CUDA20" (with compiler extensions), but CMake does not know the compile flags to use to enable it. 就在ktransformers/csrc/balance_serve/CMakeLists.txt里加上一行set(CMAKE_CUDA_STANDARD 17),应该就可以编译过去。
Author
Owner

@Colacalc commented on GitHub (Apr 3, 2025):

源码编译错误信息:
FileNotFoundError: [Errno 2] No such file or directory: ':/usr/local/cuda:/usr/local/cuda:/usr/local/cuda/bin/nvcc'
error: subprocess-exited-with-error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) 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: /home/x/miniconda3/envs/kt/bin/python /home/x/miniconda3/envs/kt/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpbzym6zxk
cwd: /home/x/Desktop/ktransformers
Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

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

Environment
OS: Ubuntu 22.04.3 x86_64
GPU: Nvidia GeForce RTX 4090 48G
CPU: Intel Xeon Gold 6554S (36) @ 3.800GHz

NVCC: 12.4
GCC: 11.4.0
CMAKE: 3.22.1
Torch 2.6.0

Adding CUDA to PATH

if [ -d "/usr/local/cuda/bin" ]; then
export PATH=$PATH:/usr/local/cuda/bin
fi

if [ -d "/usr/local/cuda/lib64" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
# Or you can add it to /etc/ld.so.conf and run ldconfig as root:
# echo "/usr/local/cuda-12.x/lib64" | sudo tee -a /etc/ld.so.conf
# sudo ldconfig
fi

if [ -d "/usr/local/cuda" ]; then
export CUDA_PATH=$CUDA_PATH:/usr/local/cuda
fi

<!-- gh-comment-id:2774245665 --> @Colacalc commented on GitHub (Apr 3, 2025): **源码编译错误信息:** FileNotFoundError: [Errno 2] No such file or directory: ':/usr/local/cuda:/usr/local/cuda:/usr/local/cuda/bin/nvcc' error: subprocess-exited-with-error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) 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: /home/x/miniconda3/envs/kt/bin/python /home/x/miniconda3/envs/kt/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpbzym6zxk cwd: /home/x/Desktop/ktransformers Preparing metadata (pyproject.toml) ... error error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. **Environment** OS: Ubuntu 22.04.3 x86_64 GPU: Nvidia GeForce RTX 4090 48G CPU: Intel Xeon Gold 6554S (36) @ 3.800GHz NVCC: 12.4 GCC: 11.4.0 CMAKE: 3.22.1 Torch 2.6.0 # Adding CUDA to PATH if [ -d "/usr/local/cuda/bin" ]; then export PATH=$PATH:/usr/local/cuda/bin fi if [ -d "/usr/local/cuda/lib64" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 # Or you can add it to /etc/ld.so.conf and run ldconfig as root: # echo "/usr/local/cuda-12.x/lib64" | sudo tee -a /etc/ld.so.conf # sudo ldconfig fi if [ -d "/usr/local/cuda" ]; then export CUDA_PATH=$CUDA_PATH:/usr/local/cuda fi
Author
Owner

@alkalimc commented on GitHub (Apr 3, 2025):

手动执行cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有手动执行 cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有 以下信息: Target "cmTC_a83d0" requires the language dialect "CUDA20" (with compiler目标“cmTC_a83d0”需要语言方言“CUDA20”(带编译器 extensions), but CMake does not know the compile flags to use to enable it.扩展),但 CMake 不知道使用什么编译标志来启用它。

就在ktransformers/csrc/balance_serve/CMakeLists.txt里加上一行set(CMAKE_CUDA_STANDARD 17),应该就可以编译过去。

It works

<!-- gh-comment-id:2775142429 --> @alkalimc commented on GitHub (Apr 3, 2025): > 手动执行cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有手动执行 cmake /test/KTransformers/ktransformers/csrc/balance_serve -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/test/KTransformers/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/test/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_CUDA=ON -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy,如果错误里有 以下信息: Target "cmTC_a83d0" requires the language dialect "CUDA20" (with compiler目标“cmTC_a83d0”需要语言方言“CUDA20”(带编译器 extensions), but CMake does not know the compile flags to use to enable it.扩展),但 CMake 不知道使用什么编译标志来启用它。 > > 就在ktransformers/csrc/balance_serve/CMakeLists.txt里加上一行set(CMAKE_CUDA_STANDARD 17),应该就可以编译过去。 It works
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#724
No description provided.