Files
leleka/scripts/build-cuda-qsa-oracle.sh
T
Pavlo RatushnyiandClaude Sonnet 5.5 9b08355660 scripts: restore the executable bit lost in the 2026-10-14 import (every workflow job died at "Permission denied")
7f896a8bb changed 100755 to 100644 on 16 scripts that the workflows or check-local.sh execute by path, among them
scripts/install-pinned-rustup.sh (the first step of every job), scripts/test-cuda-fixed-ptx.sh, scripts/test-cuda-driver-bootstrap.sh,
scripts/build-cpu.sh and the GPU gate scripts. A Linux checkout keeps git's mode, so `scripts/install-pinned-rustup.sh ...` failed with
"Permission denied" before any build. Found by running the steps from a `git archive` in a Linux container; the Windows and WSL-on-/mnt/c
runs of the first audit show every file as executable and could not see it. Only modes change; engine/strata is not touched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 01:42:33 +01:00

20 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# New test-only harness; never launches a GPU or rebuilds the server.
set -euo pipefail
[[ $# == 1 ]] || { echo 'Usage: build-cuda-qsa-oracle.sh PRIVATE_OUTPUT_DIRECTORY' >&2; exit 2; }
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
out="$1"
mkdir -p "$out"
nvcc --version | tee "$out/compiler.txt"
grep 'V12.8.93' "$out/compiler.txt"
(cd "$root" && sha256sum --check scripts/cuda-qsa-oracle/source.sha256)
common=(-std=c++17 -O3 -arch=sm_120 -Xcompiler=-ffunction-sections,-fdata-sections -I"$root/engine/strata/include")
for part in native rope index; do
nvcc "${common[@]}" --use_fast_math -c "$root/scripts/cuda-qsa-oracle/oracle_$part.cu" -o "$out/$part.o"
done
for part in select attention; do
nvcc "${common[@]}" --fmad=true --ftz=false -c "$root/scripts/cuda-qsa-oracle/oracle_$part.cu" -o "$out/$part.o"
done
nvcc "${common[@]}" --fmad=false --ftz=false "$root/scripts/cuda-qsa-oracle/main.cu" "$out/"{native,rope,index,select,attention}.o -Xlinker=--gc-sections -L/usr/local/cuda/lib64/stubs -lcuda -o "$out/qsa_oracle"
sha256sum "$out/qsa_oracle" "$out/"*.o > "$out/binary.sha256"