# CUDA A/B harness Run one deterministic CUDA workload on the **host** (bare-metal GPU, the oracle) and in the **guest** (Open-IOV emulated vGPU), then compare the machine-readable results. This mirrors the earlier host/guest `nvidia-smi` comparison, but exercises actual execution: allocation, HtoD/DtoH copies, kernel launch, synchronisation and verification. ``` tools/cuda-ab/ab.sh all # build + host run + guest run + compare tools/cuda-ab/ab.sh host # host only -> run/host.txt tools/cuda-ab/ab.sh guest # push binary, run in the running VM -> run/guest.txt tools/cuda-ab/ab.sh compare # diff the stable result lines ``` ## Files | File | Purpose | |---|---| | `vector_add.cu` | the workload (`DEVICE`/`RESULT`/`STATUS` output lines) | | `ab.sh` | host build/run, guest push/run, comparison | | `run/` | generated outputs (`host.txt`, `guest.txt`) | ## Notes * The binary links the CUDA runtime **statically** (`--cudart=static`), so the guest needs no CUDA toolkit - only the guest driver's `libcuda.so`. * The guest transfer uses the guest agent (base64 chunks); the VM must be running (`scripts/vgpu_vm.py`). * `DEVICE` lines are normalised before diffing (the guest reports the emulated GPU name); `RESULT` and `STATUS` must match exactly. * Host requirement: `nvidia-cuda-toolkit` (`nvcc`).