Skip to content
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
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Binary release

on:
pull_request:
paths:
- .github/workflows/release.yml
- CMakeLists.txt
- cmake/**
- ci/release/**
- keygen-rs/**
- src/**
- tools/**
- contrib/**
- scripts/build-release.sh
- scripts/test/release.py
push:
tags: ['v*', '!v*-cuda-only']
workflow_dispatch:

permissions:
contents: read

jobs:
linux-sycl:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- gpu: nvidia
image: docker.io/nvidia/cuda:12.9.1-devel-ubuntu24.04
llvm: 20
- gpu: amd
image: docker.io/rocm/dev-ubuntu-24.04:6.2-complete
llvm: 18
- gpu: intel
image: docker.io/library/ubuntu:24.04
llvm: 20
env:
RELEASE_GPU: ${{ matrix.gpu }}
steps:
- uses: actions/checkout@v7
- name: Build release image
run: |
docker build -t xchplot2-release -f ci/release/Containerfile ci/release \
--build-arg GPU="$RELEASE_GPU" \
--build-arg LLVM_VERSION='${{ matrix.llvm }}' \
--build-arg BASE_DEVEL='${{ matrix.image }}'
- name: Build and package
env:
RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
run: |
docker run --rm -e RELEASE_TAG -v "$PWD:/src" xchplot2-release \
bash scripts/build-release.sh
- name: Check the extracted runtime and CPU proofs
run: |
docker run --rm -e RELEASE_GPU -e DEBIAN_FRONTEND=noninteractive \
-v "$PWD:/src:ro" -w /src ubuntu:24.04 bash -euc '
apt-get update
apt-get install -y --no-install-recommends \
python3 libstdc++6 libnuma1 libelf1t64 libdrm2 libdrm-amdgpu1
python3 scripts/test/release.py build/release-"$RELEASE_GPU"/dist/*.tar.gz \
--sycl-probe build/release-"$RELEASE_GPU"/tools/sanity/hellosycl
'
- uses: actions/upload-artifact@v7
with:
name: linux-x86_64-sycl-${{ matrix.gpu }}
path: |
build/release-${{ matrix.gpu }}/dist/*.tar.gz
build/release-${{ matrix.gpu }}/dist/*.sha256
if-no-files-found: error

draft:
if: startsWith(github.ref, 'refs/tags/')
needs: linux-sycl
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
pattern: linux-x86_64-sycl-*
merge-multiple: true
path: dist
- name: Attach archives to a draft release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
gh release create "$RELEASE_TAG" dist/* \
--verify-tag --draft --title "$RELEASE_TAG" --generate-notes
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ if(XCHPLOT2_BUILD_CUDA)
foreach(_a IN LISTS CMAKE_CUDA_ARCHITECTURES)
# Strip sm_ / compute_ prefixes some users pass through
string(REGEX REPLACE "^(sm_|compute_)" "" _a "${_a}")
string(REGEX REPLACE "-(real|virtual)$" "" _a "${_a}")
if(_a MATCHES "^[0-9]+$" AND _a LESS _min_arch)
set(_min_arch ${_a})
endif()
Expand Down Expand Up @@ -1785,3 +1786,9 @@ foreach(_target IN LISTS _xchplot2_targets)
endif()
endif()
endforeach()

# Archive packaging is opt-in; ordinary builds need no release tooling.
option(XCHPLOT2_PACKAGE "Configure binary release packaging" OFF)
if(XCHPLOT2_PACKAGE)
include(cmake/Packaging.cmake)
endif()
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,41 @@ When moving sections, update incoming links and keep the useful README
entry headings. `docs/` is ignored local material; do not publish it as part
of a documentation move.

## Binary releases

The release workflow builds one Linux archive per GPU vendor through the
standalone CMake executable and CPack. Build images pin Ubuntu 24.04,
AdaptiveCpp 25.10, and Rust 1.98.1. NVIDIA uses CUDA 12.9.1 and LLVM 20;
AMD follows the existing ROCm 6.2 / LLVM 18 pairing; Intel uses LLVM 20 and
Level Zero. Keep `INSTALL.md` and the archive README in sync with these pins.

For example, build the Intel archive locally:

```bash
podman build -t xchplot2-release-intel -f ci/release/Containerfile ci/release
podman run --rm -v "$PWD:/src" xchplot2-release-intel bash scripts/build-release.sh
```

Use the workflow's build arguments for AMD or NVIDIA. Artifacts are written
to `build/release-VENDOR/dist/`. `acpp --acpp-deploy` collects runtime and
JIT dependencies; the build script adds Level Zero, checks the selected
backend, collects license notices, and makes library paths relative.

PR and manual runs retain workflow artifacts. A `vVERSION` tag creates a
draft GitHub release; publish it after qualifying the extracted archives on
the supported GPUs. Do not rebuild between qualification and publication.
The workflow checks extraction, the packaged SYCL JIT through `hellosycl`,
CPU plotting, and full proofs in an image without development toolchains.

Run `scripts/test/release.py ARCHIVE.tar.gz` for the archive and CPU checks.
Add `--sycl-probe build/release-VENDOR/tools/sanity/hellosycl` to test the JIT.
For GPU qualification, use the extracted executable for the k=22/k=28 byte
comparisons, full proofs, tiers, spill, and recovery checks described above.
`gpu-ci.py --binary /path/to/extracted/bin/xchplot2` retains the matching
build's parity and inventory tools. Build and package must have the same
source revision and toolchain. Record qualification in release notes; keep
plots and detailed logs out of the tree.

## Commit style

Short imperative subjects, lowercase scope prefix, no trailing period:
Expand Down
63 changes: 60 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,35 @@ CUDA build, use the [`cuda-only` installation guide](https://github.com/Jsewill/

| Path | Use it for |
|---|---|
| [Binary archives](#binary-archives) | Prebuilt CLI and runtime for one GPU vendor |
| [Container](#container) | Toolchains inside the image; GPU driver and container engine on the host |
| [Native install](#native-install) | System dependencies and AdaptiveCpp installed by the existing script |
| [Manual dependencies](#manual-dependencies) | An existing toolchain or a development setup |

## Binary archives

Download the Linux x86-64 `sycl-nvidia`, `sycl-amd`, or `sycl-intel` archive
and its `.sha256` file from [GitHub Releases](https://github.com/Jsewill/xchplot2/releases).
Check `sha256sum -c ARCHIVE.tar.gz.sha256`, then extract the archive and run
`./bin/xchplot2 devices` from its directory. Keep `bin/` and `lib/` together;
add that `bin` directory to `PATH` to run the CLI elsewhere.

These archives target glibc 2.39+ (Ubuntu 24.04 or a compatible system), an
x86-64 CPU with AES, SSSE3, and SSE4.1, and a compatible GPU driver. On Ubuntu,
install `libstdc++6`, `libnuma1`, and `libelf1t64`; AMD also needs `libdrm2`
and `libdrm-amdgpu1`. The archive includes AdaptiveCpp, LLVM, and one GPU
backend. No development toolkit is needed. Mixed-vendor builds use the
source or container instructions below.

The NVIDIA bundle uses CUDA 12.9.1; driver 575.57.08+ is recommended. The AMD
bundle uses ROCm 6.2 and supports hardware covered by that runtime. The Intel
bundle uses Level Zero and requires the Intel GPU compute driver. See
[troubleshooting](REFERENCE.md#troubleshooting) for the tested Intel driver
settings and the release notes for hardware qualification.

`BUILDINFO.txt` records source and toolchain revisions; `licenses/` contains
dependency notices. Releases without binary assets require a source build.

## Container

Easiest path — `scripts/build-container.sh` does host-side GPU
Expand Down Expand Up @@ -262,9 +287,8 @@ Toolchain prerequisites for the NVIDIA build:
link, plus C++20 CUDA dialect, both require 12.0).
- **CMake ≥ 3.26** for nvcc 12.5+ (Debian 12's stock 3.25 doesn't know
the dialect flags; install Kitware's repo).
- **rustc ≥ 1.85** (rustup `stable`). Distro-packaged Rust (Ubuntu
24.04 apt cargo is 1.75) is too old for the `edition2024` feature
required by `chia-client` 0.42.
- **Rust via rustup `stable`**. Release builds use Rust 1.98.1.
Older distro-packaged Rust may not support the locked dependencies.

### NVIDIA dependency sources

Expand Down Expand Up @@ -381,3 +405,36 @@ Native Windows plotting is outside the current hardware test set.
Native Windows SYCL is not supported by the current `main` build. Its
AdaptiveCpp setup and host code require Linux/POSIX facilities; the earlier
unvalidated source-build outline was not a tested installation path.

### Native AMD and Intel evaluation

The Linux archives pin AdaptiveCpp 25.10. Its
[installation guide](https://github.com/AdaptiveCpp/AdaptiveCpp/blob/v25.10.0/doc/installing.md)
describes Windows CPU/CUDA support through an LLVM-integrated build using
LLVM 18 or newer. Its
[Windows build workflow](https://github.com/AdaptiveCpp/AdaptiveCpp/blob/v25.10.0/.github/workflows/windows-acppllvm.yml)
tests that CUDA toolchain. This does not establish Windows HIP or Level Zero
support for xchplot2. Nightly binaries from `develop` are a separate toolchain
candidate, not the pinned release compiler.

| Backend | Work required before a native Windows release |
|---|---|
| AMD HIP | Qualify an AdaptiveCpp Windows build with the selected HIP SDK and GPU; port the driver-backed `hipMemGetInfo` query and package the matching redistributable runtime. |
| Intel | Qualify Level Zero or OpenCL with the Windows driver, including device/shared allocations, integer atomics, sorting, and JIT compilation; provide a free-memory query for that backend. |

AMD's [Windows HIP SDK component matrix](https://rocm.docs.amd.com/projects/install-on-windows/en/latest/conceptual/component-support.html)
differs from Linux ROCm. A Linux ROCm installation or a successful Linux
archive build does not qualify the corresponding Windows combination.

The project's HIP and Level Zero probes in `src/host/GpuBufferPool.cpp`
currently use POSIX dynamic loading and are excluded on Windows. OpenCL has
no free-memory probe. Admission deliberately rejects an unverified GPU
budget; reporting device capacity as free memory would weaken that check.
The native CUDA host/file port also needs to be carried into the SYCL build,
with a matching MSVC/Rust runtime and Windows DLL deployment.

Before adding a Windows SYCL archive, run the existing allocation and kernel
parity checks, then k=22/k=28 CPU byte comparisons, full proofs, every fitting
tier and disk-spill variant, memory-pressure rejection, cancellation, and
recovery using the extracted package on Windows hardware. A native Windows
AMD/Intel compiler build and GPU run have not yet been qualified.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ grouping, may require replotting.

## Quick start

For prebuilt archives, follow [binary installation](INSTALL.md#binary-archives).

Install the [build dependencies](INSTALL.md#native-install) first.
For containers or Windows, follow [INSTALL.md](INSTALL.md).

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ xchplot2 is a client-side plot builder. It handles:
or reused seed lets an attacker who observes plot IDs correlate
plots to the same master key.
- BLS key parsing via the
[`chia` Rust crate](https://crates.io/crates/chia) through
[`chia-bls` Rust crate](https://crates.io/crates/chia-bls) through
`keygen-rs`.
- Per-plot private keys, included in plot memos and saved job manifests.
- Large file writes into caller-supplied output directories.
Expand Down
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nd = "nd"
hge = "hge"
# Yann Collet, author of LZ4 / zstd, attributed in NOTICE.
Collet = "Collet"
# POSIX / Windows CRT file-open mode.
WRONLY = "WRONLY"
54 changes: 54 additions & 0 deletions ci/release/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Build tools for the relocatable SYCL archives. See the release workflow for bases.
ARG BASE_DEVEL=docker.io/library/ubuntu:24.04
FROM ${BASE_DEVEL}
ARG GPU=intel
ARG LLVM_VERSION=20
ENV DEBIAN_FRONTEND=noninteractive
ENV CMAKE_BUILD_PARALLEL_LEVEL=2
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential ca-certificates curl git ninja-build cmake python3 patchelf \
libboost-context-dev libnuma-dev llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev clang-${LLVM_VERSION} \
libclang-${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION}-dev lld-${LLVM_VERSION} \
libomp-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev \
&& if [ "$GPU" = intel ]; then apt-get install -y --no-install-recommends libze-dev; fi \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSfL --retry 5 --retry-all-errors \
https://sh.rustup.rs -o /tmp/rustup-init.sh \
&& sh /tmp/rustup-init.sh -y --default-toolchain 1.98.1 --profile minimal \
&& rm /tmp/rustup-init.sh
ENV PATH=/root/.cargo/bin:/opt/adaptivecpp/bin:${PATH}
RUN cargo install --locked --features cli cargo-about --version 0.9.2
RUN git clone --depth 1 --branch v25.10.0 \
https://github.com/AdaptiveCpp/AdaptiveCpp.git /tmp/acpp-src \
&& case "$GPU" in \
nvidia) backend_flags='-DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=OFF -DWITH_LEVEL_ZERO_BACKEND=OFF -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda' ;; \
amd) backend_flags='-DWITH_CUDA_BACKEND=OFF -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=OFF -DROCM_PATH=/opt/rocm -DROCM_DEVICE_LIBS_PATH=/opt/rocm/amdgcn/bitcode' ;; \
intel) backend_flags='-DWITH_CUDA_BACKEND=OFF -DWITH_ROCM_BACKEND=OFF -DWITH_LEVEL_ZERO_BACKEND=ON' ;; \
*) exit 1 ;; \
esac \
&& cmake -S /tmp/acpp-src -B /tmp/acpp-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/adaptivecpp \
-DCMAKE_C_COMPILER=/usr/lib/llvm-${LLVM_VERSION}/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/lib/llvm-${LLVM_VERSION}/bin/clang++ \
-DLLVM_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/llvm \
-DClang_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/clang \
-DACPP_LLD_PATH=/usr/lib/llvm-${LLVM_VERSION}/bin/ld.lld \
-DCLANG_INCLUDE_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION} \
-DWITH_OPENCL_BACKEND=OFF -DACPP_SUBPROJECT_PARALLEL_JOBS=2 $backend_flags \
&& cmake --build /tmp/acpp-build \
&& cmake --install /tmp/acpp-build \
&& mkdir -p /opt/release-licenses \
&& cp /tmp/acpp-src/LICENSE /opt/release-licenses/adaptivecpp.txt \
&& git -C /tmp/acpp-src rev-parse HEAD > /opt/release-licenses/adaptivecpp-revision.txt \
&& if [ "$GPU" = intel ]; then \
cmake --build /tmp/acpp-build --target InstallLLVMSpirvTranslator \
&& translator=$(find /tmp/acpp-build -type d -name LLVMSpirvTranslator) \
&& cp "$translator/LICENSE.TXT" /opt/release-licenses/llvm-spirv.txt \
&& git -C "$translator" rev-parse HEAD > /opt/release-licenses/llvm-spirv-revision.txt; \
fi \
&& rm -rf /tmp/acpp-src /tmp/acpp-build
RUN git config --system --add safe.directory /src
ENV CMAKE_PREFIX_PATH=/opt/adaptivecpp
ENV XCHPLOT2_RELEASE_GPU=${GPU}
ENV XCHPLOT2_RELEASE_LLVM=${LLVM_VERSION}
WORKDIR /src
29 changes: 29 additions & 0 deletions ci/release/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
xchplot2 — SYCL/AdaptiveCpp binary

Choose the archive for your GPU: sycl-nvidia, sycl-amd, or sycl-intel.
Keep bin/ and lib/ together when moving the extracted directory.
Run ./bin/xchplot2 --help or ./bin/xchplot2 devices from that directory.

Requirements:
Linux x86_64 with glibc 2.39+ (Ubuntu 24.04 or a compatible system).
CPU with AES, SSSE3, and SSE4.1 instructions.
Standard OS libraries and a compatible GPU driver.

On Ubuntu 24.04, install the OS libraries with:
sudo apt install libstdc++6 libnuma1 libelf1t64

NVIDIA: Maxwell or newer; driver 575.57.08+ recommended for CUDA 12.9.1.
AMD: hardware supported by the bundled ROCm 6.2 runtime and a compatible
amdgpu kernel driver; libdrm2 and libdrm-amdgpu1 must be installed.
Intel: an Intel GPU compute driver providing libze_intel_gpu.so.1.
Consult the release notes for tested hardware and driver versions.

AdaptiveCpp, LLVM, and the selected backend runtime are included under lib/.
No CUDA, ROCm, LLVM, or AdaptiveCpp development installation is needed.
BUILDINFO.txt records the source and toolchain revisions. Dependency licenses
are under licenses/. GPU drivers and core OS libraries are not bundled.

Usage: https://github.com/Jsewill/xchplot2
Installation: https://github.com/Jsewill/xchplot2/blob/main/INSTALL.md
Intel settings: https://github.com/Jsewill/xchplot2/blob/main/REFERENCE.md#troubleshooting
Report issues: https://github.com/Jsewill/xchplot2/issues
11 changes: 11 additions & 0 deletions ci/release/licenses.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Rust dependencies included in xchplot2

{{#each licenses}}
{{name}}
{{#each used_by}}
{{crate.name}} {{crate.version}}
{{/each}}

{{{text}}}

{{/each}}
Loading
Loading