diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index 8943f1b87..d9a424ea2 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -60,6 +60,7 @@ RUN apt-get -y install libnuma1 WORKDIR /opt/frigate/ COPY --from=rootfs / / +COPY docker/rocm/rootfs/ / ####################################################################### FROM deps-prelim AS rocm-prelim-hsa-override0 diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/dependencies.d/download-models b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/dependencies.d/download-models new file mode 100644 index 000000000..e69de29bb diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/run b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/run new file mode 100755 index 000000000..418b0156b --- /dev/null +++ b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/run @@ -0,0 +1,13 @@ +#!/command/with-contenv bash +# shellcheck shell=bash +# Compile YoloV8 ONNX files into ROCm MIGraphX files + +for onnx in /config/model_cache/yolov8/*.onnx +do + mxr="${onnx%.onnx}.mxr" + if ! test -f $mxr; then + echo "processing $onnx into $mxr" + /opt/rocm/bin/migraphx-driver compile $onnx --optimize --gpu --enable-offload-copy --binary -o $mxr + fi +done + diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/timeout-up b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/timeout-up new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/timeout-up @@ -0,0 +1 @@ +0 diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/type b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/type new file mode 100644 index 000000000..bdd22a185 --- /dev/null +++ b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/up b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/up new file mode 100644 index 000000000..8fdcef491 --- /dev/null +++ b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/compile-rocm-models/run diff --git a/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/frigate/dependencies.d/compile-rocm-models b/docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/frigate/dependencies.d/compile-rocm-models new file mode 100644 index 000000000..e69de29bb