Skip to content

10. GPU Acceleration

Estimated time: 15 minutes

Learn how to use GPU acceleration with Annie (if supported).

Steps

  1. Check GPU support:
  2. Ensure your hardware and drivers are compatible.
  3. Enable GPU usage:
  4. Set the appropriate flag or environment variable.

Example

# Example only if GPU support is available
index = AnnIndex(128, Distance.EUCLIDEAN, use_gpu=True)

Next: Performance Optimization