AlpaSim consists of several microservices that work together to create a complete autonomous vehicle simulation. Each service has a specific responsibility and communicates via gRPC.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NVlabs/alpasim/llms.txt
Use this file to discover all available pages before exploring further.
Service overview
Runtime - Simulation orchestrator
Runtime - Simulation orchestrator
The runtime is the central coordinator of the simulation.Location:
/src/runtimeResponsibilities:- Drives the main simulation loop
- Maintains the world state
- Coordinates all service communications
- Acts as a load balancer for replicated services
- Generates synchronized logs
- Manages simulation timing and timesteps
- Role: gRPC client
- Connects to: All other services
- Must know: Addresses of all microservices
Driver - Ego vehicle policy
Driver - Ego vehicle policy
The driver service runs the autonomous driving policy network.Location:
/src/driverResponsibilities:- Executes the egovehicle policy network
- Processes sensor inputs
- Generates driving trajectories
- Makes planning decisions
- Role: gRPC server
- Receives: Sensor data, ego state, route information
- Returns: Planned trajectory in local frame
- Receives noised ego position in
localframe - Returns waypoints in what it thinks is
localframe (actually noised) - Runtime translates from noisy frame to true
localframe
The driver typically has the highest computational requirements of all services, especially when using neural network policies.
Controller - Vehicle dynamics
Controller - Vehicle dynamics
The controller models the vehicle controller and dynamics.Location:
/src/controllerResponsibilities:- Models vehicle controller behavior
- Simulates vehicle dynamics
- Provides egomotion estimates
- Translates planned paths to vehicle actuation
- Role: gRPC server
- Receives: Current
pose_local_to_rig, velocities, reference trajectory inrigframe - Returns: Future
local->rigposes and estimates
Physics - Ground constraints
Physics - Ground constraints
The physics service applies physical constraints to keep vehicles grounded.Location:
/src/physicsResponsibilities:- Applies ground mesh constraints
- Ensures vehicles stay on the road surface
- Constrains both ego vehicle and traffic actors
- Provides physically plausible motion
- Role: gRPC server
- Receives: Ego and traffic poses as
local -> AABBtransformations - Returns: Constrained poses in same frame
Physics precision is a non-goal. The physics service provides “good enough” constraints to keep vehicles on roads, not high-fidelity physics simulation.
Sensorsim - Neural rendering
Sensorsim - Neural rendering
The sensorsim service uses Neural Rendering Engine (NRE) for sensor simulation.Location: Separate NRE service (integration details in
/src/grpc)Responsibilities:- Renders camera frames using neural rendering
- Provides high-fidelity sensor simulation
- Simulates camera responses to world state
- Handles multiple camera configurations
- Role: gRPC server
- Receives:
- Rig trajectory in
localframe - Per-camera calibration
rig->sensor_pose local->AABBtrajectories for dynamic objects
- Rig trajectory in
- Returns: Rendered camera images
- Second-highest load after driver
- Typically requires GPU acceleration
- Benefits significantly from horizontal scaling
Trafficsim - Non-ego actors
Trafficsim - Non-ego actors
The traffic simulation service actuates non-ego actors.Location: Coming soonResponsibilities:
- Simulates pedestrians, vehicles, and other actors
- Neural traffic behavior modeling
- Provides realistic traffic patterns
- Actuates non-ego entities
- Role: gRPC server
- Receives: World state bounding boxes in
local -> AABBframe - Returns: Updated actor positions and states
The neural traffic simulator is under development. Current versions may use simpler traffic models.
Eval - Metrics and evaluation
Eval - Metrics and evaluation
The evaluation module processes simulation logs to compute metrics.Location:
/src/evalResponsibilities:- Processes simulation logs after completion
- Computes autonomous driving metrics
- Analyzes driving performance
- Generates evaluation reports
- Role: Standalone tool (not in simulation loop)
- Reads: Log files produced by runtime
- Outputs: Metrics and evaluation results
gRPC communication
All services communicate using gRPC with Protocol Buffers.Protocol definitions
The gRPC API is defined in/src/grpc/:
Service communication pattern
- Runtime initiates all requests
- Services respond with computed results
- No service-to-service communication
- Runtime coordinates the simulation loop
Scalability and deployment
Horizontal scaling
Services can be replicated based on computational needs:- Docker Compose
- Slurm
- Custom
Single-machine deployment with all services:
Service discovery
The runtime needs to be configured with service addresses:- Services run as daemons on known ports
- Runtime configuration specifies service endpoints
- No dynamic service discovery required
- Simple and predictable networking model
Performance considerations
Computational load hierarchy
Typical resource requirements (highest to lowest):- Driver - Neural network inference
- Sensorsim - Neural rendering
- Controller - Vehicle dynamics simulation
- Trafficsim - Traffic simulation
- Physics - Ground constraints
Bottlenecks
- Runtime I/O - All communication flows through runtime
- Sensorsim rendering - GPU-intensive neural rendering
- Driver inference - Neural network forward passes
Optimization strategies
- Scale expensive services (sensorsim, driver) horizontally
- Use GPU hardware for rendering and inference
- Optimize runtime communication patterns
- Batch operations where possible