name: CI (vulkan) on: workflow_dispatch: # allows manual triggering push: branches: - master paths: [ '.github/workflows/build-vulkan.yml', '**/CMakeLists.txt', '**/.cmake', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.comp', '**/*.glsl' ] pull_request: types: [opened, synchronize, reopened] paths: [ '.github/workflows/build-vulkan.yml', 'ggml/src/ggml-vulkan/**' ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} cancel-in-progress: true env: GGML_NLOOP: 3 GGML_N_THREADS: 1 LLAMA_ARG_LOG_COLORS: 1 LLAMA_ARG_LOG_PREFIX: 1 LLAMA_ARG_LOG_TIMESTAMPS: 1 jobs: ubuntu-arm64: runs-on: ubuntu-24.04-arm steps: - name: Clone id: checkout uses: actions/checkout@v6 - name: Dependencies id: depends run: | sudo apt-get update sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build echo "CC=gcc-14" >> "$GITHUB_ENV" echo "CXX=g++-14" >> "$GITHUB_ENV" - name: ccache uses: ggml-org/ccache-action@v1.2.21 with: key: vulkan-ubuntu-24.04-arm variant: ccache evict-old-files: 1d save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Configure id: cmake_configure run: | cmake -B build \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=Release \ -DGGML_VULKAN=ON - name: Build id: cmake_build run: | time cmake --build build -j $(nproc) - name: ccache-clear uses: ./.github/actions/ccache-clear env: GH_TOKEN: ${{ github.token }} with: key: vulkan-ubuntu-24.04-arm older: 5m min: 1 dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }} ubuntu-llvmpipe: runs-on: ubuntu-24.04 steps: - name: Clone id: checkout uses: actions/checkout@v6 - name: Dependencies id: depends run: | sudo add-apt-repository -y ppa:kisak/kisak-mesa sudo apt-get update -y sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev - name: Get latest Vulkan SDK version id: vulkan_sdk_version run: | echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" - name: Setup Vulkan SDK id: setup uses: ./.github/actions/unarchive-tar with: url: https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkan_sdk.tar.xz path: ./vulkan_sdk strip: 1 - name: ccache uses: ggml-org/ccache-action@v1.2.21 with: key: vulkan-ubuntu-24.04-llvmpipe evict-old-files: 1d save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Build id: cmake_build run: | source ./vulkan_sdk/setup-env.sh cmake -B build \ -DGGML_NATIVE=OFF \ -DGGML_VULKAN=ON cmake --build build --config Release -j $(nproc) - name: Test id: cmake_test run: | cd build export GGML_VK_VISIBLE_DEVICES=0 export GGML_VK_DISABLE_F16=1 export GGML_VK_DISABLE_COOPMAT=1 # This is using llvmpipe and runs slower than other backends # test-backend-ops is too slow on llvmpipe, skip it ctest -L main -E test-backend-ops --verbose --timeout 900 - name: ccache-clear uses: ./.github/actions/ccache-clear env: GH_TOKEN: ${{ github.token }} with: key: vulkan-ubuntu-24.04-llvmpipe older: 5m min: 1 dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }} windows: runs-on: windows-2025 env: VULKAN_VERSION: 1.4.357.0 steps: - name: Clone id: checkout uses: actions/checkout@v6 - name: ccache uses: ggml-org/ccache-action@v1.2.21 with: key: cpu-windows-2025-x64-vulkan variant: ccache evict-old-files: 1d save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - name: Install Vulkan SDK id: get_vulkan run: | curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe" & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}" Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin" - name: Install Ninja id: install_ninja run: | choco install ninja - name: Build id: cmake_build run: | cmake -S . -B build -G "Ninja Multi-Config" ` -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake ` -DCMAKE_BUILD_TYPE=Release ` -DGGML_NATIVE=OFF ` -DLLAMA_BUILD_SERVER=ON ` -DGGML_RPC=ON ` -DGGML_BACKEND_DL=ON ` -DGGML_CPU_ALL_VARIANTS=ON ` -DGGML_VULKAN=ON ` -DLLAMA_BUILD_BORINGSSL=ON cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} - name: Test id: cmake_test run: | cd build ctest -L main -C Release --verbose --timeout 900 - name: ccache-clear uses: ./.github/actions/ccache-clear env: GH_TOKEN: ${{ github.token }} with: key: cpu-windows-2025-x64-vulkan older: 5m min: 1 dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}