tig-monorepo/tig-binary/README.md
FiveMovesAhead c46c54d3f1
Some checks are pending
Test Workspace / Test Workspace (push) Waiting to run
Update build scripts and documentation.
2025-05-13 16:18:03 +01:00

39 lines
1.6 KiB
Markdown

# tig-binary
A Rust crate that wraps an algorithm from [`tig-algorithm`](../tig-algorithms/README.md) for compilation into a shared object.
TIG uses a forked version of [LLVM compiler](https://github.com/tig-foundation/llvm) for injecting runtime signature and fuel tracking into the shared object.
For CUDA, TIG uses `nvcc` to generate ptx using target version `sm_70/compute_70`, before injecting runtime signature and fuel tracking into the ptx file.
# Getting Started
1. Run the appropiate [development docker image](https://github.com/tig-foundation/tig-monorepo/pkgs/container/tig-monorepo%2Fdev). Available flavours are:
* amd64 (x86_64 compatible)
* aarch64
* amd64-cuda12.6.3 (x86_64 compatible)
* aarch64-cuda12.6.3
```
# example
docker run -it -v $(pwd):/app ghcr.io/tig-foundation/tig-monorepo/dev:0.0.1-aarch64
# scripts build_so and build_ptx are on PATH
```
2. Build shared object using `build_so` script:
* Expects `tig_algorithm::<CHALLENGE>::<ALGORITHM>::solve_challenge` to be importable
* Outputs to `tig-algorithms/lib/<CHALLENGE>/<ARCH>/<ALGORITHM>.so`, where `ARCH` is aarch64 or amd64
```
# add '--cuda' flag if building cuda algorithm
build_so $CHALLENGE $ALGORITHM
```
3. (Optional) Build ptx using `build_ptx` script:
* Expects `tig_algorithm/src/<CHALLENGE>/<ALGORITHM>.cu` or `tig_algorithm/src/<CHALLENGE>/<ALGORITHM>/benchmarker_outbound.cu` file to exist
* Outputs to `tig-algorithms/lib/<CHALLENGE>/ptx/<ALGORITHM>.ptx`
```
build_ptx $CHALLENGE $ALGORITHM
```
# License
[End User License Agreement](../docs/agreements/end_user_license_agreement.pdf)