diff --git a/projects/rocdecode/.jenkins/common.groovy b/projects/rocdecode/.jenkins/common.groovy index c6bd83831d..6d33aa993e 100644 --- a/projects/rocdecode/.jenkins/common.groovy +++ b/projects/rocdecode/.jenkins/common.groovy @@ -6,28 +6,27 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release' String buildTypeDir = debug ? 'debug' : 'release' - String enableSCL = 'echo build-rocDecode' - String libLocation = '' + String installDKMS = 'sudo apt install amdgpu-dkms' - if (platform.jenkinsLabel.contains('centos7')) { - enableSCL = 'source scl_source enable llvm-toolset-7' + if (platform.jenkinsLabel.contains('rhel')) { + installDKMS = 'sudo yum install amdgpu-dkms' } - else if (platform.jenkinsLabel.contains('rhel')) { - libLocation = ':/usr/local/lib' + else if (platform.jenkinsLabel.contains('sles')) { + installDKMS = 'sudo zypper install amdgpu-dkms' } def command = """#!/usr/bin/env bash set -x echo Build rocDecode - ${buildTypeDir} cd ${project.paths.project_build_prefix} + ${installDKMS} python rocDecode-setup.py mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir} - ${enableSCL} cmake ${buildTypeArg} ../.. make -j\$(nproc) sudo make install - LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rocm/lib${libLocation} make test ARGS="-VV --rerun-failed --output-on-failure" sudo make package + ldd -v /opt/rocm/lib/librocdecode.so """ platform.runCommand(this, command) @@ -35,12 +34,21 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s def runTestCommand (platform, project) { + String libLocation = '' + + if (platform.jenkinsLabel.contains('rhel')) { + libLocation = ':/usr/local/lib' + } + else if (platform.jenkinsLabel.contains('sles')) { + libLocation = ':/usr/local/lib' + } + def command = """#!/usr/bin/env bash set -x export HOME=/home/jenkins echo Make Test cd ${project.paths.project_build_prefix}/build/release - ldd -v /opt/rocm/lib/librocdecode.so + LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rocm/lib${libLocation} make test ARGS="-VV --rerun-failed --output-on-failure" """ platform.runCommand(this, command) diff --git a/projects/rocdecode/CHANGELOG.md b/projects/rocdecode/CHANGELOG.md index 33cf217f67..640cd3362e 100644 --- a/projects/rocdecode/CHANGELOG.md +++ b/projects/rocdecode/CHANGELOG.md @@ -6,7 +6,36 @@ [rocDecode Documentation](https://github.com/ROCmSoftwarePlatform/rocDecode#rocDecode) -## rocDecode 0.4.0 (unreleased) +## rocDecode 0.5.0 (unreleased) + +### Added + +* AMDGPU package support + +### Optimizations + +* Package dependdencies +* Readme + +### Changed + +* Setup Updates + +### Fixed + +* minor bug fix and updates + +### Tested configurations + +* Linux distribution + + Ubuntu - `20.04` / `22.04` +* ROCm: + + rocm-core - `5.6.1.50601-93` + + amdgpu-core - `1:5.6.50601-1649308` +* FFMPEG - `4.2.7` / `4.4.2-0` +* rocDecode Setup Script - `V1.4` + +## rocDecode 0.4.0 ### Added diff --git a/projects/rocdecode/CMakeLists.txt b/projects/rocdecode/CMakeLists.txt index 83cb6e9829..cdb5b86e06 100644 --- a/projects/rocdecode/CMakeLists.txt +++ b/projects/rocdecode/CMakeLists.txt @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.5) -set(VERSION "0.4.0") +set(VERSION "0.5.0") set(CMAKE_CXX_STANDARD 17) # Set Project Version and Language @@ -165,7 +165,7 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) set(CPACK_PACKAGE_CONTACT "rocDecode Support ") set(CPACK_PACKAGE_VENDOR "AMD ROCm") set(CPACK_PACKAGE_GROUP "Development/Tools") - set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCmSoftwarePlatform/rocDecode") + set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCm/rocDecode") if(ENABLE_ASAN_PACKAGING) set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode address sanitizer libraries") @@ -180,12 +180,12 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) endif() # Set the dependent packages - set(rocDecode_DEBIAN_PACKAGE_LIST "libva-dev, libdrm-dev") - set(rocDecode_RPM_PACKAGE_LIST "libva-devel, libdrm-devel") - # Set the dev dependent packages - set(rocDecode_DEBIAN_DEV_PACKAGE_LIST "ffmpeg, libavcodec-dev, libavformat-dev, libavutil-dev") - # TBD - RPM packages need Fusion Packages - #set(rocDecode_RPM_DEV_PACKAGE_LIST "ffmpeg, libavcodec-devel, libavformat-devel, libavutil-devel") + set(rocDecode_DEBIAN_PACKAGE_LIST "rocm-hip-runtime, mesa-amdgpu-multimedia") + set(rocDecode_RPM_PACKAGE_LIST "rocm-hip-runtime, mesa-amdgpu-multimedia") + # Set the dev dependent packages - TBD: mesa-amdgpu-multimedia-devel name will be changed to -dev + set(rocDecode_DEBIAN_DEV_PACKAGE_LIST "rocm-hip-runtime-dev, mesa-amdgpu-multimedia-devel, pkg-config, ffmpeg, libavcodec-dev, libavformat-dev, libavutil-dev") + # TBD - RPM packages need Fusion Packages - "ffmpeg, libavcodec-devel, libavformat-devel, libavutil-devel" + set(rocDecode_RPM_DEV_PACKAGE_LIST "rocm-hip-runtime-devel, mesa-amdgpu-multimedia-devel, pkg-config") # '%{?dist}' breaks manual builds on debian systems due to empty Provides execute_process( @@ -223,7 +223,7 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) set(CPACK_RPM_RUNTIME_PACKAGE_PROVIDES "${PROJECT_NAME}") set(CPACK_RPM_RUNTIME_PACKAGE_OBSOLETES "${PROJECT_NAME}") set(CPACK_RPM_DEV_PACKAGE_NAME "${PROJECT_NAME}-devel") - set(CPACK_RPM_DEV_PACKAGE_REQUIRES "rocm-core, ${PROJECT_NAME}") + set(CPACK_RPM_DEV_PACKAGE_REQUIRES "rocm-core, ${PROJECT_NAME}, ${rocDecode_RPM_DEV_PACKAGE_LIST}") set(CPACK_RPM_DEV_PACKAGE_PROVIDES "${PROJECT_NAME}-devel") set(CPACK_RPM_DEV_PACKAGE_OBSOLETES "${PROJECT_NAME}-devel") set(CPACK_RPM_PACKAGE_LICENSE "MIT" ) @@ -308,12 +308,12 @@ rocDecode Test package provides rocDecode Test Components") else() message("-- ${Red}AMD ROCm rocDecode -- unmet dependencies${ColourReset}") if(NOT HIP_FOUND) - message(FATAL_ERROR "-- ERROR!: HIP Not Found! - please install ROCm and HIP!") + message(FATAL_ERROR "-- ERROR!: HIP Not Found! - please install rocm-hip-runtime-dev!") endif() if(NOT Libva_FOUND) - message(FATAL_ERROR "-- ERROR!: libva-dev Not Found - please install libva-dev!") + message(FATAL_ERROR "-- ERROR!: libva Not Found - please install mesa-amdgpu-multimedia-devel!") endif() if(NOT Libdrm_FOUND) - message(FATAL_ERROR "-- ERROR!: libdrm-dev Not Found - please install libdrm-dev!") + message(FATAL_ERROR "-- ERROR!: libdrm Not Found - please install mesa-amdgpu-multimedia-devel!") endif() endif() diff --git a/projects/rocdecode/README.md b/projects/rocdecode/README.md index 998f8979df..21bad0d0e0 100644 --- a/projects/rocdecode/README.md +++ b/projects/rocdecode/README.md @@ -9,33 +9,32 @@ rocDecode is a high performance video decode SDK for AMD GPUs. rocDecode API let ## Prerequisites * Linux distribution - * Ubuntu - `20.04` / `22.04` + + Ubuntu - `20.04` / `22.04` + + RHEL - `8` / `9` + + SLES - `15-SP4` * [ROCm supported hardware](https://rocm.docs.amd.com/en/latest/release/gpu_os_support.html) -* Install [ROCm 5.5 or later](https://rocmdocs.amd.com/en/latest/deploy/linux/installer/install.html) with `--usecase=graphics,rocm --no-32` +### To install package + +* [ROCm 6.1.0 or later](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/native-install/index.html) - Follow below steps from the installation via native package manager on ROCm installation documentation + * Registering repositories + * Register kernel-mode driver + * Register ROCm packages + * Install kernel driver + +### To build from source + +* Install [ROCm 5.6.1 or later](https://rocmdocs.amd.com/en/latest/deploy/linux/installer/install.html) with `--usecase=multimediasdk,rocm --no-32` * CMake `3.5` or later -* libva-dev `2.7` or later +**NOTE:** Ubuntu 22.04 - Install `libstdc++-12-dev` +```shell +sudo apt install libstdc++-12-dev +``` - ```shell - sudo apt install libva-dev - ``` - -* libdrm-dev `2.4` or later - - ```shell - sudo apt install libdrm-dev - ``` - -* libstdc++-12-dev - - ```shell - sudo apt install libstdc++-12-dev - ``` - -### Prerequisites setup script for Linux +#### Prerequisites setup script for Linux For the convenience of the developer, we provide the setup script [rocDecode-setup.py](rocDecode-setup.py) which will install all the dependencies required by this project. **Usage:** @@ -45,30 +44,43 @@ For the convenience of the developer, we provide the setup script [rocDecode-set ``` **NOTE:** This script only needs to be executed once. -## Build instructions +## Build and Install instructions -Please follow the instructions below to build and install the rocDecode library. +### Package install +Install rocDecode runtime, development, and test packages. Runtime package - `rocdecode` only provides the rocdecode library `librocdecode.so`, development package `rocdecode-dev`/`rocdecode-devel` provides the library, header files, and samples. `rocdecode-test` package provides ctest to verify installation. Package install will auto install all dependencies. +* Install packages on `Ubuntu` ```shell - cd rocDecode - mkdir build; cd build - cmake .. - make -j8 - sudo make install +sudo apt install rocdecode rocdecode-dev rocdecode-test +``` + +* Install packages on `RHEL` / `SLES` +```shell +sudo yum install rocdecode rocdecode-devel rocdecode-test ``` -* run tests - Requires `FFMPEG` install +### Source build and install + +```shell +git clone https://github.com/ROCm/rocDecode.git +cd rocDecode +mkdir build && cd build +cmake ../ +make -j8 +sudo make install +``` + +* run tests - Requires `FFMPEG` dev install ```shell make test ``` - **NOTE:** run tests with verbose option `make test ARGS="-VV"` * make package ```shell - sudo make test package + sudo make package ``` ## Verify Installation @@ -88,7 +100,7 @@ cmake /opt/rocm/share/rocdecode/samples/videoDecode/ make -j8 ./videodecode -i /opt/rocm/share/rocdecode/video/AMD_driving_virtual_20-H265.mp4 ``` -**NOTE:** FFMPEG install required to run samples +**NOTE:** FFMPEG dev install required to run samples ## Samples @@ -98,9 +110,11 @@ The tool provides a few samples to decode videos [here](samples/). Please refer * [FFMPEG](https://ffmpeg.org/about.html) - required to run sample applications & make test + * On `Ubuntu` ```shell sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev ``` + * On `RHEL`/`SLES` - install ffmpeg development packages manually or use `rocDecode-setup.py` script ## Docker @@ -111,7 +125,6 @@ Docker files to build rocDecode containers are available [here](docker/) Run the steps below to build documentation locally. * Sphinx - ```shell cd docs pip3 install -r sphinx/requirements.txt @@ -119,7 +132,6 @@ python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html ``` * Doxygen - ```shell doxygen .Doxyfile ``` @@ -128,10 +140,10 @@ doxygen .Doxyfile * Linux distribution * Ubuntu - `20.04` / `22.04` + * RHEL - `8` / `9` + * SLES - `15-SP4` * ROCm: * rocm-core - `5.6.1.50601-93` * amdgpu-core - `1:5.6.50601-1649308` -* libva-dev - `2.7.0-2` / `2.14.0-1` -* libdrm-dev - `2.4.107` / `2.4.113` * FFMPEG - `4.2.7` / `4.4.2-0` -* rocDecode Setup Script - `V1.3` +* rocDecode Setup Script - `V1.4` diff --git a/projects/rocdecode/cmake/FindLibdrm.cmake b/projects/rocdecode/cmake/FindLibdrm.cmake index d7d9365761..4234b82cde 100644 --- a/projects/rocdecode/cmake/FindLibdrm.cmake +++ b/projects/rocdecode/cmake/FindLibdrm.cmake @@ -21,8 +21,8 @@ # ################################################################################ -find_library(LIBDRM_LIBRARY NAMES drm) -find_path(LIBDRM_INCLUDE_DIR NAMES drm.h PATHS /usr/include/libdrm /usr/include/drm) +find_library(LIBDRM_LIBRARY NAMES drm HINTS /opt/amdgpu/lib/x86_64-linux-gnu /opt/amdgpu/lib64 /usr/lib64) +find_path(LIBDRM_INCLUDE_DIR NAMES drm.h PATHS /opt/amdgpu/include/libdrm /usr/include/libdrm) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_INCLUDE_DIR LIBDRM_LIBRARY) diff --git a/projects/rocdecode/cmake/FindLibva.cmake b/projects/rocdecode/cmake/FindLibva.cmake index b8a29a5fa2..852db5aec7 100644 --- a/projects/rocdecode/cmake/FindLibva.cmake +++ b/projects/rocdecode/cmake/FindLibva.cmake @@ -21,9 +21,9 @@ # ################################################################################ -find_library(LIBVA_LIBRARY NAMES va) -find_library(LIBVA_DRM_LIBRARY NAMES va-drm) -find_path(LIBVA_INCLUDE_DIR NAMES va/va.h) +find_library(LIBVA_LIBRARY NAMES va HINTS /opt/amdgpu/lib/x86_64-linux-gnu /opt/amdgpu/lib64) +find_library(LIBVA_DRM_LIBRARY NAMES va-drm HINTS /opt/amdgpu/lib/x86_64-linux-gnu /opt/amdgpu/lib64) +find_path(LIBVA_INCLUDE_DIR NAMES va/va.h PATHS /opt/amdgpu/include) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Libva DEFAULT_MSG LIBVA_INCLUDE_DIR LIBVA_LIBRARY) diff --git a/projects/rocdecode/rocDecode-setup.py b/projects/rocdecode/rocDecode-setup.py index dfc9ac7910..2a98234876 100644 --- a/projects/rocdecode/rocDecode-setup.py +++ b/projects/rocdecode/rocDecode-setup.py @@ -28,7 +28,7 @@ else: import subprocess __copyright__ = "Copyright 2023, AMD ROCm rocDecode" -__version__ = "1.3" +__version__ = "1.4" __email__ = "mivisionx.support@amd.com" __status__ = "Shipping" @@ -120,15 +120,15 @@ os.system(linuxSystemInstall+' update') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' + linuxSystemInstall_check+' install gcc cmake git wget unzip pkg-config inxi') -# rocDecode RunTime Requirements +# rocDecode Core - VA/DRM Requirements if "Ubuntu" in platfromInfo: os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install vainfo libva-dev libdrm-dev libstdc++-12-dev') + ' install vainfo mesa-amdgpu-multimedia-devel libstdc++-12-dev') else: os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install libva-devel libdrm-devel') + ' install mesa-amdgpu-multimedia-devel') # rocDecode Dev Requirements if developerInstall == 'ON':