Files
ktransformers/csrc/balance_serve/kvc2
Aubrey Li 45d20fa87b balance_serve: Add g++ to compiler list
In some OS distributions, g++ exists in the following form:

  # ls -l /usr/bin/g++*
  -rwxr-xr-x 4 root root 985784 Dec  9 12:51 /usr/bin/g++

So make sure to add g++ to the compiler list as well.
2025-04-09 11:25:35 +08:00
..
2025-03-31 22:55:32 +08:00

KVC2

Build

运行以下命令编译kvc2注意可能需要 sudo 权限安装一些依赖

git clone https://github.com/kvcache-ai/kvc2
cd kvc2
./install_deps.sh
mkdir build
cd build
cmake ..
make -j && make install

编译完成后会生成build/output,包含kvc2_ext.cpython-312-x86_64-linux-gnu.sokvc2_utils.py方便调用。

Troubleshooting

在 Python 环境运行时,可以需要在 conda 中安装相关的依赖。

conda install -c conda-forge gcc_linux-64 gxx_linux-64

也可以尝试设置一下环境变量,然后再运行。

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7