Skip to content

[AI] Add GPU-accelerated ONNX Runtime install scripts and DT_ORT_LIBRARY env var#20647

Draft
andriiryzhkov wants to merge 1 commit intodarktable-org:masterfrom
andriiryzhkov:ort_gpu
Draft

[AI] Add GPU-accelerated ONNX Runtime install scripts and DT_ORT_LIBRARY env var#20647
andriiryzhkov wants to merge 1 commit intodarktable-org:masterfrom
andriiryzhkov:ort_gpu

Conversation

@andriiryzhkov
Copy link
Contributor

Addresses #20532. This still WIP and I will need help testing script on different hardware. But the general ideas is that we bundle with minimal GPU acceleration support and providing a way to setup improved configuration if needed. It solved the problem of bundling conflicting Execution Provides.

Summary

Enables GPU acceleration for AI features on Linux (and optionally Windows) without rebuilding darktable.

  • Add DT_ORT_LIBRARY environment variable to load a user-supplied ONNX Runtime at startup, overriding the bundled library. Works on all platforms (Linux, Windows, macOS).
  • Add install scripts for NVIDIA (CUDA), AMD (MIGraphX), and Intel (OpenVINO):
    • install-ort-nvidia.sh / .ps1 – downloads prebuilt ORT with CUDA EP
    • install-ort-amd.sh – downloads prebuilt wheel from AMD's repo
    • install-ort-amd-build.sh – builds ORT from source (fallback for ABI mismatches)
    • install-ort-intel.sh – downloads prebuilt ORT with OpenVINO EP
  • Scripts auto-detect the system (distro, driver, ROCm version) and provide distro-specific install hints for missing dependencies
  • Log loaded ORT version on startup with -d ai
  • Add tools/ai/README.md with detailed requirements and manual install instructions

What's NOT changed

  • Default bundled ORT (CPU on Linux, DirectML on Windows, CoreML on macOS) is unchanged
  • No build system changes – scripts are standalone, users run them post-install
  • No new build dependencies

@andriiryzhkov andriiryzhkov marked this pull request as draft March 23, 2026 14:52
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