tig-monorepopool/tig-binary
2025-06-04 11:06:26 +01:00
..
scripts Rework architecture so each challenge has separate runtime & docker. 2025-06-04 11:06:26 +01:00
src Rework tig-runtime logic for handling out of fuel. 2025-05-22 09:07:40 +01:00
Cargo.toml Rework architecture so each challenge has separate runtime & docker. 2025-06-04 11:06:26 +01:00
README.md Update build scripts and documentation. 2025-05-13 16:18:03 +01:00

tig-binary

A Rust crate that wraps an algorithm from tig-algorithm for compilation into a shared object.

TIG uses a forked version of LLVM compiler 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. 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
  1. 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
  1. (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