AetherVM provides two GPU virtualization approaches:
- Virtual GPU (vGPU): Software-emulated GPU using WebGPU/Vulkan
- GPU Passthrough: Direct hardware access via VFIO
The virtual GPU uses WebGPU as its backend, providing:
- Cross-platform compatibility
- Shader compilation and execution
- Graphics pipeline emulation
- Compute shader support
use aethervm_gpu::vgpu::VirtualGpu;
let mut vgpu = VirtualGpu::new("default-gpu");
vgpu.init().await?;- IOMMU enabled in BIOS
- VT-d (Intel) or AMD-Vi support
- GPU in separate IOMMU group
- Host driver unbound from device
[gpu]
enabled = true
passthrough = true
device = "0000:01:00.0"
vendor_id = "10de" # NVIDIA# Enable IOMMU in kernel parameters
# Add to /etc/default/grub:
GRUB_CMDLINE_LINUX="intel_iommu=on iommu=pt"
# Update grub
sudo update-grub
# Unbind GPU from host driver
echo "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/unbind
# Bind to vfio-pci
echo "10de 1b80" > /sys/bus/pci/drivers/vfio-pci/new_id- Graphics: OpenGL, Vulkan, DirectX
- Compute: CUDA, OpenCL, ROCm
- AI/ML: TensorFlow, PyTorch GPU acceleration
- Gaming: Cloud gaming, game streaming
| Mode | Latency | Throughput | Compatibility |
|---|---|---|---|
| vGPU | Medium | Medium | High |
| Passthrough | Low | Native | Medium |
let vm = AgentVM::builder()
.name("cuda-vm")
.cpu_cores(8)
.memory_gb(16)
.enable_gpu(true)
.build()
.await?;
// GPU is available inside VM
vm.execute_agent_script(r#"
// Run CUDA code
cuda_available()
"#).await?;let vm = AgentVM::builder()
.name("gaming-vm")
.cpu_cores(6)
.memory_gb(16)
.enable_gpu(true)
.build()
.await?;
// Optimized for low latency