mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
WIP attempt to install TensorRT 8.5
This commit is contained in:
parent
0ef7bfbbb0
commit
4b562add75
25
Dockerfile
25
Dockerfile
@ -128,20 +128,27 @@ RUN /bin/mkdir -p '/usr/local/lib' && \
|
|||||||
#
|
#
|
||||||
# TensorRT Support
|
# TensorRT Support
|
||||||
#
|
#
|
||||||
# 1. Build the pycuda wheel for cp39-x86_64
|
# 1. Download and convert a model for the tensorRT runtime
|
||||||
# 2. 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
|
# Download and Convert TensorRT Model
|
||||||
# FROM base_amd64 as tensorrt-converter
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
"${CUDA_LIB_VERSION:=11.8}"
|
echo "${CUDA_LIB_VERSION:=11.8}"
|
||||||
"${CUDA_PKG_VERSION:=11-8}"
|
echo "${CUDA_PKG_VERSION:=11-8}"
|
||||||
"${CUDNN_VERSION:=8.6.0.84}"
|
echo "${CUDNN_VERSION:=8.6.0.84}"
|
||||||
"${TENSORRT_VERSION:=7.2.2}"
|
echo "${TENSORRT_VERSION:=8.5.1}"
|
||||||
|
|
||||||
# Add NVidia Repo
|
# 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 -
|
# 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
|
# 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
|
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 \
|
apt-get install -y --no-install-recommends \
|
||||||
cuda-cudart-${CUDA_PKG_VERSION} \
|
cuda-cudart-${CUDA_PKG_VERSION} \
|
||||||
cuda-compat-${CUDA_PKG_VERSION} \
|
cuda-compat-${CUDA_PKG_VERSION} \
|
||||||
cuda-cupti-${CUDA_PKG_VERSION} && \
|
cuda-cupti-${CUDA_PKG_VERSION}
|
||||||
ln -s cuda-${CUDA_LIB_VERSION} /usr/local/cuda
|
#ln -s cuda-${CUDA_LIB_VERSION} /usr/local/cuda
|
||||||
|
|
||||||
# CUDA Runtime
|
# CUDA Runtime
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
@ -35,4 +36,8 @@ apt-get install -y --no-install-recommends \
|
|||||||
|
|
||||||
# TensorRT Runtime
|
# TensorRT Runtime
|
||||||
apt-get install -y --no-install-recommends \
|
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/*
|
||||||
@ -65,7 +65,7 @@ class TensorRtDetector(DetectionApi):
|
|||||||
outputs = []
|
outputs = []
|
||||||
bindings = []
|
bindings = []
|
||||||
output_idx = 0
|
output_idx = 0
|
||||||
stream = cuda.Stream()
|
stream = cuda.cuStream()
|
||||||
for binding in self.engine:
|
for binding in self.engine:
|
||||||
binding_dims = self.engine.get_binding_shape(binding)
|
binding_dims = self.engine.get_binding_shape(binding)
|
||||||
if len(binding_dims) == 4:
|
if len(binding_dims) == 4:
|
||||||
|
|||||||
@ -2,4 +2,8 @@ cuda-python == 11.8.*
|
|||||||
tensorrt == 8.5.*
|
tensorrt == 8.5.*
|
||||||
nvidia-cuda-runtime-cu11 == 11.8.*
|
nvidia-cuda-runtime-cu11 == 11.8.*
|
||||||
nvidia-cublas-cu11 == 11.11.*
|
nvidia-cublas-cu11 == 11.11.*
|
||||||
nvidia-cudnn-cu11 == 8.7.*
|
nvidia-cudnn-cu11 == 8.7.*
|
||||||
|
pyindex-nvidia
|
||||||
|
polygraphy-trtexec
|
||||||
|
# tensorflow
|
||||||
|
# easydict
|
||||||
Loading…
Reference in New Issue
Block a user