INSTALL.md
June 18, 2024 ยท View on GitHub
Installation Guide for C++
-
Install TensorRT using TensorRT official guidance.
Click here for Windows guide
- Download the TensorRT zip file that matches the Windows version you are using.
- Choose where you want to install TensorRT. The zip file will install everything into a subdirectory called
TensorRT-8.x.x.x. This new subdirectory will be referred to as<installpath>in the steps below. - Unzip the
TensorRT-8.x.x.x.Windows10.x86_64.cuda-x.x.zipfile to the location that you chose. Where:
8.x.x.xis your TensorRT versioncuda-x.xis CUDA version11.6,11.8or12.0
- Add the TensorRT library files to your system
PATH. To do so, copy the DLL files from<installpath>/libto your CUDA installation directory, for example,C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\bin, wherevX.Yis your CUDA version. The CUDA installer should have already added the CUDA path to your system PATH.
-
Download and install any recent OpenCV for Windows.
-
Modify TensorRT and OpenCV paths in CMakelists.txt:
# Find and include OpenCV set(OpenCV_DIR "your path to OpenCV") find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) # Set TensorRT path if not set in environment variables set(TENSORRT_DIR "your path to TensorRT") -
Build project by using the following commands or cmake-gui(Windows).
- Windows:
mkdir build cd build cmake .. cmake --build . --config Release- Linux(not tested):
mkdir build cd build && mkdir out_dir cmake .. make -
Finally, copy the opencv dll files such as
opencv_world490.dllandopencv_videoio_ffmpeg490_64.dllinto the<depth_anything_installpath>/build/Releasefolder.
Tested Environment
- TensorRT 8.6
- CUDA 11.6
- Windows 10