ROCm / MIVisionX

MIVisionX toolkit is a set of comprehensive computer vision and machine intelligence libraries, utilities, and applications bundled into a single toolkit. AMD MIVisionX also delivers a highly optimized open-source implementation of the Khronos OpenVX™ and OpenVX™ Extensions.
https://rocm.docs.amd.com/projects/MIVisionX/en/latest/
MIT License
186 stars 74 forks source link

HIP Backend - ROCm 5.3 Warning & Error #961

Closed kiritigowda closed 2 years ago

kiritigowda commented 2 years ago

Snap shot of error & warnings on ROCm 5.3

* Warnings
[ 44%] Building CXX object amd_openvx_extensions/amd_rpp/CMakeFiles/vx_rpp.dir/source/internal_publishKernels.cpp.o In file included from /opt/rocm/include/rpp/rpp.h:40, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_rpp.h:31, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h:32, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/source/internal_publishKernels.cpp:23: /opt/rocm-5.3.0/hip/include/hip/hip_runtime_api.h:25:113: note: ‘#pragma message: This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip’ 25 #pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip") ^ In file included from /opt/rocm-5.3.0/include/hip/hip_runtime_api.h:35, from /opt/rocm-5.3.0/hip/include/hip/hip_runtime_api.h:26, from /opt/rocm/include/rpp/rpp.h:40, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_rpp.h:31, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h:32, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/source/internal_publishKernels.cpp:23: /opt/rocm-5.3.0/hip/include/hip/hip_version.h:25:113: note: ‘#pragma message: This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip’ 25 #pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip") ^ In file included from /opt/rocm-5.3.0/include/hip/hip_runtime_api.h:36, from /opt/rocm-5.3.0/hip/include/hip/hip_runtime_api.h:26, from /opt/rocm/include/rpp/rpp.h:40, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_rpp.h:31, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h:32, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/source/internal_publishKernels.cpp:23: /opt/rocm-5.3.0/hip/include/hip/hip_common.h:25:113: note: ‘#pragma message: This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip’ 25 #pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip") ^ In file included from /opt/rocm-5.3.0/include/hip/hip_runtime_api.h:480, from /opt/rocm-5.3.0/hip/include/hip/hip_runtime_api.h:26, from /opt/rocm/include/rpp/rpp.h:40, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_rpp.h:31, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h:32, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/source/internal_publishKernels.cpp:23: /opt/rocm-5.3.0/hip/include/hip/amd_detail/host_defines.h:25:113: note: ‘#pragma message: This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip’ 25 #pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip") ^ In file included from /opt/rocm-5.3.0/include/hip/hip_runtime_api.h:481, from /opt/rocm-5.3.0/hip/include/hip/hip_runtime_api.h:26, from /opt/rocm/include/rpp/rpp.h:40, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_rpp.h:31, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h:32, from /long_pathname_so_that_rpms_can_package_the_debug_info/data/driver/kiriti/MIVisionX/amd_openvx_extensions/amd_rpp/source/internal_publishKernels.cpp:23: /opt/rocm-5.3.0/hip/include/hip/driver_types.h:25:113: note: ‘#pragma message: This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip’ 25 #pragma message("This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with hip")
kiritigowda commented 2 years ago

@asalmanp -- Docker to use compute-artifactory.amd.com:5000/rocm-plus-docker/compute-rocm-rel-5.3:45-ubuntu-22.04-stg2

need to run the setup script to reproduce.

kiritigowda commented 2 years ago

HIP Message -- https://github.com/ROCm-Developer-Tools/hipamd/blob/9ce0cf841d512c6a2fa88616b47e3a4d59338ac5/hip-config.cmake.in#L232

AryanSalmanpour commented 2 years ago

@kiritigowda ROCm5.3 is now public. I tested with the public version on UB22.04, and I am not able to reproduce the warning related to the hip mentioned in this issue. Please test with the public version and let me know if you still see the issue. Thanks.

kiritigowda commented 2 years ago

@asalmanp -- seeing this issue on ubuntu 22.04 base machine

In file included from /home/kiriti/develop/mivisionx-kiriti/MIVisionX/rocAL/rocAL/source/device/device_manager_hip.cpp:27:
/home/kiriti/develop/mivisionx-kiriti/MIVisionX/rocAL/rocAL/./include/device/device_manager_hip.h:56:24: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
   56 | using pRocalHip = std::shared_ptr<DeviceManagerHip>;
      |                        ^~~~~~~~~~
/home/kiriti/develop/mivisionx-kiriti/MIVisionX/rocAL/rocAL/./include/device/device_manager_hip.h:28:1: note: ‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’?
   27 | #include "hip/hip_runtime.h"
  +++ |+#include <memory>
   28 | #include <vx_ext_amd.h>
[ 78%] Building CXX object rocAL/rocAL/CMakeFiles/rocal.dir/source/device/ocl_setup.cpp.o
[ 78%] Building CXX object rocAL/rocAL/CMakeFiles/rocal.dir/source/loaders/circular_buffer.cpp.o
[ 79%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_siftCompute.cpp.o
[ 79%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_siftDetect.cpp.o
make[2]: *** [rocAL/rocAL/CMakeFiles/rocal.dir/build.make:780: rocAL/rocAL/CMakeFiles/rocal.dir/source/device/device_manager_hip.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 79%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_simpleBlobDetector.cpp.o
[ 79%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_sobel.cpp.o
[ 80%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_starFeatureDetector.cpp.o
[ 80%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_subtract.cpp.o
[ 80%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_surfCompute.cpp.o
[ 80%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_surfDetect.cpp.o
[ 81%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_threshold.cpp.o
[ 81%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_transpose.cpp.o
[ 81%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_warpAffine.cpp.o
[ 81%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_warpPerspective.cpp.o
make[1]: *** [CMakeFiles/Makefile2:734: rocAL/rocAL/CMakeFiles/rocal.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 82%] Linking CXX shared library ../../lib/libvx_opencv.so
[ 82%] Built target vx_opencv
make: *** [Makefile:156: all] Error 2
kiritigowda commented 2 years ago

@asalmanp -- PR #972 fixes my issue on Ubuntu 22.04 base machine, can you verify?

kiritigowda commented 2 years ago

@asalmanp the warnings are fixed on docker by checking for ROCM_PATH in the env variable -- https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/blob/7575e4edaf3991e7a7cbf31973c15b0e59b0f4a4/MIVisionX-setup.py#L73

kiritigowda commented 2 years ago

Develop branch has the fix, which will be merged to master with #957