From 90e6d303832f17cca6bb8be0cfe008e38207396e Mon Sep 17 00:00:00 2001 From: Kiriti Gowda Date: Thu, 23 Nov 2023 05:57:45 -0800 Subject: [PATCH] Package - updates (#81) * Package - updates * Package - Info --- CMakeLists.txt | 27 ++++++------ README.md | 14 +++--- rocDecode-setup.py | 106 +++++++++++++++++++++++++++++---------------- 3 files changed, 90 insertions(+), 57 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a412b813be..d072cbf5e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,10 +174,8 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode address sanitizer libraries") set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode address sanitizer libraries") else() - set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode hardware-accelerated video decoder on AMD’s GPUs. - rocDecode is a toolkit to decode videos using a hardware-accelerated video \ - decoder on AMD’s GPUs.") - set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode hardware-accelerated video decoder on AMD’s GPUs.") + set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs") + set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode is a high performance video decode SDK for AMD GPUs") endif() if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) @@ -188,9 +186,9 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) 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, libswscale-dev") + set(rocDecode_DEBIAN_DEV_PACKAGE_LIST "ffmpeg, libavcodec-dev, libavformat-dev, libavutil-dev, libswscale-dev") # TBD - RPM packages need Fusion Packages - #set(rocDecode_RPM_DEV_PACKAGE_LIST "ffmpeg, libavcodec-devel, libavformat-devel, libswscale-devel") + #set(rocDecode_RPM_DEV_PACKAGE_LIST "ffmpeg, libavcodec-devel, libavformat-devel, libavutil-devel, libswscale-devel") # '%{?dist}' breaks manual builds on debian systems due to empty Provides execute_process( @@ -268,7 +266,7 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) if(EXISTS ${RPMBUILD_EXE}) list(APPEND CPACK_GENERATOR "RPM") message("-- ${White}AMD ROCm rocDecode RunTime Package -- ${CPACK_RPM_DEV_PACKAGE_REQUIRES}${ColourReset}") - message("-- ${White}AMD ROCm rocDecode Dev Package -- ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS}${ColourReset}") + message("-- ${White}AMD ROCm rocDecode Dev Package -- ${CPACK_RPM_DEV_PACKAGE_REQUIRES}${ColourReset}") endif() if(EXISTS ${DPKG_EXE}) list(APPEND CPACK_GENERATOR "DEB") @@ -279,16 +277,19 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_FOUND) include(CPack) cpack_add_component(runtime - DISPLAY_NAME "Runtime" - DESCRIPTION "Library, Header files and documentation for rocDecode") + DISPLAY_NAME "rocDecode Runtime Package" + DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \ + rocDecode runtime package provides rocDecode library and license.txt") cpack_add_component(dev - DISPLAY_NAME "Devel" - DESCRIPTION "Header files and documentation for rocDecode") + DISPLAY_NAME "rocDecode Develop Package" + DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \ + rocDecode develop package provides rocDecode library, header files, samples, and license.txt") cpack_add_component(asan - DISPLAY_NAME "ASAN" - DESCRIPTION "ASAN libraries for the rocDecode") + DISPLAY_NAME "rocDecode ASAN Package" + DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \ + rocDecode ASAN package provides rocDecode ASAN libraries") else() message("-- ${Red}AMD ROCm rocDecode -- unmet dependencies${ColourReset}") if(NOT HIP_FOUND) diff --git a/README.md b/README.md index ac2692162f..9092eed388 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rocDecode -rocDecode is a high performance video decode SDK for AMD hardware. rocDecode API lets developers access the video decoding features available on the GPU. +rocDecode is a high performance video decode SDK for AMD GPUs. rocDecode API lets developers access the video decoding features available on the GPU. ## Supported Codecs @@ -61,10 +61,10 @@ Please follow the instructions below to build and install the rocDecode library. The installer will copy -* Libraries into /opt/rocm/lib -* Header files into /opt/rocm/include/rocdecode -* Samples folder into /opt/rocm/share/rocdecode -* Documents folder into /opt/rocm/share/doc/rocdecode +* Libraries into `/opt/rocm/lib` +* Header files into `/opt/rocm/include/rocdecode` +* Samples folder into `/opt/rocm/share/rocdecode` +* Documents folder into `/opt/rocm/share/doc/rocdecode` Build and run sample @@ -116,7 +116,7 @@ doxygen .Doxyfile * ROCm: * rocm-core - `5.6.1.50601-93` * amdgpu-core - `1:5.6.50601-1649308` -* FFMPEG - `4.2.7` / `4.4.2-0` * libva-dev - `2.7.0-2` / `2.14.0-1` * libdrm-dev - `2.4.107` / `2.4.113` -* rocDecode Setup Script - `V1.2` +* FFMPEG - `4.2.7` / `4.4.2-0` +* rocDecode Setup Script - `V1.3` diff --git a/rocDecode-setup.py b/rocDecode-setup.py index a99b6cb02e..10214b8a39 100644 --- a/rocDecode-setup.py +++ b/rocDecode-setup.py @@ -28,7 +28,7 @@ else: import subprocess __copyright__ = "Copyright 2023, AMD ROCm rocDecode" -__version__ = "1.2" +__version__ = "1.3" __email__ = "mivisionx.support@amd.com" __status__ = "Shipping" @@ -36,8 +36,11 @@ __status__ = "Shipping" parser = argparse.ArgumentParser() parser.add_argument('--rocm_path', type=str, default='/opt/rocm', help='ROCm Installation Path - optional (default:/opt/rocm) - ROCm Installation Required') +parser.add_argument('--developer', type=str, default='ON', + help='Setup Developer Options - optional (default:ON) [options:ON/OFF]') args = parser.parse_args() +developerInstall = args.developer.upper() ROCM_PATH = args.rocm_path @@ -55,6 +58,11 @@ else: print("ERROR: rocDecode Setup requires ROCm install\n") exit(-1) +if developerInstall not in ('OFF', 'ON'): + print( + "ERROR: Developer Option Not Supported - [Supported Options: OFF or ON]\n") + exit() + # get platfrom info platfromInfo = platform.platform() @@ -112,55 +120,79 @@ os.system(linuxSystemInstall+' update') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' + linuxSystemInstall_check+' install gcc cmake git wget unzip pkg-config inxi') +# rocDecode RunTime Requirements if "Ubuntu" in platfromInfo: os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install vainfo libva-dev libdrm-dev ffmpeg') + ' install vainfo libva-dev libdrm-dev') else: + os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install autoconf automake bzip2 bzip2-devel freetype-devel') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install gcc-c++ libtool make pkgconfig zlib-devel libva-devel libdrm-devel') - # Nasm - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install nasm') - if "centos-7" in platfromInfo or "redhat-7" in platfromInfo: - # Yasm - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' --enablerepo=extras install epel-release') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install yasm') - # libx264 & libx265 - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install libx264-devel libx265-devel') - # libfdk_aac - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install https://forensics.cert.org/cert-forensics-tools-release-el7.rpm') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' --enablerepo=forensics install fdk-aac') - # libASS - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install libass-devel') + ' install libva-devel libdrm-devel') + +# rocDecode Dev Requirements +if developerInstall == 'ON': + if "Ubuntu" in platfromInfo: os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev') + else: + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install autoconf automake bzip2 bzip2-devel freetype-devel') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install gcc-c++ libtool make pkgconfig zlib-devel') + # Nasm + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install nasm') + if "centos-7" in platfromInfo or "redhat-7" in platfromInfo: + # Yasm + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' --enablerepo=extras install epel-release') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install yasm') + # libx264 & libx265 + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install libx264-devel libx265-devel') + # libfdk_aac + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install https://forensics.cert.org/cert-forensics-tools-release-el7.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' --enablerepo=forensics install fdk-aac') + # libASS + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install libass-devel') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install ffmpeg') - elif "centos-8" in platfromInfo or "redhat-8" in platfromInfo: - # el8 x86_64 packages - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + elif "centos-8" in platfromInfo or "redhat-8" in platfromInfo: + # el8 x86_64 packages + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/SDL2-2.0.10-2.el8.x86_64.rpm') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install ffmpeg ffmpeg-devel') - elif "SLES" in platfromInfo: - # FFMPEG-4 packages - os.system( + elif "centos-9" in platfromInfo or "redhat-9" in platfromInfo: + # el8 x86_64 packages + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install install https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + ' install ffmpeg ffmpeg-free-devel') + elif "SLES" in platfromInfo: + # FFMPEG-4 packages + os.system( 'sudo zypper ar -cfp 90 \'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_$releasever/Essentials\' packman-essentials') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install ffmpeg-4') print("\nrocDecode Dependencies Installed with rocDecode-setup.py V-"+__version__+"\n")