Skip to content
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

Parallelization of sub-dnn processing #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.0.0)
enable_language(CUDA)
find_package(OpenMP REQUIRED)
find_package(Threads REQUIRED)

set(THREADS_PREFER_PTHREAD_FLAG ON)

find_package(OpenCV REQUIRED)
find_package (gflags REQUIRED)
include_directories(/usr/local/cuda/include include)
link_directories(/usr/local/cuda/lib64 /usr/lib/aarch64-linux-gnu/nvidia/ /usr/local/cuda-12.2/targets/aarch64-linux/lib)
find_package(CUDA REQUIRED)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -O3")

add_compile_options(-D LIGHTNET_STANDALONE)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -Wall ${OpenMP_CXX_FLAGS} -D USE_DLA_STANDALONE_MODE")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0 -g -Wno-write-strings ${OpenMP_CXX_FLAGS}" -d USE_DLA_STANDALONE_MODE)


include_directories (${gflags_INCLUDE_DIR} ./include ./include/nvsci_headers)

add_executable(cudla_lightnet src/main.cc src/config_parser.cc src/cudla_context_standalone.cc src/cudla_lightnet.cc)
target_include_directories(cudla_lightnet PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(cudla_lightnet ${OpenCV_LIBS} gflags boost_system boost_filesystem z cuda cudart nvinfer nvscibuf nvscisync nvcudla cudla "stdc++fs" "stdc++" "-ldl")
3 changes: 2 additions & 1 deletion include/cudla_context_standalone.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class cuDLAContextStandalone
//!
//! \brief Construct infer context from loadable
//!
cuDLAContextStandalone(const char *loadableFilePath);
cuDLAContextStandalone(const char *loadableFilePath, const int dla_id);

//!
//! \brief Deconstructor
Expand Down Expand Up @@ -172,6 +172,7 @@ class cuDLAContextStandalone
uint64_t m_WaiterValue = 0;
#endif
cudlaTask m_Task;
int m_dla_id;
};

#endif
5 changes: 3 additions & 2 deletions include/cudla_lightnet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Lightnet
{
public:

Lightnet(ModelConfig &model_config, InferenceConfig &inference_config, std::string &engine_path, LightnetBackend backend);
Lightnet(ModelConfig &model_config, InferenceConfig &inference_config, std::string &engine_path, LightnetBackend backend, int dla_id);

~Lightnet();

Expand Down Expand Up @@ -246,8 +246,9 @@ class Lightnet
*/
std::vector<BBoxInfo> subnet_bbox_;

int dla_id_;
};

}

#endif
#endif
15 changes: 15 additions & 0 deletions include/nvsci_headers/nvsci_headers_README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.

* nvsci_headers.tbz2 contains NvSci headers and a sample nvsciipc.cfg.
* nvsciipc.cfg has to be put in /etc/.
Use the below command to copy the file to /etc directory:
$sudo cp ./nvsciipc.cfg /etc/nvsciipc.cfg
Loading