Skip to content

[AI] Gate AMD/OpenVINO setup on actual EP availability#20945

Merged
TurboGit merged 1 commit intodarktable-org:masterfrom
andriiryzhkov:fix_20926
May 5, 2026
Merged

[AI] Gate AMD/OpenVINO setup on actual EP availability#20945
TurboGit merged 1 commit intodarktable-org:masterfrom
andriiryzhkov:fix_20926

Conversation

@andriiryzhkov
Copy link
Copy Markdown
Collaborator

Gate AMD MIOpen/MIGraphX cache setup and OpenVINO V2 setup on actual EP availability (OrtApi::GetAvailableProviders) instead of the /opt/rocm directory check.

Reported in #20926: on Fedora distro-packaged ROCm (no /opt/rocm) and side-by-side installs (/opt/rocm-X.Y), the cache env vars were never set, so every launch recompiled MIOpen kernels (10+ minutes on consumer AMD) and the MIGraphX graph.

Fix

  • New file-static helper _ort_has_provider(name) wrapping GetAvailableProviders. Safe to call before CreateEnv (does not load any EP).
  • _setup_amd_caches(): replace g_file_test("/opt/rocm", ...) with _ort_has_provider("MIGraphXExecutionProvider").
  • _try_openvino_with_cache(): add _ort_has_provider("OpenVINOExecutionProvider") before the existing V2 function-pointer check. Both are required - EP must be compiled in and the V2 API must exist.

Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@TurboGit TurboGit merged commit b9dccdc into darktable-org:master May 5, 2026
5 checks passed
@TurboGit TurboGit added the bugfix pull request fixing a bug label May 5, 2026
@andriiryzhkov andriiryzhkov deleted the fix_20926 branch May 6, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants