%global upstreamname MIVisionX %global rocm_release 6.3 %global rocm_patch 1 %global rocm_version %{rocm_release}.%{rocm_patch} %global toolchain rocm # hipcc does not support some clang flags %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/') %global amdgpu_targets "gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx942;gfx1010;gfx1012;gfx1030;gfx1031;gfx1035;gfx1100;gfx1101;gfx1102;gfx1103;gfx1151" # For testing %global _amdgpu_targets "gfx1100" Name: mivisionx Version: %{rocm_version} Release: 1%{?dist} Summary: AMD's computer vision toolkit Url: https://github.com/ROCm/%{upstreamname} License: MIT Source0: %{url}/archive/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz BuildRequires: chrpath BuildRequires: cmake %if 0%{?fedora} || 0%{?suse_version} BuildRequires: fdupes %endif BuildRequires: half-devel BuildRequires: hipcc # Problem with ffmpeg # /MIVisionX-rocm-6.3.1/amd_openvx_extensions/amd_media/kernels.cpp:98:5: error: use of undeclared identifier 'av_register_all' # 98 | av_register_all(); # | ^ # BuildRequires: ffmpeg-free-devel BuildRequires: libavcodec-free-devel BuildRequires: libavformat-free-devel BuildRequires: mesa-va-drivers BuildRequires: miopen-devel BuildRequires: opencv-devel BuildRequires: rocblas-devel BuildRequires: rocm-cmake BuildRequires: rocm-compilersupport-macros BuildRequires: rocm-hip-devel BuildRequires: rocm-omp-devel BuildRequires: rocm-rpm-macros BuildRequires: rocm-rpp-devel BuildRequires: rocm-runtime-devel # Only x86_64 works right now: ExclusiveArch: x86_64 %description MIVisionX toolkit is a set of comprehensive computer vision and machine intelligence libraries, utilities, and applications bundled into a single toolkit. AMD MIVisionX delivers highly optimized conformant open-source implementation of the Khronos OpenVX™ and OpenVX™ Extensions along with Convolution Neural Net Model Compiler & Optimizer supporting ONNX, and Khronos NNEF™ exchange formats. The toolkit allows for rapid prototyping and deployment of optimized computer vision and machine learning inference workloads on a wide range of computer hardware, including small embedded x86 CPUs, APUs, discrete GPUs, and heterogeneous servers. %package devel Summary: Libraries and headers for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary} %prep %autosetup -p1 -n %{upstreamname}-rocm-%{version} # Remove some cruft find . -type f -name '.gitignore' -delete find . -type f -name '.DS_Store' -delete # #include -> for f in `find . -type f -name '*.hpp' -o -name '*.cpp' `; do sed -i -e 's@#include @#include @' $f done # Fixup default ROCM_PATH sed -i -e 's@/opt/rocm@%{_prefix}@' CMakeLists.txt %build rocm_clang=`hipconfig -l`/clang++ %cmake \ -DAMDGPU_TARGETS=%{amdgpu_targets} \ -DCMAKE_CXX_COMPILER=$rocm_clang \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DHIP_PLATFORM=amd \ -DROCM_SYMLINK_LIBS=OFF %cmake_build %install %cmake_install #Clean up dupes: %if 0%{?fedora} || 0%{?suse_version} %fdupes %{buildroot}%{_prefix} %endif # ERROR 0020: file '/usr/lib64/libvx_amd_custom.so.1.0.1' contains a runpath referencing '..' of an absolute path [:/usr/lib64/rocm/llvm/bin/../lib] chrpath -r %{rocmllvm_libdir} %{buildroot}%{_libdir}/libvx_amd_custom.so.1.*.* if [ -f %{buildroot}%{_prefix}/share/doc/%{name}/LICENSE.txt ]; then rm %{buildroot}%{_prefix}/share/doc/%{name}/LICENSE.txt fi if [ -f %{buildroot}%{_prefix}/share/doc/%{name}-asan/LICENSE.txt ]; then rm %{buildroot}%{_prefix}/share/doc/%{name}-asan/LICENSE.txt fi # E: hardlink-across-partition /usr/share/mivisionx/apps rm -rf %{buildroot}%{_datadir}/%{name}/apps rm -rf %{buildroot}%{_datadir}/%{name}/samples rm -rf %{buildroot}%{_datadir}/%{name}/test %files %license LICENSE.txt %{_bindir}/runvx %{_libdir}/libopenvx.so.1{,.*} %{_libdir}/libvx_amd_custom.so.1{,.*} %{_libdir}/libvx_opencv.so.1{,.*} %{_libdir}/libvx_nn.so.1{,.*} %{_libdir}/libvx_rpp.so.1{,.*} %{_libdir}/libvxu.so.1{,.*} %files devel %doc README.md %{_datadir}/%{name}/ %{_includedir}/%{name}/ %{_libdir}/libopenvx.so %{_libdir}/libvx_amd_custom.so %{_libdir}/libvx_opencv.so %{_libdir}/libvx_nn.so %{_libdir}/libvx_rpp.so %{_libdir}/libvxu.so %{_libexecdir}/%{name}/ %changelog * Tue Jan 7 2025 Tom Rix - 6.3.1-1 - Initial package