diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ab1892..c114a25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -652,6 +652,82 @@ jobs: name: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-cpu-arm64.tar.gz archive: false + build-trixie-opencl-arm64: + needs: check-version + if: ${{ needs.check-version.outputs.llama-tag != needs.check-version.outputs.current-tag }} + runs-on: ubuntu-24.04-arm + steps: + - name: Check out the repo + uses: actions/checkout@v6 + - name: Checkout llama.cpp repo + uses: actions/checkout@v6 + with: + repository: ggml-org/llama.cpp + path: llama.cpp + ref: ${{ needs.check-version.outputs.llama-tag }} + fetch-tags: 'true' + - name: Install dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y build-essential ninja-build libgomp1 git libssl-dev libcurl4-openssl-dev zip libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev wget libgmp-dev libmpfr-dev libmpc-dev \ + ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers + - name: Cache GCC 14.3.0 + uses: actions/cache@v5 + id: cache-gcc-trixie-opencl + with: + path: ./gcc-14.3.0 + key: gcc-14.3.0-arm64-opencl-ubuntu24.04-v1 + - name: Build GCC 14.3.0 + if: steps.cache-gcc-trixie-opencl.outputs.cache-hit != 'true' + run: | + mkdir -p gcc-install + cd gcc-install + wget https://ftp.gnu.org/gnu/gcc/gcc-14.3.0/gcc-14.3.0.tar.gz + tar -xf gcc-14.3.0.tar.gz + cd gcc-14.3.0 + ./configure -v --build=$(uname -m)-linux-gnu --host=$(uname -m)-linux-gnu --target=$(uname -m)-linux-gnu --prefix=$GITHUB_WORKSPACE/gcc-14.3.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-14 + make -j $(nproc) + sudo make install + cd ../.. + rm -rf gcc-install + - name: Add GCC to PATH + run: | + echo "$GITHUB_WORKSPACE/gcc-14.3.0/bin" >> $GITHUB_PATH + - name: Setup cmake 4.2.0 + run: | + mkdir -p ./cmake-4.2.0 + cd ./cmake-4.2.0 + wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v4.2.0/cmake-4.2.0-linux-aarch64.sh + sudo sh cmake.sh --prefix=/usr/local --skip-license + cd .. + rm -rf cmake-4.2.0 + - name: Build arm64 + working-directory: llama.cpp + run: | + export CC=$GITHUB_WORKSPACE/gcc-14.3.0/bin/gcc-14 + export CXX=$GITHUB_WORKSPACE/gcc-14.3.0/bin/g++-14 + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/gcc-14.3.0/lib64:$LD_LIBRARY_PATH + cmake -S . -B build -G Ninja \ + -DCMAKE_INSTALL_RPATH='$ORIGIN' \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--allow-shlib-undefined" \ + -DGGML_NATIVE=OFF \ + -DGGML_CPU_ALL_VARIANTS=ON \ + -DGGML_BACKEND_DL=ON \ + -DGGML_OPENCL=ON + cmake --build build --config Release -j $(nproc) + - name: Pack artifacts + run: | + tar -czvf llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-opencl-arm64.tar.gz --transform "s,./,llama-${{ needs.check-version.outputs.llama-tag }}/," -C ./llama.cpp/build/bin . + - name: Upload release binaries + uses: actions/upload-artifact@v7 + with: + path: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-opencl-arm64.tar.gz + name: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-opencl-arm64.tar.gz + archive: false + release: needs: - check-version @@ -663,6 +739,7 @@ jobs: - build-trixie-vulkan-arm64 - build-cpu-arm64 - build-trixie-cpu-arm64 + - build-trixie-opencl-arm64 runs-on: ubuntu-latest steps: - name: Check out the repo @@ -723,6 +800,13 @@ jobs: artifact-name: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-cpu-arm64.tar.gz destination: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-cpu-arm64.tar.gz token: ${{ secrets.GITHUB_TOKEN }} + - name: Download arm64 trixie OpenCL artifact + uses: ./.github/actions/download-artifact + with: + run-id: ${{ github.run_id }} + artifact-name: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-opencl-arm64.tar.gz + destination: llama-${{ needs.check-version.outputs.llama-tag }}-bin-ubuntu-trixie-opencl-arm64.tar.gz + token: ${{ secrets.GITHUB_TOKEN }} - name: Create final release uses: ncipollo/release-action@v1 with: