mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1322] [Bug] when compiling: Unknown CMake command "pybind11_add_module" #890
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#890
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JinghuaGao on GitHub (May 19, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1322
Checklist
Describe the bug
当前版本(031)编译过程中遇到的问题 , 按照install 的流程, 可能是cmake版本导致的? 报错信息为:
-- enabling CUDA
-- The CUDA compiler identification is NVIDIA 12.2.91 with host compiler GNU 11.4.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- CMAKE_CXX_FLAGS: -O3 -ffast-math -fopenmp
-- ARCH_FLAGS: -mfma;-mavx;-mavx2;-march=native
CMake Error at CMakeLists.txt:354 (pybind11_add_module):
Unknown CMake command "pybind11_add_module".
-- Configuring incomplete, errors occurred!
CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/JinghuaGao/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/JinghuaGao/anaconda3/envs/ktransformers/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-D_GLIBCXX_USE_CXX11_ABI=1']
CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/JinghuaGao/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/JinghuaGao/anaconda3/envs/ktransformers/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-D_GLIBCXX_USE_CXX11_ABI=1', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.3+cu122torch27fancy']
build_temp: /home/JinghuaGao/ktransformers/csrc/ktransformers_ext/build
Traceback (most recent call last):
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in
main()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/JinghuaGao/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/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
self.run_setup()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "", line 668, in
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
self.run_command(cmd)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 1104, in run_command
super().run_command(command)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
cmd_obj.run()
File "", line 263, in run
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
self.run_command("build")
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
self.distribution.run_command(command)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 1104, in run_command
super().run_command(command)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
cmd_obj.run()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
self.distribution.run_command(command)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/dist.py", line 1104, in run_command
super().run_command(command)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
cmd_obj.run()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run
_build_ext.run(self)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run
self.build_extensions()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1010, in build_extensions
build_ext.build_extensions(self)
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions
self._build_extensions_serial()
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial
self.build_extension(ext)
File "", line 591, in build_extension
File "", line 370, in run_command_with_live_tail
File "/home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '/home/JinghuaGao/ktransformers/csrc/ktransformers_ext', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/JinghuaGao/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/JinghuaGao/anaconda3/envs/ktransformers/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-D_GLIBCXX_USE_CXX11_ABI=1', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.3+cu122torch27fancy']' 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/JinghuaGao/anaconda3/envs/ktransformers/bin/python3.11 /home/JinghuaGao/anaconda3/envs/ktransformers/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpv88rzseg
cwd: /home/JinghuaGao/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
安装脚本
sh install.sh
or
USE_BALANCE_SERVE=1 bash ./install.sh
同样的bug
已经尝试过安装pybind11, 使用以下命令, 没有效果:
sudo apt install python3-pybind11
pip install pybind11[global]
Environment
ubuntu 22.04
conda python=3.11
cuda=12.6
torch=2.7
cmake=3.31.7
gcc=11.4
@ovowei commented on GitHub (May 20, 2025):
Did you clone the third-party repository to ensure it's complete (especially the pybind11 library)?
@JinghuaGao commented on GitHub (May 20, 2025):
no, how? the dir of "third-party" is all empty in my cloned Ktransformers path
@ovowei commented on GitHub (May 20, 2025):
try
git submodule update --init --recursive@JinghuaGao commented on GitHub (May 20, 2025):
oh, that works for me, thanks !