Skip to main content

GPU Acceleration

GPU acceleration is optional and compile-time gated in storage-engine.

Compile-Time Gate

  • Storage-engine feature: gpu-accel
  • CUDA-specific code inside plugin crate is behind plugin feature cuda

Without CUDA-enabled runtime support, GPU paths report no device and execution stays on CPU paths.

Code anchors:

  • services/storage-engine/Cargo.toml
  • plugins/gpu-accel/src/lib.rs
  • services/storage-engine/src/hnsw/distance/dispatch.rs

Runtime Variables

Representative variables (see plugins/gpu-accel/src/config.rs):

  • GPU_ACCEL_ENABLED
  • GPU_ACCEL_DEVICE_ID
  • GPU_ACCEL_BATCH_THRESHOLD
  • GPU_ACCEL_MAX_MEMORY_MB
  • GPU_ACCEL_VECTOR_CACHE_MB
  • GPU_ACCEL_BLOCK_SIZE
  • GPU_ACCEL_PRIORITY_SCHEDULING
  • GPU_ACCEL_MULTI_QUERY_BATCHING
  • GPU_ACCEL_GPU_RERANKING

Build Example

cd services/storage-engine
cargo build --release --features gpu-accel