Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1# Snapdragon-based Linux devices2 3## Docker Setup4 5The easiest way to build llama.cpp for a Snapdragon-based Linux device is using the toolchain Docker image (see [github.com/snapdragon-toolchain](https://github.com/snapdragon-toolchain)).6This image includes OpenCL SDK, Hexagon SDK, CMake, and the ARM64 Linux cross-compilation toolchain.7 8Cross-compilation is supported on **Linux X86** hosts. The resulting binaries are deployed to and run on the target **Qualcomm Snapdragon ARM64 Linux** device.9 10```11~/src/llama.cpp$ docker run -it -u $(id -u):$(id -g) --volume $(pwd):/workspace --platform linux/amd64 ghcr.io/snapdragon-toolchain/arm64-linux:v0.112[d]/> cd /workspace13```14 15Note: The rest of the **Linux** build process assumes that you're running inside the toolchain container.16 17 18## How to Build19 20Let's build llama.cpp with CPU, OpenCL, and Hexagon backends via CMake presets:21 22```23[d]/workspace> cp docs/backend/snapdragon/CMakeUserPresets.json .24 25[d]/workspace> cmake --preset arm64-linux-snapdragon-release -B build-snapdragon26 27[d]/workspace> cmake --build build-snapdragon -j $(nproc)28```29 30To generate an installable "package" simply use cmake --install, then zip it:31 32```33[d]/workspace> cmake --install build-snapdragon --prefix pkg-snapdragon34[d]/workspace> zip -r pkg-snapdragon.zip pkg-snapdragon35```36 37## How to Install38 39For this step, you will deploy the built binaries and libraries to the target Linux device. Transfer `pkg-snapdragon.zip` to the target device, then unzip it and set up the environment variables:40 41```42$ unzip pkg-snapdragon.zip43$ cd pkg-snapdragon44$ export LD_LIBRARY_PATH=./lib45$ export ADSP_LIBRARY_PATH=./lib46```47 48At this point, you should also download some models onto the device:49 50```51$ wget https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_0.gguf52```53 54## How to Run55Next, since we have setup the environment variables, we can run the llama-cli with the Hexagon backends:56```57$ ./bin/llama-cli -m Llama-3.2-3B-Instruct-Q4_0.gguf --device HTP0 -ngl 99 -p "what is the most popular cookie in the world?"58```59 