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 /tools/module_ops/load_converged.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 'tools/module_ops/load_converged.sh')
| -rwxr-xr-x | tools/module_ops/load_converged.sh | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/tools/module_ops/load_converged.sh b/tools/module_ops/load_converged.sh new file mode 100755 index 0000000..dbd090e --- /dev/null +++ b/tools/module_ops/load_converged.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# Load vGPU stack in converged mode +# Usage: sudo ./load_converged.sh [dry_run] + +set -euo pipefail + +OPEN_IOV_ROOT="${OPEN_IOV_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}" +NVIDIA_OPEN_KERNEL="$OPEN_IOV_ROOT/nvidia-open-gpu-kernel-modules/kernel-open" +VGPU_KERNEL="$OPEN_IOV_ROOT/kernel" + +DRY_RUN="${1:-false}" + +echo "=== Open-IOV Converged Mode Module Load ===" +echo "Open-IOV Root: $OPEN_IOV_ROOT" +echo "Dry-run mode: $DRY_RUN" +echo "" + +# Function to check if module is loaded +is_loaded() { + lsmod | grep -q "^$1 " +} + +# Function to load module with error checking +load_module() { + local module_path=$1 + local module_name=$(basename $module_path .ko) + local params="${2:-}" + + if is_loaded "$module_name"; then + echo "Module $module_name already loaded" + return 0 + fi + + echo "Loading $module_name..." + if sudo insmod "$module_path" $params; then + echo " ✓ $module_name loaded successfully" + return 0 + else + echo " ✗ Failed to load $module_name" + return 1 + fi +} + +# 1. Load mdev core +echo "Step 1: Loading mdev core module..." +sudo modprobe mdev +echo " ✓ mdev loaded" +echo "" + +# 2. Load host nvidia.ko with vGPU support +echo "Step 2: Loading host nvidia.ko (patched open-gpu-kernel-modules)..." +load_module "$NVIDIA_OPEN_KERNEL/nvidia.ko" "NVreg_RegisterPCIDriver=1 NVreg_RmMsg=:" +echo "" + +# 3. Load dependent modules +echo "Step 3: Loading dependent modules..." +load_module "$NVIDIA_OPEN_KERNEL/nvidia-modeset.ko" +load_module "$NVIDIA_OPEN_KERNEL/nvidia-uvm.ko" +load_module "$NVIDIA_OPEN_KERNEL/nvidia-drm.ko" +load_module "$NVIDIA_OPEN_KERNEL/nvidia-peermem.ko" +echo "" + +# 4. Load nvidia-vgpu-vfio.ko +echo "Step 4: Loading nvidia-vgpu-vfio.ko..." +if [ "$DRY_RUN" = "dry_run" ] || [ "$DRY_RUN" = "true" ]; then + echo " Running in DRY-RUN mode first..." + load_module "$VGPU_KERNEL/nvidia-vgpu-vfio.ko" "dyndbg='+p' dry_run=1" + echo " Dry-run successful, unloading..." + sudo rmmod nvidia-vgpu-vfio + echo " Loading for real..." + load_module "$VGPU_KERNEL/nvidia-vgpu-vfio.ko" "dyndbg='+p'" +else + load_module "$VGPU_KERNEL/nvidia-vgpu-vfio.ko" "dyndbg='+p'" +fi +echo "" + +# 5. Verify +echo "Step 5: Verifying vGPU registration..." +sleep 2 +if [ -d "/sys/bus/pci/devices/0000:01:00.0/mdev_supported_types" ]; then + echo " ✓ mdev_supported_types directory exists" + ls -la /sys/bus/pci/devices/0000:01:00.0/mdev_supported_types/ +else + echo " ✗ mdev_supported_types NOT found" + echo " Check dmesg for errors: dmesg -T | grep -i vgpu" + exit 1 +fi + +echo "" +echo "=== Converged Mode Load Complete ===" +echo "" +echo "Next steps:" +echo " - Create mdev device: echo <uuid> | sudo tee /sys/bus/pci/devices/0000:01:00.0/mdev_supported_types/nvidia-vgpu-turing/create" +echo " - Run QEMU with vGPU passthrough" +echo " - Run tests: $OPEN_IOV_ROOT/tools/test/run_integration_tests.sh"
\ No newline at end of file |
