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
G-API: Support CUDA & TensoRT Execution Providers for ONNXRT Backend #24059
G-API: Support CUDA & TensoRT Execution Providers for ONNXRT Backend #24059
Conversation
156248b
to
42b5fa2
Compare
Based on this PR: |
static void addTensorRTExecutionProvider(Ort::SessionOptions *session_options, | ||
const cv::gapi::onnx::ep::TensorRT &trt_ep) { | ||
OrtTensorRTProviderOptions options{}; | ||
options.device_id = trt_ep.device_id; |
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.
Consider more options:
options.trt_max_workspace_size = 2147483648;
options.trt_max_partition_iterations = 10;
options.trt_min_subgraph_size = 5;
options.trt_fp16_enable = 1;
options.trt_engine_cache_enable = 1;
options.trt_engine_cache_path = "ort_tensorrt_cache";
options.trt_dump_subgraphs = 1;
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.
Well technically they can be provided via env variable:
https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#execution-provider-options
Not clear at this point which of them is important to expose to API
f2860d7
to
84e29ef
Compare
@asmorkalov We're ready to merge this |
…execution-provider G-API: Support CUDA & TensoRT Execution Providers for ONNXRT Backend opencv#24059 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [ ] I agree to contribute to the project under Apache 2 License. - [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.