Implementation:Ggml org Llama cpp CI Run
| Knowledge Sources | |
|---|---|
| Domains | CI, Testing |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Main CI test runner script that builds llama.cpp with various hardware backends and runs the full test suite.
Description
This shell script is the central CI automation entry point for llama.cpp. It accepts output and mount directories as arguments, configures CMake build flags based on environment variables for different hardware backends (CUDA, SYCL, Vulkan, ROCm, Metal, WebGPU, MUSA, KleidiAI), builds the project, and runs tests. For CUDA builds, it auto-detects GPU architecture via nvidia-smi. Results including logs and exit codes are written to the output directory.
Usage
Used by self-hosted CI runners and for local pre-submission testing by contributors. Set the appropriate GG_BUILD_* environment variables to enable specific hardware backend builds.
Code Reference
Source Location
- Repository: Ggml_org_Llama_cpp
- File: ci/run.sh
- Lines: 1-709
Signature
#!/usr/bin/env bash
# usage: ci/run.sh <output-dir> <mnt-dir>
# Environment variables:
# GG_BUILD_CUDA=1 - Enable CUDA backend
# GG_BUILD_SYCL=1 - Enable SYCL backend
# GG_BUILD_VULKAN=1 - Enable Vulkan backend
# GG_BUILD_ROCM=1 - Enable ROCm/HIP backend
# GG_BUILD_METAL=1 - Enable Metal backend
# GG_BUILD_WEBGPU=1 - Enable WebGPU backend
# GG_BUILD_MUSA=1 - Enable MUSA backend
# GG_BUILD_KLEIDIAI=1 - Enable KleidiAI backend
Import
# CPU-only build
bash ./ci/run.sh ./tmp/results ./tmp/mnt
# With CUDA support
GG_BUILD_CUDA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| output-dir | path (arg $1) | Yes | Directory where build logs and exit codes are written |
| mnt-dir | path (arg $2) | Yes | Mount directory for test data and temporary files |
| GG_BUILD_CUDA | env var | No | Set to 1 to enable CUDA backend build |
| GG_BUILD_SYCL | env var | No | Set to 1 to enable SYCL backend build |
| GG_BUILD_VULKAN | env var | No | Set to 1 to enable Vulkan backend build |
| GG_BUILD_ROCM | env var | No | Set to 1 to enable ROCm/HIP backend build |
| GG_BUILD_METAL | env var | No | Set to 1 to enable Metal backend build |
| GG_BUILD_AMDGPU_TARGETS | env var | No | GPU architecture for ROCm builds (e.g., gfx90a, gfx1100) |
Outputs
| Name | Type | Description |
|---|---|---|
| *.log | file | Build and test logs for each test step |
| *.exit | file | Exit code files indicating pass/fail for each test step |
| *.md | file | Markdown formatted test result summaries |
Usage Examples
# Create output directories
mkdir -p tmp/results tmp/mnt
# Run CPU-only CI build and tests
bash ./ci/run.sh ./tmp/results ./tmp/mnt
# Run with CUDA support (auto-detects GPU architecture)
GG_BUILD_CUDA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
# Run with Vulkan support
GG_BUILD_VULKAN=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt