@@ -56,15 +56,18 @@ jobs:
56
56
fail-fast : false
57
57
matrix :
58
58
config :
59
- - name : " Windows for x64 "
59
+ - name : " Windows (1) "
60
60
os : windows-2022
61
- artifact : " win-x64 "
62
- - name : " Windows for Arm "
61
+ artifact : " win-1 "
62
+ - name : " Windows (2) "
63
63
os : windows-2022
64
- artifact : " win-arm"
65
- - name : " Ubuntu"
64
+ artifact : " win-2"
65
+ - name : " Ubuntu (1)"
66
+ os : ubuntu-22.04
67
+ artifact : " linux-1"
68
+ - name : " Ubuntu (2)"
66
69
os : ubuntu-22.04
67
- artifact : " linux"
70
+ artifact : " linux-2 "
68
71
- name : " macOS x64"
69
72
os : macos-13
70
73
artifact : " mac-x64"
97
100
choco install cmake --version=3.31.1
98
101
choco install ninja
99
102
100
- - name : Install dependencies on Ubuntu
101
- if : matrix.config.name == 'Ubuntu'
103
+ - name : Install dependencies on Ubuntu (1)
104
+ if : matrix.config.name == 'Ubuntu (1) '
102
105
run : |
103
106
sudo apt-get update
104
107
sudo apt-get install ninja-build cmake libtbb-dev g++-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
@@ -108,25 +111,66 @@ jobs:
108
111
109
112
which arm-linux-gnueabihf-gcc
110
113
which arm-linux-gnueabihf-g++
114
+
115
+ cmake --version
116
+
117
+ - name : Install dependencies on Ubuntu (2)
118
+ if : matrix.config.name == 'Ubuntu (2)'
119
+ run : |
120
+ sudo apt-get update
121
+ sudo apt-get install ninja-build libtbb-dev
122
+
123
+ wget -c https://github.com/Kitware/CMake/releases/download/v3.31.7/cmake-3.31.7-linux-x86_64.tar.gz
124
+ sudo tar --strip-components=1 -C /usr/local -xzf cmake-3.31.7-linux-x86_64.tar.gz
125
+ rm -f ./cmake-3.31.7-linux-x86_64.tar.gz
126
+
127
+ cmake --version
111
128
112
- - name : Install Cuda on Windows for x64
113
- if : matrix.config.name == 'Windows for x64 '
129
+ - name : Install Cuda 12.4 on Windows (1)
130
+ if : matrix.config.name == 'Windows (1) '
114
131
115
132
with :
116
133
cuda : ' 12.4.0'
117
134
method : ' network'
118
135
sub-packages : ' ["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
119
136
use-local-cache : false
120
137
121
- - name : Install Cuda on Ubuntu
122
- if : matrix.config.name == 'Ubuntu'
138
+ - name : Install Cuda 13.0 on Windows (2)
139
+ if : matrix.config.name == 'Windows (2)'
140
+ shell : bash
141
+ timeout-minutes : 30
142
+ run : |
143
+ curl -Lo cuda_13.0.0_windows_network.exe https://developer.download.nvidia.com/compute/cuda/13.0.0/network_installers/cuda_13.0.0_windows_network.exe
144
+
145
+ echo "Installing Cuda 13.0.0"
146
+ powershell -Command "Start-Process -FilePath cuda_13.0.0_windows_network.exe -ArgumentList '-s','-n' -Wait"
147
+ echo "Cuda installation finished"
148
+
149
+ rm -f ./cuda_13.0.0_windows_network.exe
150
+
151
+ echo "where cudart64_13.dll: $(where cudart64_13.dll)"
152
+
153
+ echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v13.0" >> $GITHUB_ENV
154
+ echo "CUDA_PATH_V13_0=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v13.0" >> $GITHUB_ENV
155
+ echo "CUDA_PATH_VX_Y=CUDA_PATH_V13_0" >> $GITHUB_ENV
156
+ echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v13.0\\bin" >> $GITHUB_PATH
157
+
158
+ - name : Install Cuda 12.4 on Ubuntu
159
+ if : matrix.config.name == 'Ubuntu (1)'
123
160
124
161
with :
125
162
cuda : ' 12.4.0'
126
163
method : ' network'
127
164
128
- - name : Install Vulkan SDK on Windows for x64
129
- if : matrix.config.name == 'Windows for x64'
165
+ - name : Install Cuda 13.0 on Ubuntu
166
+ if : matrix.config.name == 'Ubuntu (2)'
167
+
168
+ with :
169
+ cuda : ' 13.0.0'
170
+ method : ' network'
171
+
172
+ - name : Install Vulkan SDK on Windows (1)
173
+ if : matrix.config.name == 'Windows (1)'
130
174
shell : powershell
131
175
env :
132
176
VULKAN_VERSION : 1.3.261.1
@@ -137,7 +181,7 @@ jobs:
137
181
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
138
182
139
183
- name : Install Vulkan SDK on Ubuntu
140
- if : matrix.config.name == 'Ubuntu'
184
+ if : matrix.config.name == 'Ubuntu (1) '
141
185
run : |
142
186
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
143
187
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
@@ -205,18 +249,21 @@ jobs:
205
249
}
206
250
207
251
// build binaries
208
- if (process.env.ARTIFACT_NAME === "win-x64 ") {
252
+ if (process.env.ARTIFACT_NAME === "win-1 ") {
209
253
await buildBinary("x64", ["--gpu", "false"]);
210
254
await buildBinary("x64", ["--gpu", "cuda"]);
211
255
await buildBinary("x64", ["--gpu", "vulkan"]);
212
- } else if (process.env.ARTIFACT_NAME === "win-arm ") {
256
+ } else if (process.env.ARTIFACT_NAME === "win-2 ") {
213
257
await buildBinary("arm64", ["--gpu", "false"], windowsOnArmNodeVersion);
214
- } else if (process.env.ARTIFACT_NAME === "linux") {
258
+ await buildBinary("x64", ["--gpu", "cuda"]);
259
+ } else if (process.env.ARTIFACT_NAME === "linux-1") {
215
260
await buildBinary("x64", ["--gpu", "false"]);
216
261
await buildBinary("x64", ["--gpu", "cuda"]);
217
262
await buildBinary("x64", ["--gpu", "vulkan"]);
218
263
await buildBinary("arm64", ["--gpu", "false"]);
219
264
await buildBinary("armv7l", ["--gpu", "false"]);
265
+ } else if (process.env.ARTIFACT_NAME === "linux-2") {
266
+ await buildBinary("x64", ["--gpu", "cuda"]);
220
267
} else if (process.env.ARTIFACT_NAME === "mac-x64") {
221
268
await buildBinary("x64", ["--gpu", "false"]);
222
269
} else if (process.env.ARTIFACT_NAME === "mac-arm64") {
@@ -233,6 +280,26 @@ jobs:
233
280
);
234
281
}
235
282
283
+ if (process.env.ARTIFACT_NAME === "win-2") {
284
+ await fs.move(
285
+ path.join(llamaBinsDirectoryPath, "win-x64-cuda"),
286
+ path.join(llamaBinsDirectoryPath, "win-x64-cuda-2")
287
+ );
288
+
289
+ if (!(await fs.pathExists(path.join(llamaBinsDirectoryPath, "win-x64-cuda-2", "ggml-cuda.dll")))) {
290
+ throw new Error("ggml-cuda.dll not found in win-x64-cuda-2");
291
+ }
292
+ } else if (process.env.ARTIFACT_NAME === "linux-2") {
293
+ await fs.move(
294
+ path.join(llamaBinsDirectoryPath, "linux-x64-cuda"),
295
+ path.join(llamaBinsDirectoryPath, "linux-x64-cuda-2")
296
+ );
297
+
298
+ if (!(await fs.pathExists(path.join(llamaBinsDirectoryPath, "linux-x64-cuda-2", "libggml-cuda.so")))) {
299
+ throw new Error("libggml-cuda.so not found in linux-x64-cuda-2");
300
+ }
301
+ }
302
+
236
303
await $`echo "Built binaries:"`;
237
304
await $`ls bins`;
238
305
@@ -494,6 +561,14 @@ jobs:
494
561
mv artifacts/bins-*/* bins/
495
562
mv artifacts/build dist/
496
563
564
+ mkdir -p ./bins/win-x64-cuda/fallback
565
+ mv ./bins/win-x64-cuda-2/ggml-cuda.dll ./bins/win-x64-cuda/fallback/ggml-cuda.dll
566
+ rm -rf ./bins/win-x64-cuda-2
567
+
568
+ mkdir -p ./bins/linux-x64-cuda/fallback
569
+ mv ./bins/linux-x64-cuda-2/libggml-cuda.so ./bins/linux-x64-cuda/fallback/libggml-cuda.so
570
+ rm -rf ./bins/linux-x64-cuda-2
571
+
497
572
cp -r artifacts/llama.cpp/llama.cpp/grammars llama/grammars
498
573
499
574
rm -f ./llama/binariesGithubRelease.json
0 commit comments