Skip to content

Commit b0e0366

Browse files
authored
Merge pull request #328 from janhq/ci/add-build-linux-cuda13-ubuntu2404
ci: test build linux cuda13 ubuntu2204
2 parents 8d52430 + 1ec0f7b commit b0e0366

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Use NVIDIA CUDA 13.0.2 development image with Ubuntu 22.04 as the base
2+
FROM nvidia/cuda:13.0.2-devel-ubuntu22.04
3+
# Docker and Docker Compose arguments
4+
5+
# Use 1001 and 121 for compatibility with GitHub-hosted runners
6+
ARG RUNNER_UID=1000
7+
ARG DOCKER_GID=1001
8+
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
# Install necessary packages
12+
RUN apt-get update -y \
13+
&& apt-get install -y software-properties-common \
14+
&& add-apt-repository -y ppa:git-core/ppa \
15+
&& apt-get update -y \
16+
&& apt-get install -y --no-install-recommends \
17+
build-essential \
18+
curl \
19+
ca-certificates \
20+
dnsutils \
21+
ftp \
22+
git \
23+
uuid-dev \
24+
iproute2 \
25+
iputils-ping \
26+
jq \
27+
libunwind8 \
28+
locales \
29+
netcat \
30+
openssh-client \
31+
parallel \
32+
python3-pip \
33+
rsync \
34+
shellcheck \
35+
sudo \
36+
telnet \
37+
time \
38+
tzdata \
39+
unzip \
40+
upx \
41+
wget \
42+
lsb-release \
43+
openssl \
44+
libssl-dev \
45+
manpages-dev \
46+
zip \
47+
zstd \
48+
pkg-config \
49+
ccache \
50+
gcc \
51+
g++ \
52+
&& ln -sf /usr/bin/python3 /usr/bin/python \
53+
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
54+
&& rm -rf /var/lib/apt/lists/*
55+
56+
# Add Kitware's APT repository for CMake
57+
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
58+
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
59+
apt-get update && \
60+
apt-get install -y cmake
61+
62+
# Download latest git-lfs version
63+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
64+
apt-get install -y --no-install-recommends git-lfs
65+
66+
RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
67+
&& groupadd docker --gid $DOCKER_GID \
68+
&& usermod -aG sudo runner \
69+
&& usermod -aG docker runner \
70+
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
71+
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
72+
73+
ENV HOME=/home/runner
74+
75+
ARG RUNNER_VERSION=2.328.0
76+
77+
# cd into the user directory, download and unzip the github actions runner
78+
RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
79+
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
80+
&& tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz
81+
82+
RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh
83+
84+
ADD --chown=runner:runner ./start.sh /home/runner/start.sh
85+
86+
RUN chmod 755 /home/runner/start.sh
87+
88+
# Add /usr/local/cuda-11.7/compat to LD_LIBRARY_PATH
89+
ENV LD_LIBRARY_PATH=/usr/local/cuda-13.0/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
90+
91+
ENTRYPOINT ["/bin/bash", "/home/runner/start.sh"]
92+
93+
USER runner

.github/workflows/menlo-build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ jobs:
8686
vulkan: false
8787
ccache: true
8888
ccache-dir: "/home/runner/.ccache"
89+
- os: "linux"
90+
name: "cuda-13-common_cpus-x64"
91+
runs-on: "ubuntu-22-04-cuda-13-0"
92+
cmake-flags: "-DLLAMA_CURL=OFF -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES='75;80;86;87;89;120;121' -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
93+
run-e2e: false
94+
vulkan: false
95+
ccache: true
96+
ccache-dir: "/home/runner/.ccache"
8997
- os: "linux"
9098
name: "vulkan-common_cpus-x64"
9199
runs-on: "ubuntu-22-04"
@@ -581,6 +589,7 @@ jobs:
581589
steps:
582590
- name: Download cuda dependencies from s3 and create checksum
583591
run: |
592+
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/13.0/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz
584593
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/12.0/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz
585594
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/11.7/linux/cuda.tar.gz -O /tmp/cudart-llama-bin-linux-cu11.7-x64.tar.gz
586595
wget https://minio.menlo.ai:9000/cicd/dist/cuda-dependencies/12.0/windows/cuda.tar.gz -O /tmp/cudart-llama-bin-win-cu12.0-x64.tar.gz
@@ -601,6 +610,11 @@ jobs:
601610
"- url: llama-\($version)-\($key).tar.gz\n sha512: >-\n \($sha512[$key])\n size: \($size[$key])"
602611
' >> checksum.yml
603612
613+
echo "- url: cudart-llama-bin-linux-cu13.0-x64.tar.gz" >> checksum.yml
614+
echo " sha512: >-" >> checksum.yml
615+
echo " $(sha512sum /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
616+
echo " size: $(stat -c%s /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz)" >> checksum.yml
617+
604618
echo "- url: cudart-llama-bin-linux-cu12.0-x64.tar.gz" >> checksum.yml
605619
echo " sha512: >-" >> checksum.yml
606620
echo " $(sha512sum /tmp/cudart-llama-bin-linux-cu12.0-x64.tar.gz | awk '{ print $1 }')" >> checksum.yml
@@ -633,6 +647,17 @@ jobs:
633647
asset_name: checksum.yml
634648
asset_content_type: text/yaml
635649

650+
- name: upload cudart-llama-bin-linux-cu13.0-x64.tar.gz to Github Release
651+
uses: actions/upload-release-asset@v1
652+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
653+
env:
654+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
655+
with:
656+
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
657+
asset_path: /tmp/cudart-llama-bin-linux-cu13.0-x64.tar.gz
658+
asset_name: cudart-llama-bin-linux-cu13.0-x64.tar.gz
659+
asset_content_type: application/gzip
660+
636661
- name: upload cudart-llama-bin-linux-cu12.0-x64.tar.gz to Github Release
637662
uses: actions/upload-release-asset@v1
638663
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)