Skip to content

Add optional ONNX Runtime GPU backends - #1

Merged
mowshon merged 1 commit into
mainfrom
gpu_support
Jun 24, 2026
Merged

mowshon merged 1 commit into
mainfrom
gpu_support

Conversation

@mowshon

@mowshon mowshon commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move ONNX Runtime out of base dependencies and add explicit backend extras: cpu, cuda, and directml
  • Add shared ONNX Runtime provider resolution with clear errors for missing CUDA/DirectML providers
  • Add CUDA/cuDNN preload support and DirectML-safe session options/run locking
  • Make import lvface safe without optional runtime, detector, or hub dependencies installed
  • Update install docs, CI, tests, and changelog for the 0.2.0 release

Notable Fixes

  • Replaced onnxruntime-gpu[cuda,cudnn] with explicit current CUDA 13 NVIDIA packages because the ORT extra currently resolves to deprecated/broken *-cu13 packages on Windows
  • Kept Windows os.add_dll_directory() handles alive so DLL search paths are not dropped
  • Ensured device="cuda" and device="directml" fail clearly instead of silently falling back to CPU
  • Ensured InsightFace uses GPU context for CUDA and DirectML, and CPU context only for pure CPU

Validation

  • ruff check src tests
  • ruff format --check src tests
  • mypy src
  • pytest
  • python -m build
  • python -m twine check --strict dist/*
  • Base install/import checked on Python 3.11, 3.12, and 3.13
  • Windows win_amd64 dry-run dependency resolution checked for CPU and DirectML on Python 3.11, 3.12, and 3.13
  • Local .[cuda] dry-run dependency resolution checked with explicit CUDA packages

@mowshon
mowshon merged commit 2c51d07 into main Jun 24, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant