Skip to content

Commit

Permalink
Fix cmake find trtexec bin
Browse files Browse the repository at this point in the history
  • Loading branch information
felixf4xu committed Nov 1, 2023
1 parent 2ee44a3 commit bf7f263
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/trtexec_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ if(TENSORRT_VERSION VERSION_LESS 8.2.1)
endif()

set(TRTEXEC_DEFAULT_BIN /usr/src/tensorrt/bin/trtexec)
if(NOT EXISTS TRTEXEC_DEFAULT_BIN)
if(NOT EXISTS ${TRTEXEC_DEFAULT_BIN})
message(STATUS "${TRTEXEC_DEFAULT_BIN} not found, download and build from source...")
include(FetchContent)
fetchcontent_declare(tensorrt
GIT_REPOSITORY https://github.com/NVIDIA/TensorRT
Expand Down Expand Up @@ -71,6 +72,8 @@ if(NOT EXISTS TRTEXEC_DEFAULT_BIN)
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
else()
message(STATUS "Found trtexec: ${TRTEXEC_DEFAULT_BIN}")
endif()

if(BUILD_TESTING)
Expand Down

0 comments on commit bf7f263

Please sign in to comment.