public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onnxruntime] rawhide: Add migraphx backend
@ 2026-06-26 23:56 Tom Rix
  0 siblings, 0 replies; only message in thread
From: Tom Rix @ 2026-06-26 23:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/onnxruntime
            Branch : rawhide
            Commit : cd90c5331b339be84d8d3fb725ac0694bdf261a0
            Author : Tom Rix <Tom.Rix@amd.com>
            Date   : 2026-06-26T23:55:49+00:00
            Stats  : +86/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/onnxruntime/c/cd90c5331b339be84d8d3fb725ac0694bdf261a0?branch=rawhide

            Log:
            Add migraphx backend

In preparation for 1.23 when the rocm backend will be removed,
add conditionally off migraphx backend as the rocm replacement.
Because rocm will removed, reuse rocm paths.

Signed-off-by: Tom Rix <Tom.Rix@amd.com>

---
diff --git a/onnxruntime.spec b/onnxruntime.spec
index 35526e6..75ad76f 100644
--- a/onnxruntime.spec
+++ b/onnxruntime.spec
@@ -11,6 +11,9 @@
 %bcond rocm 0
 %endif
 
+%bcond migraphx 0
+
+%bcond migraphx_test 0
 %bcond rocm_test 0
 %bcond test 1
 
@@ -20,6 +23,9 @@
 %if %{with rocm}
 %global backends %backends rocm
 %endif
+%if %{with migraphx}
+%global backends %backends migraphx
+%endif
 
 Summary:    A cross-platform inferencing and training accelerator
 Name:       onnxruntime
@@ -141,6 +147,10 @@ BuildRequires:  rocthrust-devel
 BuildRequires:  roctracer-devel
 %endif
 
+%if %{with migraphx}
+BuildRequires:  migraphx-devel
+%endif
+
 Provides:       bundled(utf8_range)
 
 %description
@@ -177,6 +187,28 @@ Requires:   %{name}-rocm%{_isa} = %{version}-%{release}
 %{summary}
 %endif
 
+%if %{with migraphx}
+%package migraphx
+Summary:    The MIGraphX runtime backend for the %{name} package
+
+%description migraphx
+%{summary}
+
+%package migraphx-devel
+Summary:    The MIGraphX development part of the %{name} package
+Requires:   %{name}-migraphx%{_isa} = %{version}-%{release}
+
+%description migraphx-devel
+%{summary}
+
+%package migraphx-test
+Summary:    The MIGraphX tests for the %{name} package
+Requires:   %{name}-migraphx%{_isa} = %{version}-%{release}
+
+%description migraphx-test
+%{summary}
+%endif
+
 %package -n python3-onnxruntime
 Summary:    %{summary}
 Requires:   %{name}%{_isa} = %{version}-%{release}
@@ -264,6 +296,26 @@ backend=rocm
 %cmake_build
 %endif
 
+%if %{with migraphx}
+backend=migraphx
+%cmake %cmake_config \
+    -DCMAKE_INSTALL_BINDIR=%{_lib}/rocm/bin \
+    -DCMAKE_INSTALL_INCLUDEDIR=%{_lib}/rocm/include \
+    -DCMAKE_INSTALL_LIBDIR=%{_lib}/rocm/lib \
+    -Donnxruntime_ENABLE_CPUINFO=ON \
+    -DCMAKE_HIP_PLATFORM=amd \
+%if %{with migraphx_test}
+    -Donnxruntime_INSTALL_UNIT_TESTS=ON \
+%else
+    -Donnxruntime_INSTALL_UNIT_TESTS=OFF \
+%endif
+    -Donnxruntime_ROCM_HOME=%{_prefix} \
+    -Donnxruntime_USE_COMPOSABLE_KERNEL=OFF \
+    -Donnxruntime_USE_MIGRAPHX=ON
+
+%cmake_build
+%endif
+
 backend=cpu
 %cmake %cmake_config \
     -DCMAKE_INSTALL_LIBDIR=%{_lib} \
@@ -288,6 +340,11 @@ backend=rocm
 %cmake_install
 %endif
 
+%if %{with migraphx}
+backend=migraphx
+%cmake_install
+%endif
+
 backend=cpu
 %cmake_install
 mkdir -p "%{buildroot}/%{_docdir}/"
@@ -301,6 +358,12 @@ ln -s "../../../../libonnxruntime_providers_shared.so.%{version}" "%{buildroot}/
 %if %{with test}
 %check
 
+%if %{with migraphx_test}
+backend=migraphx
+export GTEST_FILTER=-CApiTensorTest.load_huge_tensor_with_external_data
+%ctest
+%endif
+
 %if %{with rocm_test}
 backend=rocm
 export GTEST_FILTER=-CApiTensorTest.load_huge_tensor_with_external_data
@@ -357,6 +420,29 @@ export GTEST_FILTER=-CApiTensorTest.load_huge_tensor_with_external_data
 %endif
 %endif
 
+%if %{with migraphx}
+%files migraphx
+%license LICENSE
+%doc ThirdPartyNotices.txt
+%{_libdir}/rocm/lib/libonnxruntime.so.%{version}
+%{_libdir}/rocm/lib/libonnxruntime_providers_shared.so.%{version}
+%{_libdir}/rocm/lib/libonnxruntime_providers_migraphx.so
+
+%files migraphx-devel
+%dir %{_libdir}/rocm/include/onnxruntime/
+%dir %{_libdir}/rocm/lib/cmake/onnxruntime/
+%{_libdir}/rocm/include/onnxruntime/*
+%{_libdir}/rocm/lib/libonnxruntime.so*
+%{_libdir}/rocm/lib/libonnxruntime_providers_shared.so
+%{_libdir}/rocm/lib/pkgconfig/libonnxruntime.pc
+%{_libdir}/rocm/lib/cmake/onnxruntime/*
+
+%if %{with migraphx_test}
+%files migraphx-test
+%{_libdir}/rocm/bin/*
+%endif
+%endif
+
 %changelog
 %autochangelog
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-26 23:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-26 23:56 [rpms/onnxruntime] rawhide: Add migraphx backend Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox