Skip to content

Commit aa929cb

Browse files
committed
Add opencl-intel builds
1 parent affb1a5 commit aa929cb

File tree

4 files changed

+164
-0
lines changed

4 files changed

+164
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update \
4+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y libgomp1 openssl curl intel-opencl-icd clinfo python3 python3-pip \
5+
&& apt autoremove -y \
6+
&& apt clean -y \
7+
&& rm -rf /tmp/* /var/tmp/* \
8+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
9+
&& find /var/cache -type f -delete
10+
11+
COPY --chown=0:0 . /app
12+
13+
WORKDIR /app
14+
15+
RUN pip install --user --break-system-packages --no-cache-dir --upgrade pip setuptools wheel \
16+
&& pip install --user --break-system-packages --no-cache-dir -r requirements.txt
17+
18+
ENTRYPOINT ["/app/tools.sh"]
19+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update \
4+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y libgomp1 openssl curl intel-opencl-icd clinfo \
5+
&& apt autoremove -y \
6+
&& apt clean -y \
7+
&& rm -rf /tmp/* /var/tmp/* \
8+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
9+
&& find /var/cache -type f -delete
10+
11+
COPY --chown=0:0 . /app
12+
13+
ENV PATH="$PATH:/app"
14+
15+
CMD ["/bin/bash"]
16+

.github/workflows/build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: build
2+
3+
on:
4+
# Build file modifications
5+
push:
6+
branches: [ 'master' ]
7+
paths: [ '.github/workflows/build.yml', '.devops/**' ]
8+
#pull_request:
9+
# branches: [ 'master' ]
10+
11+
# Daily rebuild
12+
schedule:
13+
- cron: "0 4 * * *"
14+
15+
# Manual rebuild, in case of some important upstream change
16+
workflow_dispatch:
17+
18+
jobs:
19+
opencl-intel:
20+
runs-on: ubuntu-24.04
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Checkout llama.cpp
27+
uses: actions/checkout@v4
28+
with:
29+
repository: ggml-org/llama.cpp
30+
path: llama.cpp
31+
32+
- name: Install build deps
33+
run: '
34+
sudo apt-get update
35+
36+
#sudo apt-get install -y build-essential cmake git rustc cargo
37+
38+
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y libssl-dev libcurl4-openssl-dev ocl-icd-opencl-dev
39+
'
40+
41+
- name: CMake
42+
run: "
43+
cmake llama.cpp -B llama.cpp/build
44+
-DCMAKE_BUILD_TYPE=Release
45+
-DCMAKE_INSTALL_RPATH='$ORIGIN'
46+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
47+
-DGGML_BACKEND_DL=ON
48+
-DGGML_CPU_ALL_VARIANTS=ON
49+
-DGGML_RPC=ON
50+
-DGGML_OPENCL=ON
51+
-DGGML_OPENCL_USE_ADRENO_KERNELS=OFF
52+
-DGGML_CCACHE=OFF
53+
-DGGML_OPENMP=OFF
54+
-DLLAMA_BUILD_TESTS=OFF
55+
-DLLAMA_BUILD_EXAMPLES=OFF
56+
-DLLAMA_BUILD_TOOLS=ON
57+
-DLLAMA_BUILD_SERVER=ON
58+
-DLLAMA_CURL=ON
59+
-DLLAMA_LLGUIDANCE=ON
60+
-DLLAMA_SERVER_SSL=ON
61+
62+
cmake --build llama.cpp/build
63+
-j $(nproc)
64+
65+
find llama.cpp/build/bin -type f -executable -exec strip {} \\;
66+
"
67+
68+
- name: Build and push Docker image (tools)
69+
uses: macbre/push-to-ghcr@v13
70+
with:
71+
dockerfile: .devops/tools-opencl-intel.Dockerfile
72+
context: llama.cpp/build/bin
73+
image_name: ${{ github.repository }}
74+
image_tag: tools-opencl-intel
75+
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
76+
77+
- name: Copy additional contents
78+
if: false
79+
run: '
80+
mkdir llama.cpp/build/python
81+
82+
cp -r -t llama.cpp/build/bin
83+
llama.cpp/*.py
84+
llama.cpp/gguf-py
85+
llama.cpp/requirements
86+
llama.cpp/requirements.txt
87+
llama.cpp/.devops/tools.sh
88+
'
89+
90+
- name: Build and push Docker image (full)
91+
if: false
92+
uses: macbre/push-to-ghcr@v13
93+
with:
94+
dockerfile: .devops/full-opencl-intel.Dockerfile
95+
context: llama.cpp/build/bin
96+
image_name: ${{ github.repository }}
97+
image_tag: tools-opencl-intel
98+
github_token: ${{ secrets.GHCR_ACCESS_TOKEN }}
99+

.github/workflows/cleanup.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: cleanup
2+
3+
on:
4+
# Weekly cleanup
5+
schedule:
6+
- cron: "30 4 * * 3"
7+
8+
# Manual cleanup
9+
workflow_dispatch:
10+
11+
jobs:
12+
ghcr:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Get repository name
17+
run: |
18+
REPOSITORY_NAME="${{ github.repository }}"
19+
REPOSITORY_NAME="${REPOSITORY_NAME##*/}"
20+
echo "Repository name is: $REPOSITORY_NAME"
21+
echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV
22+
23+
- name: Delete untagged Docker images
24+
uses: Chizkiyahu/delete-untagged-ghcr-action@v4
25+
with:
26+
token: ${{ secrets.GHCR_ACCESS_TOKEN }}
27+
owner_type: user
28+
package_name: ${{ env.REPOSITORY_NAME }}
29+
untagged_only: true
30+

0 commit comments

Comments
 (0)