mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1022] [Bug] ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers) #724
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#724
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 @alkalimc on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1022
Checklist
Describe the bug
Reproduction
conda create --name ktransformers python=3.11conda activate ktransformersconda install -c conda-forge libstdcxx-ngsudo apt install libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libfmt-dev libgflags-dev zlib1g-dev patchelfgit clone https://github.com/kvcache-ai/ktransformers.gitcd ktransformersgit submodule update --init --recursivesudo env USE_BALANCE_SERVE=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.shEnvironment
@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版本的。
@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),应该就可以编译过去。
@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
@alkalimc commented on GitHub (Apr 3, 2025):
It works