#!/bin/bash
set -euo pipefail
export CUDA_VISIBLE_DEVICES=GPU-f4a988cb-c310-b618-5a9c-4462d4d33add
export OMP_NUM_THREADS=8
cd /home/lab/bench/ornith/sglang
/home/lab/venvs/sglang/bin/python - <<'PY'
import torch, sglang, transformers
print('SGLang', sglang.__version__, 'Transformers', transformers.__version__)
print('Torch', torch.__version__, 'CUDA', torch.version.cuda)
assert torch.cuda.device_count() == 1
print('Assigned GPU1:', torch.cuda.get_device_name(0), torch.cuda.get_device_capability(0))
x = torch.ones((32, 32), device='cuda', dtype=torch.bfloat16)
print('GPU test:', (x @ x)[0,0].item())
PY
/home/lab/venvs/sglang/bin/python -m sglang.launch_server --help > server-help.txt
printf 'Diagnostic complete. Waiting for shared original checkpoint.\n'
