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

[Issue]: OpenCL Compile Failures #1365

Closed kiritigowda closed 1 week ago

kiritigowda commented 5 months ago

Problem Description

 69%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_compare.cpp.o
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:2: error: unknown type name 'clEnqueueWaitSignalAMD_fn'
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |         ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:54: error: use of undeclared identifier 'clEnqueueWaitSignalAMD_fn'; did you mean 'clEnqueueWaitSignalAMD'?
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             clEnqueueWaitSignalAMD
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:28: note: 'clEnqueueWaitSignalAMD' declared here
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                   ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:80: error: expected ';' at end of declaration
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                                                                       ^
      |                                                                                       ;

/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:520:2: error: use of undeclared identifier 'clEnqueueWriteSignalAMD_fn'; did you mean 'clEnqueueWaitSignalAMD'?
  520 |         clEnqueueWriteSignalAMD_fn clEnqueueWriteSignalAMD = (clEnqueueWriteSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWriteSignalAMD");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |         clEnqueueWaitSignalAMD
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:28: note: 'clEnqueueWaitSignalAMD' declared here
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                   ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:520:28: error: expected ';' after expression
  520 |         clEnqueueWriteSignalAMD_fn clEnqueueWriteSignalAMD = (clEnqueueWriteSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWriteSignalAMD");
      |                                   ^
      |                                   ;
[ 70%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_convertScaleAbs.cpp.o
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:520:29: error: use of undeclared identifier 'clEnqueueWriteSignalAMD'; did you mean 'clEnqueueWaitSignalAMD'?
  520 |         clEnqueueWriteSignalAMD_fn clEnqueueWriteSignalAMD = (clEnqueueWriteSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWriteSignalAMD");
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~
      |                                    clEnqueueWaitSignalAMD
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:28: note: 'clEnqueueWaitSignalAMD' declared here
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                   ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:520:56: error: use of undeclared identifier 'clEnqueueWriteSignalAMD_fn'; did you mean 'clEnqueueWaitSignalAMD'?
  520 |         clEnqueueWriteSignalAMD_fn clEnqueueWriteSignalAMD = (clEnqueueWriteSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWriteSignalAMD");
      |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                               clEnqueueWaitSignalAMD
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:519:28: note: 'clEnqueueWaitSignalAMD' declared here
  519 |         clEnqueueWaitSignalAMD_fn clEnqueueWaitSignalAMD = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWaitSignalAMD");
      |                                   ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:520:83: error: expected ';' after expression
  520 |         clEnqueueWriteSignalAMD_fn clEnqueueWriteSignalAMD = (clEnqueueWriteSignalAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueWriteSignalAMD");
      |                                                                                          ^
      |                                                                                          ;
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:521:2: error: unknown type name 'clEnqueueMakeBuffersResidentAMD_fn'
  521 |         clEnqueueMakeBuffersResidentAMD_fn clEnqueueMakeBuffersResidentAMD = (clEnqueueMakeBuffersResidentAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueMakeBuffersResidentAMD");
      |         ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:521:72: error: use of undeclared identifier 'clEnqueueMakeBuffersResidentAMD_fn'; did you mean 'clEnqueueMakeBuffersResidentAMD'?
  521 |         clEnqueueMakeBuffersResidentAMD_fn clEnqueueMakeBuffersResidentAMD = (clEnqueueMakeBuffersResidentAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueMakeBuffersResidentAMD");
      |                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                               clEnqueueMakeBuffersResidentAMD
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:521:37: note: 'clEnqueueMakeBuffersResidentAMD' declared here
  521 |         clEnqueueMakeBuffersResidentAMD_fn clEnqueueMakeBuffersResidentAMD = (clEnqueueMakeBuffersResidentAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueMakeBuffersResidentAMD");
      |                                            ^
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:521:107: error: expected ';' at end of declaration
  521 |         clEnqueueMakeBuffersResidentAMD_fn clEnqueueMakeBuffersResidentAMD = (clEnqueueMakeBuffersResidentAMD_fn)clGetExtensionFunctionAddressForPlatform(platform_id[platform_index], "clEnqueueMakeBuffersResidentAMD");
      |                                                                                                                  ^
      |                                                                                                                  ;
/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp:522:32: error: use of undeclared identifier 'clEnqueueWriteSignalAMD'; did you mean 'clEnqueueWriteImage'?
  522 |         if (clEnqueueWaitSignalAMD && clEnqueueWriteSignalAMD && clEnqueueMakeBuffersResidentAMD) {
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~
      |                                       clEnqueueWriteImage
/usr/include/CL/cl.h:1625:1: note: 'clEnqueueWriteImage' declared here
 1625 | clEnqueueWriteImage(cl_command_queue    command_queue,
      | ^
12 errors generated when compiling for gfx908.

failed to execute:/opt/rocm/llvm/bin/clang++  -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1 --offload-arch=gfx908 --offload-arch=gfx908 --offload-arch=gfx908 --offload-arch=gfx908 -O3 -Wno-format-nonliteral -parallel-jobs=4   -DCL_TARGET_OPENCL_VERSION=220 -DENABLE_HIP=0 -DENABLE_OPENCL=1 -I/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/../../amd_openvx/openvx/include -I/var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/../../amd_openvx_extensions/amd_loomsl -I/opt/rocm/include/Headers -fprofile-arcs -ftest-coverage -O3 -DNDEBUG -fPIC -std=gnu++14 -O3 -DNDEBUG -std=gnu++14 -MD -MT utilities/loom_shell/CMakeFiles/loom_shell.dir/loom_shell_util.cpp.o -MF CMakeFiles/loom_shell.dir/loom_shell_util.cpp.o.d -o "CMakeFiles/loom_shell.dir/loom_shell_util.cpp.o" -c -x hip /var/jenkins_home/workspace/ain_precheckin_MIVisionX_develop/1cekjXSoC/OpenCL/mivisionx/utilities/loom_shell/loom_shell_util.cpp
make[2]: *** [utilities/loom_shell/CMakeFiles/loom_shell.dir/build.make:76: utilities/loom_shell/CMakeFiles/loom_shell.dir/loom_shell_util.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 70%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_cornerHarris.cpp.o

[ 71%] Building CXX object amd_openvx_extensions/amd_opencv/CMakeFiles/vx_opencv.dir/source/OpenCV_cornerMinEigenVal.cpp.o

Operating System

ALL

CPU

ALL

GPU

AMD Instinct MI300

Other

No response

ROCm Version

ROCm 6.0.0

ROCm Component

MIVisionX

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

huanrwan-amd commented 2 months ago

Both @kiritigowda and I can not reproduce issue with ROCm6.2. We agree to close the issue.

hansely commented 3 weeks ago

This issue is still observed. Both clEnqueueWaitSignalAMD_fn & clEnqueueWriteSignalAMD_fn appears to be deprecated in the latest cl_Ext.h.

kiritigowda commented 2 weeks ago

@huanrwan-amd can you take a look at this?

huanrwan-amd commented 2 weeks ago

@hansely can you provide more info for the ROCm, OS and hardware version? Thanks.

hansely commented 2 weeks ago

@huanrwan-amd This is failing on the CI

Details can be found here : #1442 It is failing on rhel9 & ubuntu22.

huanrwan-amd commented 1 week ago

Hi @hansely and @kiritigowda , successfully built with the latest PR branch on MI300 machine.

[ 97%] Linking CXX shared library ../../lib/libvx_opencv.so
[ 97%] Built target vx_opencv
[ 98%] Linking CXX shared library ../../lib/libvx_loomsl.so
[ 98%] Built target vx_loomsl
[ 98%] Building CXX object utilities/loom_shell/CMakeFiles/loom_shell.dir/loom_shell_util.cpp.o
[100%] Building CXX object utilities/loom_shell/CMakeFiles/loom_shell.dir/loom_shell.cpp.o
[100%] Building CXX object utilities/loom_shell/CMakeFiles/loom_shell.dir/help.cpp.o
[100%] Linking CXX executable ../../bin/loom_shell
[100%] Built target loom_shell
kiritigowda commented 1 week ago

@hansely can you put the new package dependencies required for Ubuntu & RHEL?

hansely commented 1 week ago

Fixed in build #15095