Skip to content

Commit bf749a7

Browse files
committed
Add GPU ORT install: manifest-driven UI button, scripts, and EP support
1 parent ab3ca1a commit bf749a7

File tree

11 files changed

+2329
-5
lines changed

11 files changed

+2329
-5
lines changed

data/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ if(USE_AI)
171171
#
172172
FILE(COPY ai_models.json DESTINATION "${DARKTABLE_DATADIR}")
173173
install(FILES ai_models.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/darktable COMPONENT DTApplication)
174+
FILE(COPY ort_gpu.json DESTINATION "${DARKTABLE_DATADIR}")
175+
install(FILES ort_gpu.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/darktable COMPONENT DTApplication)
174176
endif(USE_AI)
175177

176178
#

data/ort_gpu.json

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"version": 1,
3+
"packages": [
4+
{
5+
"vendor": "nvidia",
6+
"platform": "linux",
7+
"arch": "x86_64",
8+
"ort_version": "1.24.4",
9+
"url": "https://github.com/microsoft/onnxruntime/releases/download/v1.24.4/onnxruntime-linux-x64-gpu-1.24.4.tgz",
10+
"sha256": "c5f804ff5d239b436fa59e9f2fb288a39f7eb9552f6a636c8b71e792e91a8808",
11+
"format": "tgz",
12+
"lib_pattern": "libonnxruntime",
13+
"install_subdir": "onnxruntime-cuda",
14+
"size_mb": 200,
15+
"requirements": "NVIDIA driver 525+, CUDA 12.x, cuDNN 9.x"
16+
},
17+
{
18+
"vendor": "nvidia",
19+
"platform": "windows",
20+
"arch": "x86_64",
21+
"ort_version": "1.24.4",
22+
"url": "https://github.com/microsoft/onnxruntime/releases/download/v1.24.4/onnxruntime-win-x64-gpu-1.24.4.zip",
23+
"sha256": "ef3337a0b8184eb8beec310f7c83bd50376b3eefc43aab84ac8e452f6987df0a",
24+
"format": "zip",
25+
"lib_pattern": "onnxruntime",
26+
"install_subdir": "onnxruntime-cuda",
27+
"size_mb": 200,
28+
"requirements": "NVIDIA driver 525+, CUDA 12.x, cuDNN 9.x"
29+
},
30+
{
31+
"vendor": "amd",
32+
"platform": "linux",
33+
"arch": "x86_64",
34+
"rocm_min": "7.2",
35+
"rocm_max": "7.2",
36+
"ort_version": "1.23.2",
37+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/onnxruntime_migraphx-1.23.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
38+
"sha256": "45d556a6c261383f3e1f1469764a6ce94dc9daaa65fc3d494406d9cd357a3656",
39+
"format": "whl",
40+
"lib_pattern": "libonnxruntime",
41+
"install_subdir": "onnxruntime-migraphx",
42+
"size_mb": 300,
43+
"requirements": "ROCm 7.2, MIGraphX"
44+
},
45+
{
46+
"vendor": "amd",
47+
"platform": "linux",
48+
"arch": "x86_64",
49+
"rocm_min": "7.1",
50+
"rocm_max": "7.1",
51+
"ort_version": "1.23.1",
52+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1/onnxruntime_migraphx-1.23.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
53+
"format": "whl",
54+
"lib_pattern": "libonnxruntime",
55+
"install_subdir": "onnxruntime-migraphx",
56+
"size_mb": 300,
57+
"requirements": "ROCm 7.1, MIGraphX"
58+
},
59+
{
60+
"vendor": "amd",
61+
"platform": "linux",
62+
"arch": "x86_64",
63+
"rocm_min": "7.0",
64+
"rocm_max": "7.0",
65+
"ort_version": "1.22.1",
66+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/onnxruntime_rocm-1.22.1-cp312-cp312-linux_x86_64.whl",
67+
"format": "whl",
68+
"lib_pattern": "libonnxruntime",
69+
"install_subdir": "onnxruntime-migraphx",
70+
"size_mb": 300,
71+
"requirements": "ROCm 7.0, MIGraphX"
72+
},
73+
{
74+
"vendor": "amd",
75+
"platform": "linux",
76+
"arch": "x86_64",
77+
"rocm_min": "6.4",
78+
"rocm_max": "6.4",
79+
"ort_version": "1.21.0",
80+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4/onnxruntime_rocm-1.21.0-cp312-cp312-linux_x86_64.whl",
81+
"format": "whl",
82+
"lib_pattern": "libonnxruntime",
83+
"install_subdir": "onnxruntime-migraphx",
84+
"size_mb": 300,
85+
"requirements": "ROCm 6.4, MIGraphX"
86+
},
87+
{
88+
"vendor": "amd",
89+
"platform": "linux",
90+
"arch": "x86_64",
91+
"rocm_min": "6.3",
92+
"rocm_max": "6.3",
93+
"ort_version": "1.19.0",
94+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.3/onnxruntime_rocm-1.19.0-cp312-cp312-linux_x86_64.whl",
95+
"format": "whl",
96+
"lib_pattern": "libonnxruntime",
97+
"install_subdir": "onnxruntime-migraphx",
98+
"size_mb": 300,
99+
"requirements": "ROCm 6.3, MIGraphX"
100+
},
101+
{
102+
"vendor": "amd",
103+
"platform": "linux",
104+
"arch": "x86_64",
105+
"rocm_min": "6.2",
106+
"rocm_max": "6.2",
107+
"ort_version": "1.18.0",
108+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.2/onnxruntime_rocm-1.18.0-cp312-cp312-linux_x86_64.whl",
109+
"format": "whl",
110+
"lib_pattern": "libonnxruntime",
111+
"install_subdir": "onnxruntime-migraphx",
112+
"size_mb": 300,
113+
"requirements": "ROCm 6.2, MIGraphX"
114+
},
115+
{
116+
"vendor": "amd",
117+
"platform": "linux",
118+
"arch": "x86_64",
119+
"rocm_min": "6.1",
120+
"rocm_max": "6.1",
121+
"ort_version": "1.17.0",
122+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1/onnxruntime_rocm-1.17.0-cp312-cp312-linux_x86_64.whl",
123+
"format": "whl",
124+
"lib_pattern": "libonnxruntime",
125+
"install_subdir": "onnxruntime-migraphx",
126+
"size_mb": 300,
127+
"requirements": "ROCm 6.1, MIGraphX"
128+
},
129+
{
130+
"vendor": "amd",
131+
"platform": "linux",
132+
"arch": "x86_64",
133+
"rocm_min": "6.0",
134+
"rocm_max": "6.0",
135+
"ort_version": "1.16.0",
136+
"url": "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.0/onnxruntime_rocm-1.16.0-cp312-cp312-linux_x86_64.whl",
137+
"format": "whl",
138+
"lib_pattern": "libonnxruntime",
139+
"install_subdir": "onnxruntime-migraphx",
140+
"size_mb": 300,
141+
"requirements": "ROCm 6.0, MIGraphX"
142+
},
143+
{
144+
"vendor": "intel",
145+
"platform": "linux",
146+
"arch": "x86_64",
147+
"ort_version": "1.24.1",
148+
"url": "https://files.pythonhosted.org/packages/50/cf/17ba72de2df0fcba349937d2788f154397bbc2d1a2d67772a97e26f6bc5f/onnxruntime_openvino-1.24.1-cp312-cp312-manylinux_2_28_x86_64.whl",
149+
"sha256": "d617fac2f59a6ab5ea59a788c3e1592240a129642519aaeaa774761dfe35150e",
150+
"format": "whl",
151+
"lib_pattern": "libonnxruntime",
152+
"install_subdir": "onnxruntime-openvino",
153+
"size_mb": 60,
154+
"requirements": "Intel GPU driver (OpenCL)"
155+
},
156+
{
157+
"vendor": "intel",
158+
"platform": "windows",
159+
"arch": "x86_64",
160+
"ort_version": "1.24.1",
161+
"url": "https://files.pythonhosted.org/packages/59/37/d301f2c68b19a9485ed5db3047e0fb52478f3e73eb08c7d2a7c61be7cc1c/onnxruntime_openvino-1.24.1-cp312-cp312-win_amd64.whl",
162+
"sha256": "f186335a9c9b255633275290da7521d3d4d14c7773fee3127bfa040234d3fa5a",
163+
"format": "whl",
164+
"lib_pattern": "onnxruntime",
165+
"install_subdir": "onnxruntime-openvino",
166+
"size_mb": 60,
167+
"requirements": "Intel GPU driver"
168+
}
169+
]
170+
}

src/ai/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ add_library(darktable_ai STATIC
44
backend.h
55
backend_common.c
66
backend_onnx.c
7+
ort_install.c
8+
ort_install.h
79
)
810

911
# Find ONNX Runtime (auto-downloads if not present)
@@ -60,6 +62,18 @@ target_link_libraries(darktable_ai PUBLIC
6062
${JSON_GLIB_LIBRARIES}
6163
)
6264

65+
# ort_install.c needs curl and libarchive for download/extraction
66+
find_package(CURL 7.56 QUIET)
67+
find_package(LibArchive QUIET)
68+
if(CURL_FOUND AND LibArchive_FOUND)
69+
target_compile_definitions(darktable_ai PRIVATE HAVE_AI_DOWNLOAD)
70+
target_include_directories(darktable_ai PRIVATE
71+
${LibArchive_INCLUDE_DIRS})
72+
target_link_libraries(darktable_ai PRIVATE
73+
CURL::libcurl
74+
${LibArchive_LIBRARIES})
75+
endif()
76+
6377
# Install the bundled ONNX Runtime shared library alongside darktable_ai
6478
# (skip when using system package — it's already in the system library path)
6579
if(ONNXRuntime_SYSTEM_PACKAGE)

src/ai/backend_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const dt_ai_provider_desc_t dt_ai_providers[DT_AI_PROVIDER_COUNT] = {
3939
#endif
4040
},
4141
{ DT_AI_PROVIDER_CUDA, "CUDA", "NVIDIA CUDA",
42-
#if defined(__linux__)
42+
#if defined(__linux__) || defined(_WIN32)
4343
1
4444
#else
4545
0
@@ -53,7 +53,7 @@ const dt_ai_provider_desc_t dt_ai_providers[DT_AI_PROVIDER_COUNT] = {
5353
#endif
5454
},
5555
{ DT_AI_PROVIDER_OPENVINO, "OpenVINO", "Intel OpenVINO",
56-
#if defined(__linux__) || (defined(__APPLE__) && defined(__x86_64__))
56+
#if defined(__linux__) || defined(_WIN32)
5757
1
5858
#else
5959
0

0 commit comments

Comments
 (0)