Package & Tests - ROCm Release Updates (#11)
* rocDecode Updates
* Doxygen - Fix
* CMakeLists - Fix
* Jenkins - Files
* Samples - Fix
* CTest - Fix
* Changelog - Added
* Fix - Review comments
[ROCm/rocdecode commit: aa72eb1996]
Tento commit je obsažen v:
Rozdílový obsah nebyl zobrazen, protože je příliš veliký
Načíst rozdílové porovnání
@@ -0,0 +1,238 @@
|
||||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.9.7 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||
<tab type="pages" visible="yes" title="" intro=""/>
|
||||
<tab type="topics" visible="yes" title="rocDecode APIs" intro=""/>
|
||||
<tab type="namespaces" visible="yes" title="">
|
||||
<tab type="namespacelist" visible="yes" title="" intro=""/>
|
||||
<tab type="namespacemembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="concepts" visible="yes" title="">
|
||||
</tab>
|
||||
<tab type="interfaces" visible="yes" title="">
|
||||
<tab type="interfacelist" visible="yes" title="" intro=""/>
|
||||
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="no" title="">
|
||||
<tab type="classlist" visible="no" title="" intro=""/>
|
||||
<tab type="hierarchy" visible="no" title="" intro=""/>
|
||||
<tab type="classmembers" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="structs" visible="no" title="">
|
||||
<tab type="structlist" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="exceptions" visible="yes" title="">
|
||||
<tab type="exceptionlist" visible="yes" title="" intro=""/>
|
||||
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="rocDecode Header Files">
|
||||
<tab type="filelist" visible="no" title="" intro=""/>
|
||||
<tab type="globals" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
<class>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_HEADERFILE"/>
|
||||
<inheritancegraph visible="$CLASS_GRAPH"/>
|
||||
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
|
||||
<memberdecl>
|
||||
<nestedclasses visible="yes" title=""/>
|
||||
<publictypes title=""/>
|
||||
<services title=""/>
|
||||
<interfaces title=""/>
|
||||
<publicslots title=""/>
|
||||
<signals title=""/>
|
||||
<publicmethods title=""/>
|
||||
<publicstaticmethods title=""/>
|
||||
<publicattributes title=""/>
|
||||
<publicstaticattributes title=""/>
|
||||
<protectedtypes title=""/>
|
||||
<protectedslots title=""/>
|
||||
<protectedmethods title=""/>
|
||||
<protectedstaticmethods title=""/>
|
||||
<protectedattributes title=""/>
|
||||
<protectedstaticattributes title=""/>
|
||||
<packagetypes title=""/>
|
||||
<packagemethods title=""/>
|
||||
<packagestaticmethods title=""/>
|
||||
<packageattributes title=""/>
|
||||
<packagestaticattributes title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<privatetypes title=""/>
|
||||
<privateslots title=""/>
|
||||
<privatemethods title=""/>
|
||||
<privatestaticmethods title=""/>
|
||||
<privateattributes title=""/>
|
||||
<privatestaticattributes title=""/>
|
||||
<friends title=""/>
|
||||
<related title="" subtitle=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<services title=""/>
|
||||
<interfaces title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
</memberdef>
|
||||
<allmemberslink visible="yes"/>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
</class>
|
||||
|
||||
<!-- Layout definition for a namespace page -->
|
||||
<namespace>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestednamespaces visible="yes" title=""/>
|
||||
<constantgroups visible="yes" title=""/>
|
||||
<interfaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<concepts visible="yes" title=""/>
|
||||
<structs visible="yes" title=""/>
|
||||
<exceptions visible="yes" title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</namespace>
|
||||
|
||||
<!-- Layout definition for a concept page -->
|
||||
<concept>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_HEADERFILE"/>
|
||||
<definition visible="yes" title=""/>
|
||||
<detaileddescription title=""/>
|
||||
<authorsection visible="yes"/>
|
||||
</concept>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<includegraph visible="$INCLUDE_GRAPH"/>
|
||||
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<interfaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<structs visible="yes" title=""/>
|
||||
<exceptions visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<concepts visible="yes" title=""/>
|
||||
<constantgroups visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<briefdescription visible="yes"/>
|
||||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<memberdecl>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<concepts visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<sequences title=""/>
|
||||
<dictionaries title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<directorygraph visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
build/
|
||||
samples/*/build
|
||||
.vscode/
|
||||
doxygen_output*
|
||||
samples/videoDecode/videodecode_test.cpp
|
||||
samples/videoDecodeCMakeLists_test.txt
|
||||
@@ -0,0 +1,85 @@
|
||||
// This file is for internal AMD use.
|
||||
// If you are interested in running your own Jenkins, please raise a github issue for assistance.
|
||||
|
||||
def runCompileCommand(platform, project, jobName, boolean debug=false, boolean staticLibrary=false) {
|
||||
project.paths.construct_build_prefix()
|
||||
|
||||
String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
|
||||
String buildTypeDir = debug ? 'debug' : 'release'
|
||||
String enableSCL = 'echo build-rocDecode'
|
||||
String libLocation = ''
|
||||
|
||||
if (platform.jenkinsLabel.contains('centos7')) {
|
||||
enableSCL = 'source scl_source enable llvm-toolset-7'
|
||||
}
|
||||
else if (platform.jenkinsLabel.contains('rhel')) {
|
||||
libLocation = ':/usr/local/lib'
|
||||
}
|
||||
|
||||
def command = """#!/usr/bin/env bash
|
||||
set -x
|
||||
echo Build rocDecode - ${buildTypeDir}
|
||||
cd ${project.paths.project_build_prefix}
|
||||
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
|
||||
"""
|
||||
|
||||
platform.runCommand(this, command)
|
||||
}
|
||||
|
||||
def runTestCommand (platform, project) {
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
platform.runCommand(this, command)
|
||||
// Unit tests - TBD
|
||||
}
|
||||
|
||||
def runPackageCommand(platform, project) {
|
||||
|
||||
def packageHelper = platform.makePackage(platform.jenkinsLabel, "${project.paths.project_build_prefix}/build/release")
|
||||
|
||||
String packageType = ""
|
||||
String packageInfo = ""
|
||||
|
||||
if (platform.jenkinsLabel.contains('centos') ||
|
||||
platform.jenkinsLabel.contains('rhel') ||
|
||||
platform.jenkinsLabel.contains('sles')) {
|
||||
packageType = 'rpm'
|
||||
packageInfo = 'rpm -qlp'
|
||||
}
|
||||
else
|
||||
{
|
||||
packageType = 'deb'
|
||||
packageInfo = 'dpkg -c'
|
||||
}
|
||||
|
||||
def command = """#!/usr/bin/env bash
|
||||
set -x
|
||||
export HOME=/home/jenkins
|
||||
echo Make rocDecode Package
|
||||
cd ${project.paths.project_build_prefix}/build/release
|
||||
sudo make package
|
||||
mkdir -p package
|
||||
mv *.${packageType} package/
|
||||
mv Testing/Temporary/*.log package/
|
||||
${packageInfo} package/*.${packageType}
|
||||
"""
|
||||
|
||||
platform.runCommand(this, command)
|
||||
platform.archiveArtifacts(this, packageHelper[1])
|
||||
}
|
||||
|
||||
return this
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env groovy
|
||||
@Library('rocJenkins@pong') _
|
||||
import com.amd.project.*
|
||||
import com.amd.docker.*
|
||||
|
||||
def runCI =
|
||||
{
|
||||
nodeDetails, jobName->
|
||||
|
||||
def prj = new rocProject('rocDECODE', 'PreCheckin')
|
||||
|
||||
def nodes = new dockerNodes(nodeDetails, jobName, prj)
|
||||
|
||||
def commonGroovy
|
||||
|
||||
boolean formatCheck = false
|
||||
|
||||
def compileCommand =
|
||||
{
|
||||
platform, project->
|
||||
|
||||
commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
|
||||
commonGroovy.runCompileCommand(platform, project, jobName)
|
||||
}
|
||||
|
||||
|
||||
def testCommand =
|
||||
{
|
||||
platform, project->
|
||||
|
||||
commonGroovy.runTestCommand(platform, project)
|
||||
}
|
||||
|
||||
def packageCommand =
|
||||
{
|
||||
platform, project->
|
||||
|
||||
commonGroovy.runPackageCommand(platform, project)
|
||||
}
|
||||
|
||||
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
|
||||
}
|
||||
|
||||
ci: {
|
||||
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
|
||||
|
||||
def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])]]
|
||||
propertyList = auxiliary.appendPropertyList(propertyList)
|
||||
|
||||
def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu22:['gfx908'], ubuntu20:['gfx906'], centos7:['gfx906'], centos8:['gfx908']])]
|
||||
jobNameList = auxiliary.appendJobNameList(jobNameList)
|
||||
|
||||
propertyList.each
|
||||
{
|
||||
jobName, property->
|
||||
if (urlJobName == jobName) {
|
||||
properties(auxiliary.addCommonProperties(property))
|
||||
}
|
||||
}
|
||||
|
||||
jobNameList.each
|
||||
{
|
||||
jobName, nodeDetails->
|
||||
if (urlJobName == jobName) {
|
||||
stage(jobName) {
|
||||
runCI(nodeDetails, jobName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
|
||||
if(!jobNameList.keySet().contains(urlJobName)) {
|
||||
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
|
||||
stage(urlJobName) {
|
||||
runCI([ubuntu22:['gfx906']], urlJobName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
# rocDecode
|
||||
|
||||
# Changelog
|
||||
|
||||
## Online Documentation
|
||||
|
||||
[rocDecode Documentation](https://github.com/ROCmSoftwarePlatform/rocDecode#rocDecode)
|
||||
|
||||
## rocDecode 0.4.0 (unreleased)
|
||||
|
||||
### Added
|
||||
|
||||
* CTest - Tests for install verification
|
||||
* Doxygen - Support for API documentation
|
||||
|
||||
### Optimizations
|
||||
|
||||
* CMakeList Cleanup
|
||||
* 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`
|
||||
* libva-dev - `2.7.0-2` / `2.14.0-1`
|
||||
* rocDecode Setup Script - `V1.1`
|
||||
@@ -1,4 +1,4 @@
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -19,52 +19,239 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
project(rocdecode)
|
||||
set(VERSION "0.2.0")
|
||||
set(VERSION "0.4.0")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory")
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "Include install directory")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
find_program(MAKE_NSIS_EXE makensis)
|
||||
find_program(RPMBUILD_EXE rpmbuild)
|
||||
find_program(DPKG_EXE dpkg)
|
||||
|
||||
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
|
||||
# avoid setting the default installation path to /usr/local
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX ${ROCM_PATH} CACHE PATH "rocDecode default installation path" FORCE)
|
||||
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
set(DEFAULT_BUILD_TYPE "Release")
|
||||
set(ENHANCED_MESSAGE ON)
|
||||
|
||||
if(ENHANCED_MESSAGE)
|
||||
string(ASCII 27 Esc)
|
||||
set(ColourReset "${Esc}[m")
|
||||
set(Red "${Esc}[31m")
|
||||
set(Green "${Esc}[32m")
|
||||
set(Yellow "${Esc}[33m")
|
||||
set(Blue "${Esc}[34m")
|
||||
set(BoldBlue "${Esc}[1;34m")
|
||||
set(Magenta "${Esc}[35m")
|
||||
set(Cyan "${Esc}[36m")
|
||||
set(White "${Esc}[37m")
|
||||
endif()
|
||||
message("-- ${BoldBlue}rocDecode Version -- ${VERSION}${ColourReset}")
|
||||
message("-- ${BoldBlue}rocDecode Install Path -- ${CMAKE_INSTALL_PREFIX}${ColourReset}")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH})
|
||||
set(CMAKE_CXX_COMPILER ${ROCM_PATH}/llvm/bin/clang++)
|
||||
|
||||
# rocDecode Default Options
|
||||
option(BUILD_WITH_AMD_ADVANCE "Build rocDecode for advanced AMD GPU Architecture" OFF)
|
||||
|
||||
# rocDecode Build Type
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "rocDecode Default Build Type" FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
# -O0 -- Don't Optimize output file
|
||||
# -g -- generate debugging information
|
||||
# -Og -- Optimize for debugging experience rather than speed or size
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Og")
|
||||
else()
|
||||
# -O3 -- Optimize output file
|
||||
# -DNDEBUG -- turn off asserts
|
||||
# -fPIC -- Generate position-independent code if possible
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG -fPIC")
|
||||
endif()
|
||||
message("-- ${BoldBlue}rocDecode Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}")
|
||||
|
||||
set(DEFAULT_AMDGPU_TARGETS "gfx803;gfx900;gfx906;gfx908;gfx90a;gfx940;gfx1030;gfx1031;gfx1032")
|
||||
if(BUILD_WITH_AMD_ADVANCE)
|
||||
set(DEFAULT_AMDGPU_TARGETS ${DEFAULT_AMDGPU_TARGETS} "gfx941")
|
||||
endif()
|
||||
set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
|
||||
|
||||
find_package(HIP QUIET)
|
||||
find_package(FFmpeg QUIET)
|
||||
find_package(Libva QUIET)
|
||||
|
||||
if(HIP_FOUND AND Libva_FOUND)
|
||||
include_directories(api
|
||||
src/rocdecode
|
||||
src/parser
|
||||
src/rocdecode/vaapi
|
||||
)
|
||||
file(GLOB_RECURSE SOURCES "./src/*.cpp")
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
|
||||
target_link_libraries(${PROJECT_NAME} Libva::va Libva::va_drm hip::device)
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(FILES api/rocdecode.h api/rocparser.h utils/video_demuxer.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
if(HIP_FOUND AND FFMPEG_FOUND AND Libva_FOUND)
|
||||
|
||||
# FFMPEG
|
||||
include_directories(${AVUTIL_INCLUDE_DIR} ${AVCODEC_INCLUDE_DIR}
|
||||
${SWSCALE_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR})
|
||||
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${FFMPEG_LIBRARIES})
|
||||
# LibVA
|
||||
include_directories(${LIBVA_INCLUDE_DIR})
|
||||
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${LIBVA_LIBRARY})
|
||||
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${LIBVA_DRM_LIBRARY})
|
||||
# HIP
|
||||
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::device)
|
||||
|
||||
# local include files
|
||||
include_directories(api src/rocdecode src/parser src/rocdecode/vaapi)
|
||||
# source files
|
||||
file(GLOB_RECURSE SOURCES "./src/*.cpp")
|
||||
# rocdecode.so
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
||||
|
||||
if(_FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 58.134.100)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_58_134=1)
|
||||
endif()
|
||||
|
||||
if(_FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 58.54.100)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_58_54=0)
|
||||
else()
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_58_54=1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
|
||||
target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARY_LIST})
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(FILES api/rocdecode.h api/rocparser.h utils/video_demuxer.hpp
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
||||
|
||||
message("-- ${White}AMD ROCm rocDecode -- CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}${ColourReset}")
|
||||
message("-- ${White}AMD ROCm rocDecode -- Link Libraries: ${LINK_LIBRARY_LIST}${ColourReset}")
|
||||
|
||||
enable_testing()
|
||||
include(CTest)
|
||||
add_subdirectory(samples)
|
||||
|
||||
# set package information
|
||||
set(CPACK_PACKAGE_VERSION ${VERSION})
|
||||
set(CPACK_PACKAGE_LICENSE "AMD")
|
||||
set(CPACK_PACKAGE_CONTACT "rocDecode Support <mivisionx.support@amd.com>")
|
||||
set(CPACK_PACKAGE_VENDOR "AMD ROCm")
|
||||
set(CPACK_PACKAGE_GROUP "Development/Tools")
|
||||
set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCmSoftwarePlatform/rocDecode")
|
||||
|
||||
if(ENABLE_ASAN_PACKAGING)
|
||||
set(CPACK_PACKAGE_NAME "rocDecode-asan")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode address sanitizer libraries")
|
||||
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode address sanitizer libraries")
|
||||
else()
|
||||
set(CPACK_PACKAGE_NAME "rocDecode")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode hardware-accelerated video decoder on AMD’s GPUs.
|
||||
rocDecode is a toolkit to decode videos and images 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.")
|
||||
endif()
|
||||
|
||||
# set license information
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
|
||||
# NOTE: ASAN package requires address sanitized libraries and license file
|
||||
# BUILD_DEV will be set to OFF for ASAN biulds.
|
||||
if(ENABLE_ASAN_PACKAGING)
|
||||
install(FILES ${CPACK_RESOURCE_FILE_LICENSE}
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocdecode-asan)
|
||||
else()
|
||||
install(FILES ${CPACK_RESOURCE_FILE_LICENSE}
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocdecode)
|
||||
endif()
|
||||
if(DEFINED ENV{ROCM_LIBPATCH_VERSION})
|
||||
set(CPACK_PACKAGE_VERSION
|
||||
"${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}")
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_DEBIAN_PACKAGE_RELEASE "local")
|
||||
set(CPACK_RPM_PACKAGE_RELEASE "local")
|
||||
|
||||
if(DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
|
||||
set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
|
||||
endif()
|
||||
if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
|
||||
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
|
||||
endif()
|
||||
|
||||
# Set the dependent packages
|
||||
set(rocDecode_DEBIAN_PACKAGE_LIST
|
||||
"vainfo, libva-dev, ffmpeg, libavcodec-dev, libavformat-dev, libswscale-dev")
|
||||
set(rocDecode_RPM_PACKAGE_LIST
|
||||
"libva-devel,ffmpeg, libavcodec-devel, libavformat-devel, libswscale-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)
|
||||
if(ENABLE_ASAN_PACKAGING)
|
||||
set(_rocm_core_pkg "rocm-core-asan")
|
||||
else()
|
||||
set(_rocm_core_pkg "rocm-core")
|
||||
endif()
|
||||
set(rocDecode_PACKAGE_REQS "${rocDecode_PACKAGE_REQS}, ${_rocm_core_pkg}")
|
||||
|
||||
set(rocDecode_DEBIAN_PACKAGE_LIST "${rocDecode_PACKAGE_REQS}, ${rocDecode_DEBIAN_PACKAGE_LIST}")
|
||||
set(rocDecode_RPM_PACKAGE_LIST "${rocDecode_PACKAGE_REQS}, ${rocDecode_RPM_PACKAGE_LIST}")
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${rocDecode_DEBIAN_PACKAGE_LIST}")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "${rocDecode_RPM_PACKAGE_LIST}")
|
||||
|
||||
# '%{?dist}' breaks manual builds on debian systems due to empty Provides
|
||||
execute_process(
|
||||
COMMAND rpm --eval %{?dist}
|
||||
RESULT_VARIABLE PROC_RESULT
|
||||
OUTPUT_VARIABLE EVAL_RESULT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "")
|
||||
string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE})
|
||||
set(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_HOMEPAGE})
|
||||
set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
|
||||
|
||||
set(CPACK_GENERATOR "TGZ;ZIP")
|
||||
if(EXISTS ${MAKE_NSIS_EXE})
|
||||
list(APPEND CPACK_GENERATOR "NSIS")
|
||||
endif()
|
||||
if(EXISTS ${RPMBUILD_EXE})
|
||||
list(APPEND CPACK_GENERATOR "RPM")
|
||||
message("-- ${White}rocDecode -- CPACK_RPM_PACKAGE_REQUIRES:${CPACK_RPM_PACKAGE_REQUIRES}${ColourReset}")
|
||||
endif()
|
||||
if(EXISTS ${DPKG_EXE})
|
||||
list(APPEND CPACK_GENERATOR "DEB")
|
||||
message("-- ${White}rocDecode -- CPACK_DEBIAN_PACKAGE_DEPENDS:${CPACK_DEBIAN_PACKAGE_DEPENDS}${ColourReset}")
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
else()
|
||||
if (NOT HIP_FOUND)
|
||||
message(FATAL_ERROR "-- ERROR!: HIP Not Found! - please install ROCm and HIP!")
|
||||
endif()
|
||||
if (NOT Libva_FOUND)
|
||||
message(FATAL_ERROR "-- ERROR!: libva-dev Not Found - please install libva-dev!")
|
||||
endif()
|
||||
message("-- ERROR!: ${PROJECT_NAME} excluded! please install all the dependencies and try again!")
|
||||
endif()
|
||||
if(NOT HIP_FOUND)
|
||||
message(FATAL_ERROR "-- ERROR!: HIP Not Found! - please install ROCm and HIP!")
|
||||
endif()
|
||||
if(NOT FFMPEG_FOUND)
|
||||
message(FATAL_ERROR "-- ERROR!: FFMPEG Not Found! - please insatll FFMPEG!")
|
||||
endif()
|
||||
if(NOT Libva_FOUND)
|
||||
message(FATAL_ERROR "-- ERROR!: libva-dev Not Found - please install libva-dev!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,21 +1,33 @@
|
||||
# rocDecode
|
||||
rocDecode is a high performance video decode SDK for AMD hardware
|
||||
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
* One of the supported GPUs by ROCm: [AMD Radeon™ Graphics](https://docs.amd.com/bundle/Hardware_and_Software_Reference_Guide/page/Hardware_and_Software_Support.html)
|
||||
* Linux distribution
|
||||
+ **Ubuntu** - `20.04` / `22.04`
|
||||
* Install [ROCm5.5 or later](https://docs.amd.com)
|
||||
+ **Note** - both graphics and rocm use-cases must be installed (i.e., sudo amdgpu-install --usecase=graphics,rocm --no-32).
|
||||
* CMake 3.0 or later
|
||||
* libva-dev 2.7 or later
|
||||
* [FFMPEG n4.4.2 or later](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.4.2)
|
||||
+ Ubuntu - `20.04` / `22.04`
|
||||
|
||||
* **Note** [vcnDECODE-setup.py](vcnDECODE-setup.py) script can be used for installing all the dependencies
|
||||
* [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`
|
||||
|
||||
* CMake `3.5` or later
|
||||
|
||||
* libva-dev `2.7` or later
|
||||
```
|
||||
sudo apt install libva-dev
|
||||
```
|
||||
|
||||
* [FFMPEG](https://ffmpeg.org/about.html)
|
||||
```
|
||||
sudo apt install ffmpeg libavcodec-dev libavformat-dev libswscale-dev
|
||||
```
|
||||
|
||||
* **Note** [rocDecode-setup.py](rocDecode-setup.py) script can be used for installing all the dependencies
|
||||
|
||||
## Build instructions:
|
||||
Please follow the instructions below to build and install the vcndecode library.
|
||||
Please follow the instructions below to build and install the rocDecode library.
|
||||
|
||||
```
|
||||
cd rocDecode
|
||||
mkdir build; cd build
|
||||
@@ -24,8 +36,39 @@ Please follow the instructions below to build and install the vcndecode library.
|
||||
sudo make install
|
||||
```
|
||||
|
||||
* run tests
|
||||
```
|
||||
make test
|
||||
```
|
||||
**NOTE:** run tests with verbose option `make test ARGS="-VV"`
|
||||
|
||||
* make package
|
||||
```
|
||||
sudo make test package
|
||||
```
|
||||
|
||||
## Samples:
|
||||
The tool provides a few samples to decode videos [here](samples/). Please refer to the individual folders to build and run the samples.
|
||||
|
||||
## Docker:
|
||||
Docker files to build rocDecode containers are available [here](docker/)
|
||||
Docker files to build rocDecode containers are available [here](docker/)
|
||||
|
||||
## Documentation
|
||||
|
||||
Run the steps below to build documentation locally.
|
||||
|
||||
* Doxygen
|
||||
```
|
||||
doxygen .Doxyfile
|
||||
```
|
||||
|
||||
## 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`
|
||||
* libva-dev - `2.7.0-2` / `2.14.0-1`
|
||||
* rocDecode Setup Script - `V1.1`
|
||||
@@ -31,6 +31,14 @@ THE SOFTWARE.
|
||||
#pragma once
|
||||
#include "hip/hip_runtime.h"
|
||||
|
||||
/*!
|
||||
* \file
|
||||
* \brief The AMD rocDecode Library.
|
||||
*
|
||||
* \defgroup group_amd_rocdecode rocDecode: AMD VCN Decode API
|
||||
* \brief AMD The rocDECODE is a toolkit to decode videos and images using a hardware-accelerated video decoder on AMD’s GPUs.
|
||||
*/
|
||||
|
||||
/*****************************************************************************************************/
|
||||
//! \file rocdecode.h
|
||||
//! rocDecode API provides video decoding interface to AMD GPU devices.
|
||||
|
||||
@@ -24,6 +24,14 @@ THE SOFTWARE.
|
||||
|
||||
#include "rocdecode.h"
|
||||
|
||||
/*!
|
||||
* \file
|
||||
* \brief The AMD rocParser Library.
|
||||
*
|
||||
* \defgroup group_amd_rocdecode rocDecode: AMD Decode API
|
||||
* \brief AMD The rocDECODE is a toolkit to decode videos and images using a hardware-accelerated video decoder on AMD’s GPUs.
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
################################################################################
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
################################################################################
|
||||
################################################################################
|
||||
# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil)
|
||||
# Once done this will define
|
||||
@@ -153,7 +173,7 @@ else()
|
||||
|
||||
if(FFMPEG_FOUND)
|
||||
if(NOT FFMPEG_FIND_QUIETLY)
|
||||
message("-- ${White}Using FFMPEG -- Libraries:${FFMPEG_LIBRARIES} Includes:${FFMPEG_INCLUDE_DIR}${ColourReset}")
|
||||
message("-- ${White}Using FFMPEG -- \n\tLibraries:${FFMPEG_LIBRARIES} \n\tIncludes:${FFMPEG_INCLUDE_DIR}${ColourReset}")
|
||||
endif()
|
||||
else()
|
||||
if(FFMPEG_FIND_REQUIRED)
|
||||
@@ -161,3 +181,4 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
################################################################################
|
||||
#
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2022 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
@@ -21,7 +18,8 @@
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
#
|
||||
################################################################################
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(Libdrm libdrm)
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
################################################################################
|
||||
#
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2022 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
@@ -22,6 +19,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
find_package(Libdrm REQUIRED)
|
||||
find_library(LIBVA_LIBRARY NAMES va)
|
||||
@@ -44,4 +42,11 @@ if(Libva_FOUND)
|
||||
set_target_properties(Libva::va_drm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBVA_INCLUDE_DIR}"
|
||||
IMPORTED_LOCATION "${LIBVA_DRM_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT Libva_FIND_QUIETLY)
|
||||
message("-- ${White}Using Libva -- \n\tLibraries:${LIBVA_LIBRARY} \n\tIncludes:${LIBVA_INCLUDE_DIR}${ColourReset}")
|
||||
endif()
|
||||
else()
|
||||
if(Libva_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "{Red}FindLibva -- Libva NOT FOUND${ColourReset}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Binární soubor nebyl zobrazen.
Binární soubor nebyl zobrazen.
@@ -27,28 +27,33 @@ if sys.version_info[0] < 3:
|
||||
else:
|
||||
import subprocess
|
||||
|
||||
__version__ = "1.0"
|
||||
__copyright__ = "Copyright 2023, AMD ROCm rocDecode"
|
||||
__version__ = "1.1"
|
||||
__email__ = "mivisionx.support@amd.com"
|
||||
__status__ = "Shipping"
|
||||
|
||||
# Arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--directory', type=str, default='~/rocDecode-deps',
|
||||
help='Setup home directory - optional (default:~/)')
|
||||
parser.add_argument('--ffmpeg', type=str, default='yes',
|
||||
help='FFMPEG V4.4.2 Installation (default:yes) [options:yes/no]')
|
||||
parser.add_argument('--reinstall', type=str, default='no',
|
||||
help='Remove previous setup and reinstall - optional (default:no) [options:yes/no]')
|
||||
parser.add_argument('--rocm_path', type=str, default='/opt/rocm',
|
||||
help='ROCm Installation Path - optional (default:/opt/rocm) - ROCm Installation Required')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
setupDir = args.directory
|
||||
ffmpegInstall = args.ffmpeg
|
||||
reinstall = args.reinstall
|
||||
ROCM_PATH = args.rocm_path
|
||||
|
||||
if ffmpegInstall not in ('no', 'yes'):
|
||||
if "ROCM_PATH" in os.environ:
|
||||
ROCM_PATH = os.environ.get('ROCM_PATH')
|
||||
print("\nROCm PATH set to -- "+ROCM_PATH+"\n")
|
||||
|
||||
# check ROCm installation
|
||||
if os.path.exists(ROCM_PATH):
|
||||
print("\nROCm Installation Found -- "+ROCM_PATH+"\n")
|
||||
os.system('echo ROCm Info -- && '+ROCM_PATH+'/bin/rocminfo')
|
||||
else:
|
||||
print(
|
||||
"ERROR: FFMPEG Install Option Not Supported - [Supported Options: no or yes]")
|
||||
exit()
|
||||
"WARNING: If ROCm installed, set ROCm Path with \"--rocm_path\" option for full installation [Default:/opt/rocm]\n")
|
||||
print("ERROR: rocDecode Setup requires ROCm install\n")
|
||||
exit(-1)
|
||||
|
||||
# get platfrom info
|
||||
platfromInfo = platform.platform()
|
||||
@@ -65,27 +70,19 @@ else:
|
||||
if sudoLocation != '/usr/bin/sudo':
|
||||
status, userName = subprocess.getstatusoutput("whoami")
|
||||
|
||||
# Setup Directory for Deps
|
||||
if setupDir == '~/rocDecode-deps':
|
||||
setupDir_deps = setupDir
|
||||
else:
|
||||
setupDir_deps = setupDir+'/rocDecode-deps'
|
||||
|
||||
# setup directory path
|
||||
deps_dir = os.path.expanduser(setupDir_deps)
|
||||
deps_dir = os.path.abspath(deps_dir)
|
||||
|
||||
# setup for Linux
|
||||
linuxSystemInstall = ''
|
||||
linuxCMake = 'cmake'
|
||||
linuxSystemInstall_check = ''
|
||||
linuxFlag = ''
|
||||
if "centos" in platfromInfo or "redhat" in platfromInfo:
|
||||
if "centos" in platfromInfo or "redhat" in platfromInfo or os.path.exists('/usr/bin/yum'):
|
||||
linuxSystemInstall = 'yum -y'
|
||||
linuxSystemInstall_check = '--nogpgcheck'
|
||||
if "centos-7" in platfromInfo or "redhat-7" in platfromInfo:
|
||||
linuxCMake = 'cmake3'
|
||||
os.system(linuxSystemInstall+' install cmake3')
|
||||
if not "centos" in platfromInfo or not "redhat" in platfromInfo:
|
||||
platfromInfo = platfromInfo+'-redhat'
|
||||
elif "Ubuntu" in platfromInfo or os.path.exists('/usr/bin/apt-get'):
|
||||
linuxSystemInstall = 'apt-get -y'
|
||||
linuxSystemInstall_check = '--allow-unauthenticated'
|
||||
@@ -98,118 +95,72 @@ elif os.path.exists('/usr/bin/zypper'):
|
||||
platfromInfo = platfromInfo+'-SLES'
|
||||
else:
|
||||
print("\nrocDecode Setup on "+platfromInfo+" is unsupported\n")
|
||||
print("\nrocDecode Setup Supported on: Ubuntu 20/22; CentOS 7/8; RedHat 7/8; & SLES 15-SP2\n")
|
||||
exit()
|
||||
print("\nrocDecode Setup Supported on: Ubuntu 20/22; CentOS 7/8; RedHat 8/9; & SLES 15 SP4\n")
|
||||
exit(-1)
|
||||
|
||||
# rocDecode Setup
|
||||
print("\nrocDecode Setup on: "+platfromInfo+"\n")
|
||||
print("\nrocDecode Dependencies Installation with rocDecode-setup.py V-"+__version__+"\n")
|
||||
|
||||
if userName == 'root':
|
||||
os.system(linuxSystemInstall+' update')
|
||||
os.system(linuxSystemInstall+' install sudo')
|
||||
|
||||
# Delete previous install
|
||||
if os.path.exists(deps_dir) and reinstall == 'yes':
|
||||
# install pre-reqs
|
||||
os.system('sudo -v')
|
||||
os.system(linuxSystemInstall+' update')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
|
||||
linuxSystemInstall_check+' install gcc cmake git wget unzip pkg-config inxi')
|
||||
|
||||
if "Ubuntu" in platfromInfo:
|
||||
os.system('sudo -v')
|
||||
os.system('sudo rm -rf '+deps_dir)
|
||||
print("\nrocDecode Setup: Removing Previous Install -- "+deps_dir+"\n")
|
||||
|
||||
# Re-Install
|
||||
if os.path.exists(deps_dir):
|
||||
print("\nrocDecode Setup: Re-Installing Libraries from -- "+deps_dir+"\n")
|
||||
if ffmpegInstall == 'yes':
|
||||
# FFMPEG
|
||||
if os.path.exists(deps_dir+'/FFmpeg-n4.4.2'):
|
||||
os.system('sudo -v')
|
||||
os.system('(cd '+deps_dir+'/FFmpeg-n4.4.2; sudo ' +
|
||||
linuxFlag+' make install -j8)')
|
||||
|
||||
print("\nrocDecode Dependencies Re-Installed with rocDecode-setup.py V-"+__version__+"\n")
|
||||
exit()
|
||||
# Clean Install
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
|
||||
' install vainfo libva-dev ffmpeg libavcodec-dev libavformat-dev libswscale-dev')
|
||||
else:
|
||||
print("\nrocDecode Dependencies Installation with rocDecode-setup.py V-"+__version__+"\n")
|
||||
os.system('mkdir '+deps_dir)
|
||||
# Create Build folder
|
||||
os.system('(cd '+deps_dir+'; mkdir build )')
|
||||
# install pre-reqs
|
||||
os.system('sudo -v')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
|
||||
linuxSystemInstall_check+' install gcc cmake git wget unzip pkg-config inxi vainfo')
|
||||
|
||||
# Get Installation Source
|
||||
if ffmpegInstall == 'yes':
|
||||
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')
|
||||
# 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 libavcodec-devel libavformat-devel libswscale-devel')
|
||||
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 +
|
||||
' 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 +
|
||||
' 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 +
|
||||
' install ffmpeg ffmpeg-devel')
|
||||
elif "SLES" in platfromInfo:
|
||||
# FFMPEG-4 packages
|
||||
os.system(
|
||||
'(cd '+deps_dir+'; wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n4.4.2.zip && unzip n4.4.2.zip )')
|
||||
'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 +
|
||||
' install ffmpeg-4')
|
||||
|
||||
# Install ffmpeg
|
||||
if ffmpegInstall == 'yes':
|
||||
if "Ubuntu" in platfromInfo:
|
||||
os.system('sudo -v')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
|
||||
' install autoconf automake build-essential git-core libass-dev libfreetype6-dev')
|
||||
os.system('sudo -v')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
|
||||
' install libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev')
|
||||
os.system('sudo -v')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
|
||||
' install libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev')
|
||||
os.system('sudo -v')
|
||||
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
|
||||
' install nasm yasm libx264-dev libx265-dev libnuma-dev libfdk-aac-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')
|
||||
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 +
|
||||
' 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 +
|
||||
' 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 +
|
||||
' install ffmpeg ffmpeg-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 +
|
||||
' install ffmpeg-4')
|
||||
|
||||
# FFMPEG 4 from source -- for Ubuntu, CentOS 7, & RedHat 7
|
||||
if "Ubuntu" in platfromInfo or "centos-7" in platfromInfo or "redhat-7" in platfromInfo:
|
||||
os.system('sudo -v')
|
||||
os.system(
|
||||
'(cd '+deps_dir+'/FFmpeg-n4.4.2; sudo '+linuxFlag+' ldconfig )')
|
||||
os.system('(cd '+deps_dir+'/FFmpeg-n4.4.2; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --enable-shared --disable-static)')
|
||||
os.system('(cd '+deps_dir+'/FFmpeg-n4.4.2; make -j8 )')
|
||||
os.system('sudo -v')
|
||||
os.system('(cd '+deps_dir+'/FFmpeg-n4.4.2; sudo ' +
|
||||
linuxFlag+' make install )')
|
||||
|
||||
print("\nrocDecode Dependencies Installed with rocDecode-setup.py V-"+__version__+"\n")
|
||||
print("\nrocDecode Dependencies Installed with rocDecode-setup.py V-"+__version__+"\n")
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# ##############################################################################
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
# ##############################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# videoDecode
|
||||
add_test(
|
||||
NAME
|
||||
video_decode
|
||||
COMMAND
|
||||
"${CMAKE_CTEST_COMMAND}"
|
||||
--build-and-test "${CMAKE_CURRENT_SOURCE_DIR}/videoDecode"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/videoDecode"
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--test-command "videodecode"
|
||||
-i ${CMAKE_SOURCE_DIR}/data/videos/AMD_driving_virtual_20-H264.mp4
|
||||
)
|
||||
|
||||
add_test(NAME video_decode-H265
|
||||
COMMAND videodecode
|
||||
-i ${CMAKE_SOURCE_DIR}/data/videos/AMD_driving_virtual_20-H265.mp4
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/videoDecode)
|
||||
@@ -33,6 +33,15 @@ extern "C" {
|
||||
#include <va/va_drmcommon.h>
|
||||
}
|
||||
|
||||
/*!
|
||||
* \file
|
||||
* \brief The AMD Video Demuxer for rocDecode Library.
|
||||
*
|
||||
* \defgroup group_amd_rocdecode_videodemuxer videoDemuxer: AMD rocDecode Video Demuxer API
|
||||
* \brief AMD The rocDecode Video Demuxer API.
|
||||
*/
|
||||
|
||||
|
||||
// Video Demuxer Interface class
|
||||
class VideoDemuxer {
|
||||
public:
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele