Files
enginex-c_series-llama.cpp/README.md
2025-08-28 15:34:05 +08:00

42 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# enginex-c_series-llama.cpp
## 镜像
本仓库 [软件包](https://git.modelhub.org.cn:9443/EngineX-MetaX/enginex-c_series-llama.cpp/packages) 提供已安装好 `llama.cpp`(基于 [tag b6294](https://github.com/ggml-org/llama.cpp/tree/bcbddcd54f0d5c22eab180831fdea6484107112f))的镜像,可以通过如下命令直接拉取镜像
`docker pull git.modelhub.org.cn:9443/enginex-metax/maca-c500-llama.cpp:20250827`
## 运行说明
参照运行 DeepSeek-V3.1 unsloth 量化版https://docs.unsloth.ai/basics/deepseek-v3.1#run-in-llama.cpp
## 编译说明
建议直接使用社区所提供的镜像运行,如果需要自行构建,可以参照如下使用步骤。
0. 建议在沐曦镜像中编译安装。为沐曦设备编译CUDA应用需要使用工具 `cu-bridge`,沐曦的镜像中已附带了该工具,可跳过该工具安装。具体安装步骤可参考沐曦开发者文档:*曦云系列_通用计算GPU_开源社区CUDA应用迁移指南*。
1. 安装 `cuda-toolkit`。沐曦文档建议使用11.5版本测试12.4版本也可成功编译本文以11.5版本为例。
2. `cuda-toolkit` 11.5 版本 与 `stdc++-11` 及以上不匹配,需要安装 `gcc-10/g++-10` (以及对应的 `libstdc++-10`)。安装完成后使用 `update-alternatives` 设置 `gcc-10/g++-10` 为默认编译器,或通过环境变量 `CC/CXX` 指定。
3. 设置 `CUCC` 相关环境变量(假设相关工具已安装在 `/opt/maca`
```bash
export MACA_PATH=/opt/maca
export CUCC_PATH=/opt/maca/tools/cu-bridge
export PATH=$PATH:${CUCC_PATH}/tools:${CUCC_PATH}/bin
export CUDA_PATH=/usr/local/cuda # cuda-toolkit 安装路径
```
4. 编译安装 `llama.cpp`
```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggerganov/llama.cpp
cmake llama.cpp -B llama.cpp/build \
-DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-10
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-quantize llama-cli llama-gguf-split llama-mtmd-cli llama-server
cp llama.cpp/build/bin/llama-* llama.cpp
```