summaryrefslogtreecommitdiffstats
path: root/tools/cuda-bridge/Makefile
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-03 14:05:38 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-03 14:05:38 -0400
commitcc79b478843f0230fe6aa8ecd822de7ba71c891e (patch)
tree5de760ddec4e45cc23d39ce7502635f5c0711217 /tools/cuda-bridge/Makefile
parent40351167dd209012ab485e6164ce94f0b8965422 (diff)
downloadopen-iov-cc79b478843f0230fe6aa8ecd822de7ba71c891e.tar.gz
open-iov-cc79b478843f0230fe6aa8ecd822de7ba71c891e.zip
vgsp: host CUDA bridge + sema release recovery; greeneye simulator wave
- kernel: gsp_cuda_bridge (QMD launch capture, debugfs job/out/done, param+output resolution cached from inline writes), sema drain fixes (never hold/starve a channel), GR ring autopin + counter autoreg, per-page push reads, counter-derive gate; module builds clean - tools/cuda-bridge: CUDA driver-API daemon executing mail/vadd kernels on the physical GPU, CUBB2/CBD2 v2 protocol, layout check + self-tests - tools/guest-diag + tools/cuda-ab: scanner/pin fixes, victory push-only mode - debug/risc-v-gsp-rm-vm: Phase S simulator wave (GSP device model, boot ladder, triage/re-demo harnesses, docs 30-41), GPGPU-sim scaffolding - STATE-CURRENT/docs updates
Diffstat (limited to 'tools/cuda-bridge/Makefile')
-rw-r--r--tools/cuda-bridge/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/cuda-bridge/Makefile b/tools/cuda-bridge/Makefile
new file mode 100644
index 0000000..d75a7c5
--- /dev/null
+++ b/tools/cuda-bridge/Makefile
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Build the host-side CUDA bridge daemon.
+#
+# Kernels are written in CUDA C, compiled to PTX at build time by nvcc, and
+# embedded into the binary by embed_ptx.py, so cuda_bridge needs only the
+# driver's libcuda at runtime. kernels_ptx.h is a generated file; if it is
+# already present the build works without nvcc.
+
+CC ?= cc
+NVCC ?= nvcc
+PTX_ARCH ?= sm_75
+CFLAGS ?= -O2 -Wall -Wextra -std=gnu11
+LDLIBS ?= -lcuda
+
+all: cuda_bridge
+
+kernels.ptx: kernels.cu
+ $(NVCC) -arch=$(PTX_ARCH) -ptx $< -o $@
+
+kernels_ptx.h: kernels.ptx embed_ptx.py
+ python3 embed_ptx.py kernels.ptx kernels_ptx.h
+
+cuda_bridge: cuda_bridge.c kernels_ptx.h
+ $(CC) $(CFLAGS) cuda_bridge.c -o $@ $(LDLIBS)
+
+test: cuda_bridge
+ ./cuda_bridge --test
+
+bridge-test: cuda_bridge
+ python3 bridge_selftest.py
+
+layout-check:
+ python3 check_module_layout.py
+
+mutate-test: cuda_bridge
+ ./cuda_bridge --mutation-test
+
+bench: cuda_bridge
+ ./cuda_bridge --bench
+
+clean:
+ rm -f cuda_bridge kernels.ptx kernels_ptx.h
+
+.PHONY: all test bridge-test layout-check mutate-test bench clean