WIP attempt to install TensorRT 8.5

This commit is contained in:
Nate Meyer 2022-12-11 11:06:00 -05:00
parent 0ef7bfbbb0
commit 4b562add75
4 changed files with 34 additions and 18 deletions

View File

@ -128,20 +128,27 @@ RUN /bin/mkdir -p '/usr/local/lib' && \
#
# TensorRT Support
#
# 1. Build the pycuda wheel for cp39-x86_64
# 2. Download and convert a model for the tensorRT runtime
# 1. Download and convert a model for the tensorRT runtime
#
####
# Build CUDA Python Bindings for Python 3.9
# FROM wget as pycuda-build
# ARG DEBIAN_FRONTEND
# RUN --mount=type=bind,source=docker/build_pycuda.sh,target=/build/build_pycuda.sh \
# /build/build_pycuda.sh
# Download and Convert TensorRT Model
# FROM base_amd64 as tensorrt-converter
## TODO
# RUN apt-get update && apt-get install -y --no-install-recommends git sudo software-properties-common \
# cmake build-essential unzip python3.9-dev libnvinfer-dev python-is-python3 libnvparsers-dev libnvinfer-plugin-dev
# RUN git clone https://github.com/jkjung-avt/tensorrt_demos.git /tensorrt_demos
# ENV CUDA_HOME=/usr/local/cuda
# ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
# ENV PATH=$PATH:$CUDA_HOME/bin
# RUN python3 -m pip install --upgrade pip
# # ADD install_protobuf.sh /install_protobuf.sh
# # RUN /install_protobuf.sh
# RUN pip3 install cython protobuf onnx==1.4.1
# RUN cd /tensorrt_demos/yolo && ./download_yolo.sh
# ADD run.sh /run.sh

View File

@ -2,12 +2,13 @@
set -euxo pipefail
"${CUDA_LIB_VERSION:=11.8}"
"${CUDA_PKG_VERSION:=11-8}"
"${CUDNN_VERSION:=8.6.0.84}"
"${TENSORRT_VERSION:=7.2.2}"
echo "${CUDA_LIB_VERSION:=11.8}"
echo "${CUDA_PKG_VERSION:=11-8}"
echo "${CUDNN_VERSION:=8.6.0.84}"
echo "${TENSORRT_VERSION:=8.5.1}"
# Add NVidia Repo
apt-get -qq update && apt-get install -y --no-install-recommends software-properties-common
# wget -q -O - https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/3bf863cc.pub | apt-key add -
# echo "deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ /" | tee /etc/apt/sources.list.d/nvidia-cuda.list
wget https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.0-1_all.deb
@ -19,8 +20,8 @@ apt-get -qq update
apt-get install -y --no-install-recommends \
cuda-cudart-${CUDA_PKG_VERSION} \
cuda-compat-${CUDA_PKG_VERSION} \
cuda-cupti-${CUDA_PKG_VERSION} && \
ln -s cuda-${CUDA_LIB_VERSION} /usr/local/cuda
cuda-cupti-${CUDA_PKG_VERSION}
#ln -s cuda-${CUDA_LIB_VERSION} /usr/local/cuda
# CUDA Runtime
apt-get install -y --no-install-recommends \
@ -35,4 +36,8 @@ apt-get install -y --no-install-recommends \
# TensorRT Runtime
apt-get install -y --no-install-recommends \
libvinfer
tensorrt-libs python3-libnvinfer
# apt-get clean autoclean -y
# apt-get autoremove --purge -y
# rm -rf /var/lib/apt/lists/*

View File

@ -65,7 +65,7 @@ class TensorRtDetector(DetectionApi):
outputs = []
bindings = []
output_idx = 0
stream = cuda.Stream()
stream = cuda.cuStream()
for binding in self.engine:
binding_dims = self.engine.get_binding_shape(binding)
if len(binding_dims) == 4:

View File

@ -3,3 +3,7 @@ tensorrt == 8.5.*
nvidia-cuda-runtime-cu11 == 11.8.*
nvidia-cublas-cu11 == 11.11.*
nvidia-cudnn-cu11 == 8.7.*
pyindex-nvidia
polygraphy-trtexec
# tensorflow
# easydict