diff options
| author | Open-IOV <dev@open-iov.org> | 2026-09-23 05:44:08 -0400 |
|---|---|---|
| committer | Open-IOV <dev@open-iov.org> | 2026-09-23 05:46:43 -0400 |
| commit | 68cdd7728a7cc6715bbbff7decfe2b11c3bdf558 (patch) | |
| tree | 3dc8ce2e6af313a97ec6852f5c663a9a93665d2e /validate.sh | |
| download | open-iov-68cdd7728a7cc6715bbbff7decfe2b11c3bdf558.tar.gz open-iov-68cdd7728a7cc6715bbbff7decfe2b11c3bdf558.zip | |
Open-IOV: initial public release
Open-IOV virtualizes NVIDIA GPUs so that unmodified guest drivers run with
real GPU functionality - CUDA first, 3D and video to follow - on unmodified
hosts, without a proprietary vGPU license and without patching any driver,
firmware or hypervisor.
Core principle: emulate the interface, pass through the work.
kernel/ open-iov-vfio.ko - host VFIO mdev driver: virtual GPU device
(PCI config space, BAR shadows, MSI-X), GSP boot emulation,
GSP-RM message-queue/RPC emulation, memory model (GPU-VA to
guest-PA discovery) and the semaphore-completion service that
advances guest UVM progress.
userspace/ libiov.so management API and examples.
tools/ guest diagnostics, firmware analysis wrappers, RM probes.
scripts/ stack manager, VM harness, build/load/test automation.
config/ hardware/version profiles (the portability surface).
docs/ documentation tree - start at docs/README.md.
wiki/ long-form firmware and protocol deep dives.
Status: initialization works end to end for a stock 570.144 Linux guest on
Turing (TU104): driver probe, nvidia-smi, the full GSP-RM control battery,
object creation and the early CUDA/UVM start-up path. GPU work forwarding -
the step that makes CUDA kernels execute on real hardware - is the active
work item; see docs/04-implementation/01-known-knowns-and-unknowns.md.
License: BSD-3-Clause for the project; GPL-2.0 for kernel modules that link
GPL-only kernel interfaces. See LICENSE and docs/09-reference/legal-and-licensing.md.
Diffstat (limited to 'validate.sh')
| -rwxr-xr-x | validate.sh | 224 |
1 files changed, 224 insertions, 0 deletions
diff --git a/validate.sh b/validate.sh new file mode 100755 index 0000000..642401e --- /dev/null +++ b/validate.sh @@ -0,0 +1,224 @@ +#!/bin/bash +# Quick validation script for the GSP vGPU-IO project +# Run this to verify structure before committing + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +log_info() { echo -e "${GREEN}[INFO]${NC} $1"; } +log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } +log_error() { echo -e "${RED}[ERROR]${NC} $1"; } + +PROJECT_ROOT="${OPEN_IOV_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" + +cd "$PROJECT_ROOT" + +log_info "=== GSP vGPU-IO Project Validation ===" + +# Check firmware +log_info "Checking firmware..." +FW="$PROJECT_ROOT/firmware/57X-GSP/570.144/gsp-570.144.fwimage.bin" +if [ ! -f "$FW" ]; then + log_error "Firmware not found: $FW" + exit 1 +fi +SIZE=$(stat -c%s "$FW") +MD5=$(md5sum "$FW" | cut -d' ' -f1) +log_info "Firmware size: $SIZE bytes" +log_info "Firmware MD5: $MD5" +if [ "$MD5" != "13ce12a392a31eeb79a2e6ebd3a4a93a" ]; then + log_error "MD5 mismatch!" + exit 1 +fi +log_info "Firmware OK ✓" + +# Check decompiled output +log_info "Checking decompiled output..." +DECOMP_DIR="$PROJECT_ROOT/firmware/57X-GSP/570.144/decompiled" +COUNT=$(ls "$DECOMP_DIR"/*.c 2>/dev/null | wc -l) +log_info "Decompiled files: $COUNT" +if [ "$COUNT" -lt 80 ]; then + log_warn "Expected at least 80 files, got $COUNT" +fi + +# Check key functions +for func in \ + "FUN_ram_057a1ac0" \ + "FUN_ram_04cb8188" \ + "FUN_ram_04f00b0c" \ + "FUN_ram_04f00c78" \ + "FUN_ram_057e94ec" \ + "FUN_ram_051efbf4" \ + "FUN_ram_059be7f4"; do + if ! ls "$DECOMP_DIR/${func}_ram_"*.c 2>/dev/null | grep -q .; then + log_error "Missing key function: $func" + exit 1 + fi +done + +# Check entry point (different naming pattern) +if [ ! -f "$DECOMP_DIR/entry_ram_04009000.c" ]; then + log_error "Missing entry point" + exit 1 +fi +log_info "Key functions present ✓" + +# Check driver structure +log_info "Checking driver structure..." +DRIVER="$PROJECT_ROOT/driver" +for dir in core rpc vf bar wpr migration debugfs include; do + if [ ! -d "$DRIVER/$dir" ]; then + log_error "Missing driver directory: $dir" + exit 1 + fi +done +log_info "Driver directories OK ✓" + +# Check driver source files +for file in \ + "core/gsp_core.c" \ + "rpc/gsp_rpc.c" \ + "vf/gsp_vf.c" \ + "bar/gsp_bar.c" \ + "wpr/gsp_wpr.c" \ + "migration/gsp_migration.c" \ + "debugfs/gsp_debugfs.c" \ + "include/gsp_core.h" \ + "Makefile"; do + if [ ! -f "$DRIVER/$file" ]; then + log_error "Missing driver file: $file" + exit 1 + fi +done +log_info "Driver source files OK ✓" + +# Check wiki documentation +log_info "Checking wiki documentation..." +WIKI="$PROJECT_ROOT/wiki" +for doc in \ + "GSP-570.144W-Firmware-Analysis.md" \ + "RPC-Message-Format.md" \ + "BAR-Emulation-Specification.md" \ + "WPR-Management.md" \ + "Migration-Protocol.md" \ + "vGPU-IO-Integration-Guide.md" \ + "Address-Reference.md" \ + "Error-Codes.md" \ + "Glossary.md" \ + "README.md"; do + if [ ! -f "$WIKI/$doc" ]; then + log_error "Missing wiki doc: $doc" + exit 1 + fi +done +log_info "Wiki docs OK ✓" + +# Check test structure +log_info "Checking test structure..." +TESTS="$PROJECT_ROOT/kernel/tests" +for test in \ + "gsp_vgpu_comprehensive_test.c" \ + "gsp_vgpu_kunit_test.c" \ + "gsp_vgpu_mock_test.c" \ + "gsp_rpc_test.c" \ + "Makefile"; do + if [ ! -f "$TESTS/$test" ]; then + log_error "Missing test: $test" + exit 1 + fi +done +log_info "Kernel tests OK ✓" + +# Check userspace tests +USERS="$PROJECT_ROOT/userspace/tests" +for file in "test_vgpu_userspace.c" "Makefile"; do + if [ ! -f "$USERS/$file" ]; then + log_error "Missing userspace test: $file" + exit 1 + fi +done +log_info "Userspace tests OK ✓" + +# Check userspace library +USRLIB="$PROJECT_ROOT/userspace/lib" +USRINC="$PROJECT_ROOT/userspace/include" +for file in "libvgpu.c" "Makefile" "libvgpu.pc.in"; do + if [ ! -f "$USRLIB/$file" ]; then + log_error "Missing userspace lib: $file" + exit 1 + fi +done +if [ ! -f "$USRINC/libvgpu.h" ]; then + log_error "Missing userspace lib: libvgpu.h" + exit 1 +fi +log_info "Userspace lib OK ✓" + +# Check examples +EXAMPLES="$PROJECT_ROOT/userspace/examples" +for file in "example_vgpu.c" "Makefile"; do + if [ ! -f "$EXAMPLES/$file" ]; then + log_error "Missing example: $file" + exit 1 + fi +done +log_info "Examples OK ✓" + +# Check userspace top-level Makefile +if [ ! -f "$PROJECT_ROOT/userspace/Makefile" ]; then + log_error "Missing userspace Makefile" + exit 1 +fi +log_info "Userspace Makefile OK ✓" + +# Check integration test runner +if [ ! -f "$PROJECT_ROOT/tools/test/run_integration_tests.sh" ]; then + log_error "Missing integration test runner" + exit 1 +fi +log_info "Integration test runner OK ✓" + +# Check CI/CD +if [ ! -f "$PROJECT_ROOT/.github/workflows/ci.yml" ]; then + log_error "Missing CI workflow" + exit 1 +fi +log_info "CI/CD workflow OK ✓" + +# Check top-level README +if [ ! -f "$PROJECT_ROOT/README.md" ]; then + log_error "Missing top-level README" + exit 1 +fi +log_info "README OK ✓" + +# Syntax check C files (basic) +log_info "Running basic syntax checks..." +for cfile in $(find "$DRIVER" -name "*.c" -o -name "*.h"); do + # Check for basic issues + if grep -q "TODO\|FIXME\|XXX" "$cfile"; then + log_warn "$cfile contains TODO/FIXME/XXX" + fi +done +log_info "Syntax check complete ✓" + +# Summary +log_info "=== Validation Complete ===" +log_info "All checks passed! ✓" +log_info "" +log_info "Project structure:" +log_info " Firmware: $FW" +log_info " Decompiled: $COUNT files" +log_info " Driver modules: 7 (core, rpc, vf, bar, wpr, migration, debugfs)" +log_info " Wiki docs: 10 files" +log_info " Kernel tests: 4 test modules + Makefile" +log_info " Userspace tests: 1 test + Makefile" +log_info " Integration: run_integration_tests.sh" +log_info " CI/CD: GitHub Actions" +log_info " README: Project documentation" + +exit 0
\ No newline at end of file |
