diff --git a/CMakeLists.txt b/CMakeLists.txt index eff94d2f45..a1c80e5b60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,6 +211,12 @@ endif() # Set the dependent packages set(MIVISIONX_PACKAGE_REQS "half, rpp, rocblas, miopen-hip, migraphx") +# MIVisionX Package Dependencies +set(MIVISIONX_DEBIAN_PACKAGE_LIST "ffmpeg, libavcodec-dev, \ +libavformat-dev, libswscale-dev, libomp-dev, miopen-hip-dev, \ +rocblas-dev, libboost-filesystem-dev, libopencv-dev, migraphx-dev") +set(MIVISIONX_RPM_PACKAGE_LIST "rocblas-devel, miopen-hip-devel, \ +migraphx-devel") # set dependency to ROCm if set to TRUE, default to OFF set(ROCM_DEP_ROCMCORE OFF CACHE BOOL "Set rocm-core dependency") if(ROCM_DEP_ROCMCORE) @@ -222,8 +228,8 @@ if(ROCM_DEP_ROCMCORE) set(MIVISIONX_PACKAGE_REQS "${MIVISIONX_PACKAGE_REQS}, ${_rocm_core_pkg}") endif() -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${MIVISIONX_PACKAGE_REQS}, rocblas-dev, miopen-hip-dev, migraphx-dev") -set(CPACK_RPM_PACKAGE_REQUIRES "${MIVISIONX_PACKAGE_REQS}, rocblas-devel, miopen-hip-devel, migraphx-devel") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${MIVISIONX_PACKAGE_REQS}, ${MIVISIONX_DEBIAN_PACKAGE_LIST}") +set(CPACK_RPM_PACKAGE_REQUIRES "${MIVISIONX_PACKAGE_REQS}, ${MIVISIONX_RPM_PACKAGE_LIST}") # '%{?dist}' breaks manual builds on debian systems due to empty Provides execute_process(COMMAND rpm --eval %{?dist} @@ -252,9 +258,11 @@ else() endif() if(EXISTS ${RPMBUILD_EXE}) list(APPEND CPACK_GENERATOR "RPM") + message("-- ${White}MIVisionX -- CPACK_RPM_PACKAGE_REQUIRES:${CPACK_RPM_PACKAGE_REQUIRES}${ColourReset}") endif() if(EXISTS ${DPKG_EXE}) list(APPEND CPACK_GENERATOR "DEB") + message("-- ${White}MIVisionX -- CPACK_DEBIAN_PACKAGE_DEPENDS:${CPACK_DEBIAN_PACKAGE_DEPENDS}${ColourReset}") endif() endif() diff --git a/amd_openvx/cmake/FindTurboJpeg.cmake b/amd_openvx/cmake/FindTurboJpeg.cmake index c0643fb31b..dcdacc7b7b 100644 --- a/amd_openvx/cmake/FindTurboJpeg.cmake +++ b/amd_openvx/cmake/FindTurboJpeg.cmake @@ -49,6 +49,7 @@ find_library(TurboJpeg_LIBRARIES ${TURBO_JPEG_PATH}/lib ${TURBO_JPEG_PATH}/lib64 /usr/lib + #/usr/lib/x86_64-linux-gnu - package install libturbojpeg0-dev /opt/libjpeg-turbo/lib ) mark_as_advanced(TurboJpeg_LIBRARIES) @@ -62,6 +63,7 @@ find_path(TurboJpeg_LIBRARIES_DIRS ${TURBO_JPEG_PATH}/lib ${TURBO_JPEG_PATH}/lib64 /usr/lib + #/usr/lib/x86_64-linux-gnu - package install libturbojpeg0-dev /opt/libjpeg-turbo/lib ) mark_as_advanced(TurboJpeg_LIBRARIES_DIRS) diff --git a/amd_openvx_extensions/amd_migraphx/CMakeLists.txt b/amd_openvx_extensions/amd_migraphx/CMakeLists.txt index d804abbc43..6878dbd8a6 100644 --- a/amd_openvx_extensions/amd_migraphx/CMakeLists.txt +++ b/amd_openvx_extensions/amd_migraphx/CMakeLists.txt @@ -25,6 +25,7 @@ set(CMAKE_CXX_STANDARD 14) list (APPEND CMAKE_PREFIX_PATH ${ROCM_PATH} ${ROCM_PATH}/hip) +# TBD: HIP required to build vx_migraphx if(GPU_SUPPORT AND "${BACKEND}" STREQUAL "HIP") if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) @@ -37,7 +38,7 @@ if(GPU_SUPPORT AND "${BACKEND}" STREQUAL "HIP") find_package(HIP QUIET) list(APPEND PACKAGE_DEPENDS PACKAGE HIP) - + # TBD: migraphx package required to build vx_migraphx find_package(migraphx QUIET) include_directories(../../amd_openvx/openvx/include diff --git a/docker/mivisionx-release-ubuntu20.dockerfile b/docker/mivisionx-release-ubuntu20.dockerfile new file mode 100644 index 0000000000..116d4492e5 --- /dev/null +++ b/docker/mivisionx-release-ubuntu20.dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:20.04 + +ARG ROCM_INSTALLER_REPO=https://repo.radeon.com/amdgpu-install/5.7/ubuntu/focal/amdgpu-install_5.7.50700-1_all.deb +ARG ROCM_INSTALLER_PACKAGE=amdgpu-install_5.7.50700-1_all.deb + +ENV MIVISIONX_DEPS_ROOT=/mivisionx-deps +WORKDIR $MIVISIONX_DEPS_ROOT + +RUN apt-get update -y +# install mivisionx base dependencies - Level 1 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ cmake pkg-config git libcanberra-gtk-module +# install ROCm for mivisionx OpenCL/HIP dependency - Level 2 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install initramfs-tools libnuma-dev wget sudo keyboard-configuration && \ + sudo apt-get -y clean && dpkg --add-architecture i386 && \ + wget ${ROCM_INSTALLER_REPO} && \ + sudo apt-get install -y ./${ROCM_INSTALLER_PACKAGE} && \ + sudo apt-get update -y && \ + sudo amdgpu-install -y --usecase=graphics,rocm + +# install mivisionx package dependencies +# VX_NN & VX_MIGraphX +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install half miopen-hip-dev rocblas-dev migraphx migraphx-dev +# VX_MEDIA +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ffmpeg libavcodec-dev libavformat-dev libswscale-dev +# VX_openCV +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install libopencv-dev +# RPP +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install clang libboost-filesystem-dev half rpp +# rocAL +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install liblmdb-dev rapidjson-dev libturbojpeg0-dev libprotobuf-dev +# rocAL PyBind +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3-dev python3-setuptools python3-pip python3-opencv pybind11-dev + +ENV MIVISIONX_WORKSPACE=/workspace +WORKDIR $MIVISIONX_WORKSPACE + +ENV PATH=$PATH:/opt/rocm/bin +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib + +# Clone MIVisionX +RUN git clone https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX.git && \ + mkdir build && cd build && cmake -D BACKEND=HIP -D ROCAL=OFF ../MIVisionX && make -j8 && make install \ No newline at end of file diff --git a/docker/mivisionx-release-ubuntu22.dockerfile b/docker/mivisionx-release-ubuntu22.dockerfile new file mode 100644 index 0000000000..3c11b5d643 --- /dev/null +++ b/docker/mivisionx-release-ubuntu22.dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:22.04 + +ARG ROCM_INSTALLER_REPO=https://repo.radeon.com/amdgpu-install/5.7/ubuntu/jammy/amdgpu-install_5.7.50700-1_all.deb +ARG ROCM_INSTALLER_PACKAGE=amdgpu-install_5.7.50700-1_all.deb + +ENV MIVISIONX_DEPS_ROOT=/mivisionx-deps +WORKDIR $MIVISIONX_DEPS_ROOT + +RUN apt-get update -y +# install mivisionx base dependencies - Level 1 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ cmake pkg-config git libcanberra-gtk-module + +# install ROCm for mivisionx OpenCL/HIP dependency - Level 2 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install initramfs-tools libnuma-dev wget sudo keyboard-configuration libstdc++-12-dev && \ + sudo apt-get -y clean && dpkg --add-architecture i386 && \ + wget ${ROCM_INSTALLER_REPO} && \ + sudo apt-get install -y ./${ROCM_INSTALLER_PACKAGE} && \ + sudo apt-get update -y && \ + sudo amdgpu-install -y --usecase=graphics,rocm + +# install mivisionx package dependencies +# VX_NN & VX_MIGraphX +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install half miopen-hip-dev rocblas-dev migraphx migraphx-dev +# VX_MEDIA +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ffmpeg libavcodec-dev libavformat-dev libswscale-dev +# VX_openCV +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install libopencv-dev +# RPP +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install clang libboost-filesystem-dev half rpp +# rocAL +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install liblmdb-dev rapidjson-dev libturbojpeg0-dev libprotobuf-dev +# rocAL PyBind +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3-dev python3-setuptools python3-pip python3-opencv pybind11-dev + +ENV MIVISIONX_WORKSPACE=/workspace +WORKDIR $MIVISIONX_WORKSPACE + +ENV PATH=$PATH:/opt/rocm/bin +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib + +# Clone MIVisionX +RUN git clone https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX.git && \ + mkdir build && cd build && cmake -D BACKEND=HIP -D ROCAL=OFF ../MIVisionX && make -j8 && make install \ No newline at end of file