Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing arm64 conditional #337

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 131 additions & 136 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
- name: Build Harvester
shell: bash
run: |
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-linux-x86-64"
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-linux-x86-64.tar.gz"
echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# emits env.harvester_artifact_path
bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

- name: Upload Harvester Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.harvester_artifact_name }}
name: ${{ env.harvester_artifact_name }}.zip
path: ${{ env.harvester_artifact_path }}
if-no-files-found: error

Expand Down Expand Up @@ -90,19 +90,88 @@ jobs:
- name: Build Harvester
shell: bash
run: |
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-windows-x86-64"
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-windows-x86-64.zip"
echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# emits env.harvester_artifact_path
bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

- name: Upload Harvester Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.harvester_artifact_name }}
name: ${{ env.harvester_artifact_name }}.zip
path: ${{ env.harvester_artifact_path }}
if-no-files-found: error

build-ubuntu-x86-64:
build-harvester-linux-arm64:
runs-on: [ARM64, Linux]
container:
image: quay.io/pypa/manylinux2014_aarch64
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Cache DNF packages
uses: actions/cache@v3
with:
path: /var/cache/dnf
key: ${{ runner.os }}-dnf-${{ hashFiles('**/your-build-file') }}
restore-keys: |
${{ runner.os }}-dnf-

- name: Get Version Number
id: version_number
shell: bash
run: ./.github/actions/get-version.sh centos arm64

- name: Install Prerequisites
shell: bash
run: |
set -eo pipefail
export module_platform_id=platform:el9
export MODULE_PLATFORM_ID=platform:el9
export PLATFORM_ID=platform:el9
uname -a
cat /etc/os-release
yum install -y dnf
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
dnf install -y dnf-plugins-core
dnf makecache
dnf install -y kernel-headers.aarch64 kernel-devel.aarch64 tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-opengl libglvnd-glx libglvnd-devel acpid pkgconfig dkms
dnf install -y cmake
dnf group install -y "Development Tools"
dnf install -y gmp-devel numactl-devel make git wget sed

- name: Setup CUDA
run: |
set -eo pipefail
module_platform_id=platform:el9
export MODULE_PLATFORM_ID=platform:el9
export PLATFORM_ID=platform:el9
dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel9/$(uname -i)/cuda-rhel9.repo
dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel9/sbsa/cuda-rhel9.repo
dnf makecache
#dnf install -y cuda.aarch64
dnf install -y cuda-toolkit
ls -la /usr/local/
ls -la /usr/local/cuda*
export PATH=/usr/local/cuda-12.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- name: Build Harvester
shell: bash
run: |
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-linux-ARM64.tar.gz"
echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# emits env.harvester_artifact_path
bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

- name: Upload Harvester Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.harvester_artifact_name }}.zip
path: ${{ env.harvester_artifact_path }}
if-no-files-found: error

build-bladebit-ubuntu-x86-64:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -136,18 +205,18 @@ jobs:
- name: Upload Bladebit Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME }}
name: ${{ env.BB_ARTIFACT_NAME }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
if-no-files-found: error

- name: Upload Bladebit CUDA Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }}
if-no-files-found: error

build-centos-x86-64:
build-bladebit-centos-x86-64:
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream8
Expand Down Expand Up @@ -193,80 +262,66 @@ jobs:
- name: Upload Bladebit Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME }}
name: ${{ env.BB_ARTIFACT_NAME }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
if-no-files-found: error

- name: Upload Bladebit CUDA Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }}
if-no-files-found: error

build-bladebit-cuda-linux-arm64:
runs-on: [ARM64, Linux]
container:
image: chianetwork/ubuntu-20.04-builder:latest
defaults:
run:
shell: bash
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu arm64

# build-ubuntu-arm64:
# runs-on: [ARM64, Linux]
# container:
# image: chianetwork/ubuntu-20.04-builder:latest
# defaults:
# run:
# shell: bash
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3

# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh ubuntu arm64

# - name: Install Prerequisites
# run: |
# export DEBIAN_FRONTEND=noninteractive
# apt update
# apt install -y build-essential git libgmp-dev libnuma-dev

# - name: Build
# run: .github/actions/build-asset-unix.sh --artifact ${{ env.BB_ARTIFACT_NAME_CUDA }} --version ${{env.BB_VERSION}}

# - name: Upload Artifact Ubuntu ARM64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
# if-no-files-found: error

# build-centos-arm64:
# runs-on: [ARM64, Linux]
# container:
# image: quay.io/centos/centos:stream8
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3

# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh centos arm64

# - name: Install Prerequisites
# run: |
# dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
# cmake gmp-devel numactl-devel make git

# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{env.BB_VERSION}}
# run: |
# source /opt/rh/gcc-toolset-9/enable
# .github/actions/build-asset-unix.sh

# - name: Upload Artifact CentOS ARM64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
# if-no-files-found: error
- name: Install Prerequisites
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y build-essential git libgmp-dev libnuma-dev
- name: Setup CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/cuda-ubuntu2004.pin
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-ubuntu2004-12-1-local_12.1.1-530.30.02-1_arm64.deb
dpkg -i cuda-repo-ubuntu2004-12-1-local_12.1.1-530.30.02-1_arm64.deb
cp /var/cuda-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y install cuda

- name: Build
run: .github/actions/build-asset-unix.sh --artifact ${{ env.BB_ARTIFACT_NAME }} --version ${{env.BB_VERSION}}

- name: Upload Artifact Ubuntu ARM64
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
if-no-files-found: error

- name: Build Bladebit CUDA
run: |
.github/actions/build-asset-unix.sh --cuda --artifact ${{ env.BB_ARTIFACT_NAME_CUDA }} --version ${{ env.BB_VERSION }}
- name: Upload Bladebit CUDA Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }}
if-no-files-found: error

build-bladebit-windows-x86-64:
runs-on: windows-2019
Expand All @@ -285,7 +340,6 @@ jobs:
BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }}
BB_VERSION: ${{env.BB_VERSION}}
run: |

mkdir build && cd build
cmake ..
bash -eo pipefail ../embed-version.sh
Expand All @@ -299,7 +353,7 @@ jobs:
>&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'."
exit 1
fi

mkdir ../bin
cd Release
ls -la
Expand All @@ -309,7 +363,7 @@ jobs:
- name: Upload Bladebit Artifact Windows x86-64
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME }}
name: ${{ env.BB_ARTIFACT_NAME }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
if-no-files-found: error

Expand Down Expand Up @@ -350,7 +404,6 @@ jobs:
BB_ARTIFACT_NAME_CUDA: ${{ env.BB_ARTIFACT_NAME_CUDA }}
BB_VERSION: ${{env.BB_VERSION}}
run: |

mkdir build_cuda && cd build_cuda
cmake ..
bash -eo pipefail ../embed-version.sh
Expand All @@ -364,7 +417,7 @@ jobs:
>&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'."
exit 1
fi

mkdir ../bin
cd Release
ls -la
Expand All @@ -374,64 +427,6 @@ jobs:
- name: Upload Bladebit CUDA Artifact Windows x86-64
uses: actions/upload-artifact@v3
with:
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}.zip
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }}
if-no-files-found: error

# build-macos-arm64:
# runs-on: [macOS, ARM64]
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout Repo
# uses: actions/checkout@v3

# - name: Get Version Number
# id: version_number
# run: bash -e .github/actions/get-version.sh macos arm64

# - name: Install Prerequisites
# run: brew install cmake

# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{env.BB_VERSION}}
# run: .github/actions/build-asset-unix.sh

# - name: Upload Artifact macOS arm64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
# if-no-files-found: error

# build-macos-x86-64:
# runs-on: macOS-11
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout Repo
# uses: actions/checkout@v3

# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh macos x86-64

# - name: Install Prerequisites
# run: brew install cmake

# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{env.BB_VERSION}}
# run: .github/actions/build-asset-unix.sh

# - name: Upload Artifact macOS x86-64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }}
# if-no-files-found: error
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ if(NOT( (${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR (${CMAKE_SYSTEM_NAME} MATCHES
message( FATAL_ERROR "Unsupported operating system '${CMAKE_SYSTEM_NAME}'" )
endif()

if(NOT(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64"))
else()
if(NOT (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "AMD64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64"))
message( FATAL_ERROR "Unsupported architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'" )
endif()

Expand Down