@@ -135,6 +135,69 @@ jobs:
135135 cd build
136136 ctest -L main --verbose --timeout 900
137137
138+ macOS-latest-cmake-arm64-webgpu :
139+ runs-on : macos-14
140+
141+ steps :
142+ - name : Clone
143+ id : checkout
144+ uses : actions/checkout@v4
145+
146+ - name : ccache
147+ uses :
hendrikmuhs/[email protected] 148+ with :
149+ key : macOS-latest-cmake-arm64-webgpu
150+ evict-old-files : 1d
151+
152+ - name : Dependencies
153+ id : depends
154+ continue-on-error : true
155+ run : |
156+ brew update
157+ brew install curl
158+
159+ - name : Dawn Dependency
160+ id : dawn-depends
161+ run : |
162+ ARTIFACTS_JSON=$(curl -s -L \
163+ -H "Accept: application/vnd.github+json" \
164+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
165+ -H "X-GitHub-Api-Version: 2022-11-28" \
166+ "https://api.github.com/repos/google/dawn/actions/artifacts")
167+ echo "Finding latest macos-latest-Release artifact..."
168+ DOWNLOAD_URL=$(echo "$ARTIFACTS_JSON" | jq -r '.artifacts
169+ | sort_by(.created_at)
170+ | reverse
171+ | map(select(.name | test("macos-latest-Release$")))
172+ | .[0].archive_download_url')
173+ if [ "$DOWNLOAD_URL" = "null" ] || [ -z "$DOWNLOAD_URL" ]; then
174+ echo "No suitable Dawn artifact found!"
175+ exit 1
176+ fi
177+ echo "Downloading from: $DOWNLOAD_URL"
178+ curl -L \
179+ -H "Accept: application/vnd.github+json" \
180+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
181+ -o artifact.zip "$DOWNLOAD_URL"
182+ unzip artifact.zip
183+ mkdir dawn
184+ tar_file=$(find . -name '*.tar.gz' | head -n 1)
185+ echo "Extracting: $tar_file"
186+ tar -xvf "$tar_file" -C dawn --strip-components=1
187+
188+ - name : Build
189+ id : cmake_build
190+ run : |
191+ export CMAKE_PREFIX_PATH=dawn
192+ cmake -B build -DGGML_WEBGPU=ON -DGGML_METAL=OFF -DGGML_BLAS=OFF
193+ cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
194+
195+ - name : Test
196+ id : cmake_test
197+ run : |
198+ cd build
199+ ctest -L main --verbose --timeout 900
200+
138201 ubuntu-cpu-cmake :
139202 strategy :
140203 matrix :
@@ -344,6 +407,72 @@ jobs:
344407 # This is using llvmpipe and runs slower than other backends
345408 ctest -L main --verbose --timeout 4200
346409
410+ ubuntu-22-cmake-webgpu :
411+ runs-on : ubuntu-22.04
412+
413+ steps :
414+ - name : Clone
415+ id : checkout
416+ uses : actions/checkout@v4
417+
418+ - name : ccache
419+ uses :
hendrikmuhs/[email protected] 420+ with :
421+ key : ubuntu-22-cmake-webgpu
422+ evict-old-files : 1d
423+
424+ - name : Vulkan SDK Dependencies
425+ id : vulkan-depends
426+ run : |
427+ wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
428+ sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
429+ sudo apt-get update -y
430+ sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev
431+
432+ - name : Dawn Dependency
433+ id : dawn-depends
434+ run : |
435+ sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev libxi-dev
436+ ARTIFACTS_JSON=$(curl -s -L \
437+ -H "Accept: application/vnd.github+json" \
438+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
439+ -H "X-GitHub-Api-Version: 2022-11-28" \
440+ "https://api.github.com/repos/google/dawn/actions/artifacts")
441+ echo "Finding latest ubuntu-latest-Release artifact..."
442+ DOWNLOAD_URL=$(echo "$ARTIFACTS_JSON" | jq -r '.artifacts
443+ | sort_by(.created_at)
444+ | reverse
445+ | map(select(.name | test("ubuntu-latest-Release$")))
446+ | .[0].archive_download_url')
447+ if [ "$DOWNLOAD_URL" = "null" ] || [ -z "$DOWNLOAD_URL" ]; then
448+ echo "No suitable Dawn artifact found!"
449+ exit 1
450+ fi
451+ echo "Downloading from: $DOWNLOAD_URL"
452+ curl -L \
453+ -H "Accept: application/vnd.github+json" \
454+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
455+ -o artifact.zip "$DOWNLOAD_URL"
456+ unzip artifact.zip
457+ mkdir dawn
458+ tar_file=$(find . -name '*.tar.gz' | head -n 1)
459+ echo "Extracting: $tar_file"
460+ tar -xvf "$tar_file" -C dawn --strip-components=1
461+
462+ - name : Build
463+ id : cmake_build
464+ run : |
465+ export Dawn_DIR=dawn/lib64/cmake/Dawn
466+ cmake -B build -DGGML_WEBGPU=ON
467+ cmake --build build --config Release -j $(nproc)
468+
469+ - name : Test
470+ id : cmake_test
471+ run : |
472+ cd build
473+ # This is using llvmpipe and runs slower than other backends
474+ ctest -L main --verbose --timeout 3600
475+
347476 ubuntu-22-cmake-hip :
348477 runs-on : ubuntu-22.04
349478 container : rocm/dev-ubuntu-22.04:6.0.2
0 commit comments