Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #61 from spacemeshos/add-linux-arm64-ci
Browse files Browse the repository at this point in the history
Add linux arm64 CI
  • Loading branch information
avive authored Nov 5, 2021
2 parents 5ce4318 + 25b1645 commit 84857d4
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/tools/linux-arm64-install-cuda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

if [ -z "${CUDA}" ]; then
echo "CUDA variable empty"
exit 1
fi

OS=$(lsb_release -r | cut -f 2 | tr -d .)
sudo wget -qO /etc/apt/preferences.d/cuda-repository-pin-600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${OS}/sbsa/cuda-ubuntu${OS}.pin
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu${OS}/sbsa/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu${OS}/sbsa/ /"

sudo apt update
sudo apt install -y cuda-toolkit-${CUDA/./-}
15 changes: 15 additions & 0 deletions .github/tools/linux-arm64-install-vulkan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

OS=$(lsb_release -c | cut -f 2)

sudo apt update

sudo apt install libvulkan-dev
sudo apt install glslang-dev
sudo apt install spirv-tools
sudo apt remove libllvm12

VULKAN_VERSION=$(dpkg -s vulkan-sdk | awk '/^Version:/ {split($2, a, /\./); printf "%d.%d.%d", a[1], a[2], a[3]}')
echo "VULKAN_VERSION=$VULKAN_VERSION" >> $GITHUB_ENV
59 changes: 57 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
path: ${{ env.VULKAN_ROOT_LOCATION }}/macOS/lib/libvulkan.1.dylib

macos-m1:
runs-on: self-hosted
runs-on: [self-hosted, macos]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -307,9 +307,60 @@ jobs:
name: macos-m1
path: ${{ env.VULKAN_ROOT_LOCATION }}/macOS/lib/libvulkan.1.dylib

linux-arm64:
runs-on: [self-hosted, linux]

steps:
- uses: actions/checkout@v2
with:
submodules: true

- run: cmake -DSPACEMESH_ARCH_ARM64=ON .

- run: make

- name: Copy library
run: cp src/libgpu-setup.so test/libgpu-setup.so

- name: Unit tests - Golden vectors
run: test/gpu-setup-test --test-vector-check

- name: Unit tests - hash and bitstream
run: test/gpu-setup-test --unit-tests

- name: Unit tests - PoW
run: test/gpu-setup-test -tp -d 18 -id 0xe26b543725490682675f6f84ea7689601adeaf14caa7024ec1140c82754ca339 --salt 0x165310acce39719148915c356f25c5cb78e82203222cccdf3c15a9c3684e08cb -si 126202

- name: Unit tests - label lengths
run: test/gpu-setup-test -il

- name: Unit tests - labels count
run: test/gpu-setup-test -in

- name: Integration tests - concurrency test
run: test/gpu-setup-test -ip

- name: Integration tests - cancelation test
run: test/gpu-setup-test -ic

- uses: actions/upload-artifact@v2
with:
name: linux-arm64
path: src/libgpu-setup.so

- uses: actions/upload-artifact@v2
with:
name: linux-arm64
path: test/gpu-setup-test

- uses: actions/upload-artifact@v2
with:
name: linux-arm64
path: include/api.h

release:
runs-on: ubuntu-latest
needs: [linux, windows, macos, macos-m1]
needs: [linux, windows, macos, macos-m1, linux-arm64]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -360,6 +411,9 @@ jobs:
- name: Archive MacOS-M1 Library
run: zip --junk-paths libgpu-setup-macos-m1-${{ env.VERSION }}.zip macos-m1/*

- name: Archive Linux ARM64 Library
run: zip --junk-paths libgpu-setup-linux-arm64-${{ env.VERSION }}.zip linux-arm64/*

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -369,5 +423,6 @@ jobs:
libgpu-setup-windows-${{ env.VERSION }}.zip
libgpu-setup-macos-${{ env.VERSION }}.zip
libgpu-setup-macos-m1-${{ env.VERSION }}.zip
libgpu-setup-linux-arm64-${{ env.VERSION }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion src/vulkan/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ if(WIN32)
elseif(APPLE)
target_link_libraries(shaders-gen -L$ENV{VULKAN_SDK}/lib -lvulkan shaderc_combined)
elseif(UNIX)
target_link_libraries(shaders-gen -L$ENV{VULKAN_SDK}/lib -lvulkan shaderc_combined)
if (SPACEMESH_ARCH_ARM64)
target_link_libraries(shaders-gen vulkan glslang OSDependent OGLCompiler HLSL SPIRV SPIRV-Tools SPIRV-Tools-opt)
else()
target_link_libraries(shaders-gen -L$ENV{VULKAN_SDK}/lib -lvulkan shaderc_combined)
endif()
endif()

target_link_libraries(shaders-gen zlibstatic)

0 comments on commit 84857d4

Please sign in to comment.