Series Article Directory
Article Directory
foreword
I won’t say much about how powerful TensorRT is, because it is really easy to use.
As an inference library on Nvidia's own GPU, it has been vigorously promoted over the years, with frequent updates, timely issue feedback, and active community leaders, so don't be too NICE.
So how should we get started? We should install TensorRT first. The blogger has studied for two days and observed many bloggers’ blogs.
1. Personal environment and configuration
CUDA11.7
cuDNN8.7
TensorRT8.5.2.2
You can see that the blogger’s N card driver version is 528.33, and the adapted CUDA version number is 11.7
2. Installation steps
First CUDA and cuDNN
For those who have not installed the two links I found here, please follow the blogger’s tutorial to install
CUDA and cuDNN step by step. The installation tutorial link: https://blog.csdn.net/jhsignal/article/details/111401628
TensorRT installation
Through the blogger's tutorial above, you should have installed CUDA and cuDNN. Next, find the corresponding TensorRT installation package TensorRT download link
according to your CUDA version number : https://developer.nvidia.com/nvidia-tensorrt-8x-download For example, the cuda version of the blogger is 11.7, so what I downloaded is the 8.5 GA Update under the win system. As shown in the figure: After decompressing the TensorRT file, it will look like the following figure:
Note: Please find the corresponding path according to your own version. For example, the blogger here installed CUDA to the C drive, so he put the files in TensorRT in the corresponding location.
Core focus:
copy the header files in TensorRT-8.5.2.2\include to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include copy all
lib files in TensorRT-8.5.2.2\lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include \Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\lib\x64
Copy all dll files in TensorRT-8.5.2.2\lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin
Python installs TensorRT library
We install it in Anaconda Prompt:
CD into TensorRT-8.5.2.2/python.
This cp38 is set according to your own python version. For example, the blogger’s python3.7 is the cp37
input code segment
pip install tensorrt-8.2.3.0-cp38-none-win_amd64.whl
3. Test
Create a python project input code for testing
import tensorrt as trt
if __name__ == "__main__":
print(trt.__version__)
print("hello trt!!")
result