Skip to content

Commit

Permalink
Merge pull request #1457 from ROCm/kg/canny-fix
Browse files Browse the repository at this point in the history
Cherry-pick - GFX942 Fix & Ubuntu 24.04 Failures Fix (#1450)
  • Loading branch information
vamovsik authored Dec 9, 2024
2 parents f0e86f9 + 5c32700 commit 4e9fe30
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 159 deletions.
51 changes: 24 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,40 @@
Documentation for MIVisionX is available at
[https://rocm.docs.amd.com/projects/MIVisionX/en/latest/doxygen/html/index.html](https://rocm.docs.amd.com/projects/MIVisionX/en/latest/doxygen/html/index.html)

## MIVisionX 3.1.0 (unreleased)
## (Unreleased) MIVisionX 3.2.0

### Changes
### Changed

* Setup: OpenCV package install for Ubuntu

### Known issues

* Installation on CentOS/RedHat/SLES requires the manual installation of the `FFMPEG` & `OpenCV` dev packages.
* Hardware decode requires the ROCm `graphics` usecase.

### Upcoming changes

* Optimized audio augmentations support for VX_RPP


## MIVisionX 3.1.0 for ROCm 6.3.1

### Changed
* AMD Clang is now the default CXX and C compiler.
* Setup: rocdecode install disabled
* Package: rocdecode dependency removed

### Removals

### Optimizations

### Resolved issues

* Canny failure on MI300 - Fixed
* Ubuntu 24.04 CTest Failures - Fixed

### Known issues
* Package install requires `OpenCV` manual install
* CentOS/RedHat/SLES requires `FFMPEG Dev` package manual install
* CentOS/RedHat/SLES requires `OpenCV` & `FFMPEG` dev package manual install
* Hardware decode requires rocm usecase `graphics`

### Upcoming changes
* Optimized audio augmentations support for VX_RPP

### Tested configurations

* Windows `10` / `11`
* Linux distribution
+ Ubuntu - `20.04` / `22.04`
+ CentOS - `7`
+ RHEL - `8` / `9`
+ SLES - `15-SP5`
* ROCm: rocm-core - `6.3.0.60300`
* RPP - `1.9.0.60300`
* miopen-hip - `3.2.0.60300`
* migraphx - `2.11.0.60300`
* OpenCV - [4.6.0](https://github.com/opencv/opencv/releases/tag/4.6.0)
* FFMPEG - [n4.4.2](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.4.2)
* Dependencies for all the above packages
* MIVisionX Setup Script - `V3.7.0`

## MIVisionX 3.0.0 for ROCm 6.3.0

### Changes
Expand Down
28 changes: 16 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
cmake_minimum_required(VERSION 3.5)

# ROCM Path
if(DEFINED ENV{ROCM_PATH})
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Default ROCm installation path")
elseif(ROCM_PATH)
message("-- INFO:ROCM_PATH Set -- ${ROCM_PATH}")
else()
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
endif()
# Set AMD Clang as default compiler
if (NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS "${ROCM_PATH}/bin/amdclang++")
set(CMAKE_C_COMPILER ${ROCM_PATH}/bin/amdclang)
set(CMAKE_CXX_COMPILER ${ROCM_PATH}/bin/amdclang++)
endif()

set(VERSION "3.1.0")

# Set Project Version and Language
Expand All @@ -34,14 +49,6 @@ find_program(MAKE_NSIS_EXE makensis)
find_program(RPMBUILD_EXE rpmbuild)
find_program(DPKG_EXE dpkg)

# ROCM Path
if(DEFINED ENV{ROCM_PATH})
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Default ROCm installation path")
elseif(ROCM_PATH)
message("-- INFO:ROCM_PATH Set -- ${ROCM_PATH}")
else()
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
endif()
# avoid setting the default installation path to /usr/local
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${ROCM_PATH} CACHE PATH "MIVisionX default installation path" FORCE)
Expand All @@ -53,7 +60,6 @@ option(NEURAL_NET "Build MIVisionX with Neural Net Support" ON)
option(LOOM "Build MIVisionX with LOOM Support" ON)
option(GPU_SUPPORT "Build MIVisionX with GPU Support" ON)
option(MIGRAPHX "Build MIVisionX with MIGraphX Support" ON)
option(BUILD_WITH_AMD_ADVANCE "Build MIVisionX for advanced AMD GPU Architecture" OFF)

if(WIN32)
set(BACKEND "OpenCL")
Expand Down Expand Up @@ -110,8 +116,7 @@ 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")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
else()
# -O3 -- Optimize output file
# -DNDEBUG -- turn off asserts
Expand Down Expand Up @@ -158,7 +163,6 @@ message("-- ${Cyan} -D LOOM=${LOOM} [Turn ON/OFF LOOM OpenCL Modules (defaul
message("-- ${Cyan} -D GPU_SUPPORT=${GPU_SUPPORT} [Turn ON/OFF GPU support (default:ON)]${ColourReset}")
message("-- ${Cyan} -D MIGRAPHX=${MIGRAPHX} [Turn ON/OFF MIGraphX Module (default:ON)]${ColourReset}")
message("-- ${Cyan} -D BACKEND=${BACKEND} [Select MIVisionX Backend [options:CPU/OPENCL/HIP](default:HIP)]${ColourReset}")
message("-- ${Cyan} -D BUILD_WITH_AMD_ADVANCE=${BUILD_WITH_AMD_ADVANCE} [Turn ON/OFF Build for AMD advanced GPUs(default:OFF)]${ColourReset}")

add_subdirectory(amd_openvx)
add_subdirectory(amd_openvx_extensions)
Expand Down
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,56 @@ MIVisionX toolkit provides tools for accomplishing your tasks throughout the who
* Windows `10` / `11`

#### macOS
* macOS - Ventura `13` / Sonoma `14`
* macOS - Ventura `13` / Sonoma `14` / Sequoia `15`

### Libraries
* AMD Clang++ Version `18.0.0` or later - installed with ROCm
* CMake - Version `3.5` and above
```shell
sudo apt install cmake
```
* Half-precision floating-point(half) library - Version `1.12.0`
```shell
sudo apt install half
```
* MIOpen
```shell
sudo apt install miopen-hip-dev
```
* MIGraphX
```shell
sudo apt install migraphx-dev
```
* RPP
```shell
sudo apt install rpp-dev
```
* OpenCV - Version `3.X`/`4.X`
```shell
sudo apt install libopencv-dev
```
* OpenMP
```
sudo apt install libomp-dev
```
* pkg-config
```shell
sudo apt install pkg-config
```
* FFmpeg - Version `4.X`
```shell
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
```

> [!IMPORTANT]
> * On `Ubuntu 22.04` - Additional package required: `libstdc++-12-dev`
>
> ```shell
> sudo apt install libstdc++-12-dev
> ```
>[!NOTE]
> All package installs are shown with the `apt` package manager. Use the appropriate package manager for your operating system.
## Installation instructions
Expand Down
14 changes: 8 additions & 6 deletions amd_openvx/openvx/ago/ago_haf_cpu_canny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,14 @@ int HafCpu_CannyEdgeTrace_U8_U8XY
const ago_coord2d_short_t offs = dir_offsets[i];
vx_int16 x1 = x + offs.x;
vx_int16 y1 = y + offs.y;
vx_uint8 *pDst = pDstImage + y1*dstImageStrideInBytes + x1;
if (*pDst == 127)
{
*pDst |= 0x80; // *pDst = 255
*((unsigned *)pxyStack) = (y1<<16)|x1;
pxyStack++;
if(x1 >= 0 && x1 < dstWidth && y1 >= 0 && y1 < dstHeight) {
vx_uint8 *pDst = pDstImage + y1*dstImageStrideInBytes + x1;
if (*pDst == 127)
{
*pDst |= 0x80; // *pDst = 255
*((unsigned *)pxyStack) = (y1<<16)|x1;
pxyStack++;
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions amd_openvx/openvx/hipvx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ list(APPEND HIPVX_SOURCES
set_source_files_properties(${HIPVX_SOURCES} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)

set(HIP_CXX_FLAGS -std=gnu++14)
set(COMPILER_FOR_HIP ${ROCM_PATH}/llvm/bin/clang++)
set(CMAKE_CXX_COMPILER ${COMPILER_FOR_HIP})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HIP_CXX_FLAGS}")

add_library(${PROJECT_NAME} OBJECT ${HIPVX_SOURCES})
Expand Down
Loading

0 comments on commit 4e9fe30

Please sign in to comment.