mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Build trt libyolo_layer.so in container
This commit is contained in:
parent
6b7ef8812d
commit
46787b25e2
@ -253,8 +253,16 @@ FROM deps AS frigate
|
|||||||
WORKDIR /opt/frigate/
|
WORKDIR /opt/frigate/
|
||||||
COPY --from=rootfs / /
|
COPY --from=rootfs / /
|
||||||
|
|
||||||
|
# Build TensorRT-specific library
|
||||||
|
FROM nvcr.io/nvidia/tensorrt:23.05-py3 AS trt-deps
|
||||||
|
|
||||||
|
RUN --mount=type=bind,source=docker/tensorrt_libyolo.sh,target=/tensorrt_libyolo.sh \
|
||||||
|
/tensorrt_libyolo.sh
|
||||||
|
|
||||||
# Frigate w/ TensorRT Support as separate image
|
# Frigate w/ TensorRT Support as separate image
|
||||||
FROM frigate AS frigate-tensorrt
|
FROM frigate AS frigate-tensorrt
|
||||||
|
|
||||||
|
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
pip3 install -U /deps/trt-wheels/*.whl && \
|
pip3 install -U /deps/trt-wheels/*.whl && \
|
||||||
ln -s libnvrtc.so.11.2 /usr/local/lib/python3.9/dist-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so && \
|
ln -s libnvrtc.so.11.2 /usr/local/lib/python3.9/dist-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so && \
|
||||||
@ -263,5 +271,6 @@ RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels
|
|||||||
# Dev Container w/ TRT
|
# Dev Container w/ TRT
|
||||||
FROM devcontainer AS devcontainer-trt
|
FROM devcontainer AS devcontainer-trt
|
||||||
|
|
||||||
|
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
pip3 install -U /deps/trt-wheels/*.whl
|
pip3 install -U /deps/trt-wheels/*.whl
|
||||||
|
|||||||
10
docker/tensorrt_libyolo.sh
Executable file
10
docker/tensorrt_libyolo.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
|
# Clone tensorrt_demos repo
|
||||||
|
git clone --depth 1 https://github.com/yeahme49/tensorrt_demos.git
|
||||||
|
|
||||||
|
# Build libyolo
|
||||||
|
cd ./tensorrt_demos/plugins && make all
|
||||||
|
cp libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
||||||
Loading…
Reference in New Issue
Block a user