CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
update opencv dnn to support cann version >=6.3 #23936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Medify search path of libopsproto.so add libgraph_base.so to libs_cann
modify the include path of "all_ops.h"
Automatically identify the socVersion and verify it
add notice
cmake/OpenCVFindCANN.cmake
Outdated
@@ -68,14 +68,25 @@ if(CANN_INSTALL_DIR) | |||
set(HAVE_CANN OFF) | |||
return() | |||
endif() | |||
|
|||
# * libgraph_base.so 添加 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use English for comments.
cmake/OpenCVFindCANN.cmake
Outdated
@@ -58,7 +58,7 @@ if(CANN_INSTALL_DIR) | |||
return() | |||
endif() | |||
# * libopsproto.so | |||
set(lib_opsproto "${CANN_INSTALL_DIR}/opp/op_proto/built-in") | |||
set(lib_opsproto "${CANN_INSTALL_DIR}/opp/built-in/op_proto/lib/linux/${CMAKE_HOST_SYSTEM_PROCESSOR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CANN version check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${CMAKE_HOST_SYSTEM_PROCESSOR} = x86_64 or aarch64. This depends on which CPU architecture is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, that different versions of CANN SDK has different layout. M.b. we need to presume compatibility and have both branches with version check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good way. In my tests, this change is uitable for cann version 6.3 and above.
Upgrade to make compilation compatible with lower versions at the same time
cmake/OpenCVFindCANN.cmake
Outdated
@@ -5,6 +5,13 @@ if("cann${CANN_INSTALL_DIR}" STREQUAL "cann" AND DEFINED ENV{ASCEND_TOOLKIT_HOME | |||
message(STATUS "CANN: updated CANN_INSTALL_DIR from ASCEND_TOOLKIT_HOME=$ENV{ASCEND_TOOLKIT_HOME}") | |||
endif() | |||
|
|||
if(EXISTS "${CANN_INSTALL_DIR}/opp/op_proto/built-in/inc") | |||
set(LOW_CANN_VERSION "YES" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use CANN_VERSION_BELOW_6_3_ALPHA002
to make it meaningful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,this makes it easier to understand
Remove whitespace at the end of a line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Tried with this patch with old CANN and the build was successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Tried with this patch with old CANN and the build was successful.
@SaltFish-T Thanks a lot for the patch. Could you recommend ready Dockerfile for installation instructions in English for CANN SDK. It looks like it's useful have it in CI as build target at least. |
cmake/OpenCVFindCANN.cmake
Outdated
if(UNIX) | ||
else() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (NOT UNIX)
cmake/OpenCVFindCANN.cmake
Outdated
if(UNIX) | ||
else() | ||
set(HAVE_CANN OFF) | ||
message(STATUS "CANN: CANN toolkit supports unix but not ${CMAKE_SYSTEM_NAME}. Turning off HAVE_CANN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to use message(WARNING). It's highlighted red and caught by CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use message(WARNING) in every place that "set(HAVE_CANN OFF)".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Update opencv dnn to support cann version >=6.3 opencv#23936 1.modify the search path of "libopsproto.so" in OpenCVFindCANN.cmake 2.add the search path of "libgraph_base.so" in OpenCVFindCANN.cmake 3.automatic check Ascend socVersion,and test on Ascend310/Ascend310B/Ascend910B well
Update opencv dnn to support cann version >=6.3 opencv#23936 1.modify the search path of "libopsproto.so" in OpenCVFindCANN.cmake 2.add the search path of "libgraph_base.so" in OpenCVFindCANN.cmake 3.automatic check Ascend socVersion,and test on Ascend310/Ascend310B/Ascend910B well
1.modify the search path of "libopsproto.so" in OpenCVFindCANN.cmake
2.add the search path of "libgraph_base.so" in OpenCVFindCANN.cmake
3.automatic check Ascend socVersion,and test on Ascend310/Ascend310B/Ascend910B well