Skip to content

Commit bc1db6a

Browse files
committed
Enable pre-built cuda releases on ubuntu
1 parent be48528 commit bc1db6a

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,87 @@ jobs:
240240
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip
241241
name: llama-bin-ubuntu-vulkan-x64.zip
242242

243+
ubuntu-22-cuda:
244+
runs-on: ubuntu-22.04
245+
246+
strategy:
247+
matrix:
248+
cuda: ['11.7',"12.4"]
249+
250+
steps:
251+
- name: Clone
252+
id: checkout
253+
uses: actions/checkout@v4
254+
with:
255+
fetch-depth: 0
256+
257+
- name: ccache
258+
uses: hendrikmuhs/[email protected]
259+
with:
260+
key: ubuntu-22-cmake-cuda-${{ matrix.cuda }}
261+
evict-old-files: 1d
262+
263+
- name: Free up disk space
264+
uses: jlumbroso/free-disk-space@main
265+
with:
266+
android: true
267+
dotnet: true
268+
269+
- name: Dependencies
270+
id: depends
271+
run: |
272+
sudo apt-get update
273+
sudo apt-get install build-essential libcurl4-openssl-dev
274+
275+
- name: Install CUDA Toolkit
276+
uses: Jimver/[email protected]
277+
with:
278+
cuda: ${{ matrix.cuda }}
279+
280+
- name: Build
281+
id: cmake_build
282+
run: |
283+
cmake -B build \
284+
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
285+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
286+
-DGGML_BACKEND_DL=ON \
287+
-DGGML_NATIVE=OFF \
288+
-DGGML_CPU_ALL_VARIANTS=ON \
289+
-DGGML_CUDA=ON \
290+
${{ env.CMAKE_ARGS }}
291+
cmake --build build --config Release -j $(nproc)
292+
293+
- name: Determine tag name
294+
id: tag
295+
uses: ./.github/actions/get-tag-name
296+
297+
- name: Pack artifacts
298+
id: pack_artifacts
299+
run: |
300+
cp LICENSE ./build/bin/
301+
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip ./build/bin/*
302+
303+
- name: Upload artifacts
304+
uses: actions/upload-artifact@v4
305+
with:
306+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip
307+
name: llama-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip
308+
309+
- name: Pack CUDA runtime
310+
id: pack_cuda_runtime
311+
run: |
312+
mkdir -p build/cuda-runtime
313+
cp /usr/local/cuda/lib64/libcudart.so* build/cuda-runtime
314+
cp /usr/local/cuda/lib64/libcublas.so* build/cuda-runtime
315+
cp /usr/local/cuda/lib64/libcublasLt.so* build/cuda-runtime
316+
zip -r cudart-llama-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip build/cuda-runtime/*
317+
318+
- name: Upload CUDA runtime
319+
uses: actions/upload-artifact@v4
320+
with:
321+
path: cudart-llama-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip
322+
name: cudart-llama-bin-ubuntu-cuda-${{ matrix.cuda }}-x64.zip
323+
243324
windows-cpu:
244325
runs-on: windows-2025
245326

@@ -666,6 +747,7 @@ jobs:
666747
- windows-hip
667748
- ubuntu-22-cpu
668749
- ubuntu-22-vulkan
750+
- ubuntu-22-cuda
669751
- macOS-arm64
670752
- macOS-x64
671753
- ios-xcode-build

0 commit comments

Comments
 (0)