Skip to content

Commit 555d901

Browse files
committed
add install guide, etc.
1 parent ea08273 commit 555d901

4 files changed

Lines changed: 67 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ All the models are implemented in pytorch or mxnet first, and export a weights f
2525

2626
## Tutorials
2727

28+
- [Install the dependencies.](./tutorials/install.md)
2829
- [A guide for quickly getting started, taking lenet5 as a demo.](./tutorials/getting_started.md)
2930
- [Frequently Asked Questions (FAQ)](./tutorials/faq.md)
3031
- [Migrating from TensorRT 4 to 7](./tutorials/migrating_from_tensorrt_4_to_7.md)

tutorials/faq.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
`NvInfer.h` is one of the headers of TensorRT. If you install the tensorrt DEB package, the headers should in `/usr/include/x86_64-linux-gnu/`. If you install tensorrt TAR or ZIP file, the `include_directories` and `link_directories` of tensorrt should be added in `CMakeLists.txt`.
66

7+
`dpkg -L` can print out the contents of a DEB package.
8+
79
```
810
$ dpkg -L libnvinfer-dev
911
/.

tutorials/install.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Install the dependencies of tensorrtx
2+
3+
## Ubuntu
4+
5+
Ubuntu16.04 / cuda10.0 / cudnn7.6.5 / tensorrt7.0.0 / opencv3.3 would be the example, other versions might also work, just need you to try.
6+
7+
It is strongly recommended to use `apt` to manage software in Ubuntu.
8+
9+
### 1. Install CUDA
10+
11+
Go to [cuda-10.0-download](https://developer.nvidia.com/cuda-10.0-download-archive). Choose `Linux` -> `x86_64` -> `Ubuntu` -> `16.04` -> `deb(local)` and download the .deb package.
12+
13+
Then follow the installation instructions.
14+
15+
```
16+
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
17+
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
18+
sudo apt-get update
19+
sudo apt-get install cuda
20+
```
21+
22+
### 2. Install TensorRT
23+
24+
Go to [nvidia-tensorrt-7x-download](https://developer.nvidia.com/nvidia-tensorrt-7x-download). You might need login.
25+
26+
Choose TensorRT 7.0 and `TensorRT 7.0.0.11 for Ubuntu 1604 and CUDA 10.0 DEB local repo packages`
27+
28+
Install with following commands, after `apt install tensorrt`, it will automatically install cudnn, nvinfer, nvinfer-plugin, etc.
29+
30+
```
31+
sudo dpkg -i nv-tensorrt-repo-ubuntu1604-cuda10.0-trt7.0.0.11-ga-20191216_1-1_amd64.deb
32+
sudo apt update
33+
sudo apt install tensorrt
34+
```
35+
36+
### 3. Install OpenCV
37+
38+
```
39+
sudo add-apt-repository ppa:timsc/opencv-3.3
40+
sudo apt-get update
41+
sudo apt install libopencv-dev
42+
```
43+
44+
### 4. Check your installation
45+
46+
```
47+
dpkg -l | grep cuda
48+
dpkg -l | grep nvinfer
49+
dpkg -l | grep opencv
50+
```
51+
52+
### 5. Run tensorrtx
53+
54+
It is recommanded to go through the [getting started guide, lenet5 as a demo.](./tutorials/getting_started.md) first.
55+
56+
But if you are proficient in tensorrt, please check the readme of the model you want directly.
57+

yolov5/CMakeLists.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ find_package(CUDA REQUIRED)
1313
set(CUDA_NVCC_PLAGS ${CUDA_NVCC_PLAGS};-std=c++11;-g;-G;-gencode;arch=compute_30;code=sm_30)
1414

1515
include_directories(${PROJECT_SOURCE_DIR}/include)
16-
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
17-
message("embed_platform on")
18-
include_directories(/usr/local/cuda/targets/aarch64-linux/include)
19-
link_directories(/usr/local/cuda/targets/aarch64-linux/lib)
20-
else()
21-
message("embed_platform off")
22-
include_directories(/usr/local/cuda/include)
23-
link_directories(/usr/local/cuda/lib64)
24-
endif()
25-
16+
# include and link dirs of cuda and tensorrt, you need adapt them if yours are different
17+
# cuda
18+
include_directories(/usr/local/cuda/include)
19+
link_directories(/usr/local/cuda/lib64)
20+
# tensorrt
21+
include_directories(/usr/include/x86_64-linux-gnu/)
22+
link_directories(/usr/lib/x86_64-linux-gnu/)
2623

2724
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")
2825

0 commit comments

Comments
 (0)