Files
leleka/scripts/check-kar-expert-gpu.sh
T
Pavlo RatushnyiandClaude Sonnet 5.5 7f896a8bb8 import: Original-literal source-port snapshot (frozen 2026-10-12 06:36, uncompiled together, no GPU run)
Snapshot of target/stra169-direct-port-integration/source-port (without target/), now the tracked base for the full Strata Rust port.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:38:46 +02:00

17 lines
906 B
Bash

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
build_dir="${STRATA_KAR_EXPERT_BUILD_DIR:-${repo_root}/artifacts/build-kar-expert-gpu}"
used="$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits | head -n 1)"
if (( used > 1024 )); then
printf 'GPU is occupied; KAR component tests require a free test device.\n' >&2
exit 1
fi
cmake -S "${repo_root}/gpu/kar" -B "${build_dir}" \
-DCMAKE_CUDA_ARCHITECTURES="${STRATA_CUDA_ARCHITECTURES:-native}"
cmake --build "${build_dir}" --parallel "${BUILD_JOBS:-2}" --target strata-kar-expert-test strata-kar-expert-miss-test
rm -f "${build_dir}/expert-fixture.kar"
cargo run --locked --manifest-path "${repo_root}/control-plane/Cargo.toml" \
--example kar-expert-fixture -- "${build_dir}/expert-fixture.kar"
ctest --test-dir "${build_dir}" --output-on-failure -R '^kar_expert_(component|miss)$'