diff --git a/CMakeLists.txt b/CMakeLists.txt index 60630fb4bb..d0d89846f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,8 +96,17 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG -fPIC") endif() message("-- ${BoldBlue}rocJPEG Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}") -set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102") -set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") +set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201") + +# Set AMDGPU_TARGETS +if(DEFINED ENV{AMDGPU_TARGETS}) + set(AMDGPU_TARGETS $ENV{AMDGPU_TARGETS} CACHE STRING "List of specific machine types for library to target") +elseif(AMDGPU_TARGETS) + message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS set with -D option${ColourReset}") +else() + set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") +endif() +message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS: ${AMDGPU_TARGETS}${ColourReset}") find_package(HIP QUIET) find_package(Libva QUIET) diff --git a/samples/jpegDecode/CMakeLists.txt b/samples/jpegDecode/CMakeLists.txt index e9f3d44e9e..77c9170666 100644 --- a/samples/jpegDecode/CMakeLists.txt +++ b/samples/jpegDecode/CMakeLists.txt @@ -38,9 +38,6 @@ 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++) -set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102") -set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") - find_package(HIP QUIET) # find rocJPEG @@ -54,7 +51,7 @@ endif() if(HIP_FOUND AND ROCJPEG_FOUND) # HIP - set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::device) + set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host) # rocJPEG include_directories (${ROCJPEG_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..) set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCJPEG_LIBRARY}) diff --git a/samples/jpegDecodeBatched/CMakeLists.txt b/samples/jpegDecodeBatched/CMakeLists.txt index 77248a88ac..b72e6b3592 100644 --- a/samples/jpegDecodeBatched/CMakeLists.txt +++ b/samples/jpegDecodeBatched/CMakeLists.txt @@ -38,9 +38,6 @@ 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++) -set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102") -set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") - find_package(HIP QUIET) # find rocJPEG @@ -54,7 +51,7 @@ endif() if(HIP_FOUND AND ROCJPEG_FOUND) # HIP - set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::device) + set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host) # rocJPEG include_directories (${ROCJPEG_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..) set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCJPEG_LIBRARY}) diff --git a/samples/jpegDecodeMultiThreads/CMakeLists.txt b/samples/jpegDecodeMultiThreads/CMakeLists.txt index 03a781a987..8913e4fa42 100644 --- a/samples/jpegDecodeMultiThreads/CMakeLists.txt +++ b/samples/jpegDecodeMultiThreads/CMakeLists.txt @@ -38,9 +38,6 @@ 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++) -set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102") -set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") - find_package(HIP QUIET) # find rocJPEG @@ -57,7 +54,7 @@ find_package(Threads REQUIRED) if(HIP_FOUND AND ROCJPEG_FOUND AND Threads_FOUND) # HIP - set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::device) + set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host) #threads set(THREADS_PREFER_PTHREAD_FLAG ON) set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} Threads::Threads) diff --git a/src/rocjpeg_vaapi_decoder.cpp b/src/rocjpeg_vaapi_decoder.cpp index 7b1aa00686..e304dab55b 100644 --- a/src/rocjpeg_vaapi_decoder.cpp +++ b/src/rocjpeg_vaapi_decoder.cpp @@ -251,7 +251,9 @@ RocJpegVappiDecoder::RocJpegVappiDecoder(int device_id) : device_id_{device_id}, {"gfx1032", {1, false, false}}, {"gfx1100", {1, false, false}}, {"gfx1101", {1, false, false}}, - {"gfx1102", {1, false, false}}}; + {"gfx1102", {1, false, false}}, + {"gfx1200", {1, false, false}}, + {"gfx1201", {1, false, false}}}; }; /** @@ -315,13 +317,6 @@ RocJpegStatus RocJpegVappiDecoder::InitializeDecoder(std::string device_name, st : gcn_arch_name_base_temp + "_mi300x"; } - auto it = vcn_jpeg_spec_.find(gcn_arch_name_base_temp); - if (it != vcn_jpeg_spec_.end()) { - current_vcn_jpeg_spec_ = it->second; - } else { - ERR("ERROR: didn't find the jpeg spec for " + gcn_arch_name_base_temp); - return ROCJPEG_STATUS_NOT_INITIALIZED; - } std::vector visible_devices; GetVisibleDevices(visible_devices); @@ -353,6 +348,14 @@ RocJpegStatus RocJpegVappiDecoder::InitializeDecoder(std::string device_name, st CHECK_ROCJPEG(CreateDecoderConfig()); vaapi_mem_pool_->SetVaapiDisplay(va_display_); + + auto it = vcn_jpeg_spec_.find(gcn_arch_name_base_temp); + if (it != vcn_jpeg_spec_.end()) { + current_vcn_jpeg_spec_ = it->second; + } else { + INFO("WARNING: didn't find the vcn jpeg spec for " + gcn_arch_name_base_temp + " using the default setting"); + current_vcn_jpeg_spec_.num_jpeg_cores = 1; + } vaapi_mem_pool_->SetPoolSize(current_vcn_jpeg_spec_.num_jpeg_cores * 2); return ROCJPEG_STATUS_SUCCESS;