分类 Linux软件开发 下的文章


一、llama.cpp大模型推理框架交叉编译<推理框架和后端均为CPU>


1): 指定CPU架构

     llama.cpp-b4667/CMakeLists.txt

     添加CPU类型:

     set( CMAKE_SYSTEM_PROCESSOR   aarch64)


2): cmake   -DGGML_NATIVE=OFF     -DGGML_CPU_ARM_ARCH=armv8-a  -DBUILD_SHARED_LIBS=OFF  ../



问题:

1、如果出现如下错误:


则可以升级当前的交叉编译器,即可解决。比如用gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz,就没有这个问题.


在网上还看到有其它的方法:

ggml/src/ggml-blas/CMakeLists.txt 文件添加如下内容:

target_compile_options(${GGML_CPU_NAME} PRIVATE -flax-vector-conversions)






解决方法:

  1. 检查系统资源,确保有足够的内存和磁盘空间。

  2. 检查是否有恶意软件或安全工具在运行,如有,禁用或卸载。

  3. 检查 Git 配置文件,确保没有错误配置。

  4. 尝试增加 Git 缓存大小,使用 git config --global http.postBuffer 524288000 来增加缓存大小(例如设置为 500 MB)。

  5. 如果问题依然存在,尝试重新克隆仓库,然后再进行推送。

  6. 如果是网络问题导致的中断,检查网络连接,并确保网络稳定。

  7. 如果以上步骤无法解决问题,可以尝试重启系统后再进行操作。

#deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware 
#deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
#deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main contrib non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates main contrib non-free-firmware

# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware