diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 20c19942..a1ff59ca 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -44,7 +44,7 @@ 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}" @@ -52,7 +52,7 @@ jobs: - 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 @@ -90,7 +90,7 @@ 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}" @@ -98,11 +98,80 @@ jobs: - 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7edafece..522ae2fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()