diff --git a/cmake/package.cmake b/cmake/package.cmake index 26a6c0b69b6..7c6bbf1ee9a 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -25,6 +25,10 @@ elseif (ENABLE_CPU) set(CPACK_MS_BACKEND "ms") set(CPACK_MS_TARGET "cpu") set(CPACK_MS_PACKAGE_NAME "mindspore") +elseif (ENABLE_ACL) + set(CPACK_MS_BACKEND "debug") + set(CPACK_MS_TARGET "ascend-gpu-cpu") + set(CPACK_MS_PACKAGE_NAME "mindspore-ascend") else () set(CPACK_MS_BACKEND "debug") set(CPACK_MS_TARGET "ascend-gpu-cpu") @@ -115,11 +119,9 @@ if (ENABLE_MINDDATA) DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore ) - file(GLOB_RECURSE TINYXML2_LIB_LIST - ${tinyxml2_LIBPATH}/libtinyxml2* - ) + file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/libtinyxml2*) install( - FILES ${TINYXML2_LIB_LIST} + FILES ${TINYXML2_LIB_LIST} DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore ) diff --git a/mindspore/ccsrc/cxx_api/CMakeLists.txt b/mindspore/ccsrc/cxx_api/CMakeLists.txt index 10e1960da49..c60bf7d10f6 100644 --- a/mindspore/ccsrc/cxx_api/CMakeLists.txt +++ b/mindspore/ccsrc/cxx_api/CMakeLists.txt @@ -89,3 +89,31 @@ if (ENABLE_D) target_link_libraries(mindspore_shared_lib PRIVATE ${adump_server}) endif () +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + set(MINDSPORE_RPATH $ORIGIN) + if (ENABLE_D) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64/plugin/opskernel) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/plugin/opskernel) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/add-ons) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) + elseif (ENABLE_ACL) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/atc/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/atc/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/atc/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/acllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/acllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/acllib/lib64) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/add-ons) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) + set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) + endif () + + set_target_properties(mindspore_shared_lib PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH}) +endif () diff --git a/mindspore/ccsrc/cxx_api/serialization.cc b/mindspore/ccsrc/cxx_api/serialization.cc index e640328b237..8a8b26b00b8 100644 --- a/mindspore/ccsrc/cxx_api/serialization.cc +++ b/mindspore/ccsrc/cxx_api/serialization.cc @@ -70,12 +70,15 @@ static Buffer ReadFile(const std::string &file) { Graph Serialization::LoadModel(const std::string &file, ModelType model_type) { Buffer data = ReadFile(file); + if (data.Data() == nullptr) { + MS_LOG(EXCEPTION) << "Read file " << file << " failed."; + } if (model_type == kMindIR) { FuncGraphPtr anf_graph = nullptr; try { anf_graph = ConvertStreamToFuncGraph(reinterpret_cast(data.Data()), data.DataSize()); } catch (std::exception &e) { - MS_LOG(ERROR) << "Load MindIR failed."; + MS_LOG(EXCEPTION) << "Load MindIR failed."; } return Graph(std::make_shared(anf_graph, kMindIR));