From 80bb7170e3ee2ed33b3e01fcc3c3604f375617d0 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 18 Sep 2024 10:53:28 -0600 Subject: [PATCH] Get build working with onnx --- .github/workflows/ci.yml | 63 +++++------------------- docker/rocm/Dockerfile | 12 +++-- docker/rocm/requirements-wheels-rocm.txt | 1 + 3 files changed, 20 insertions(+), 56 deletions(-) create mode 100644 docker/rocm/requirements-wheels-rocm.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e14516b04..619d71d48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,57 +179,18 @@ jobs: h8l.tags=${{ steps.setup.outputs.image-name }}-h8l *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-h8l *.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-h8l,mode=max - #- name: AMD/ROCm general build - # env: - # AMDGPU: gfx - # HSA_OVERRIDE: 0 - # uses: docker/bake-action@v3 - # with: - # push: true - # targets: rocm - # files: docker/rocm/rocm.hcl - # set: | - # rocm.tags=${{ steps.setup.outputs.image-name }}-rocm - # *.cache-from=type=gha - #- name: AMD/ROCm gfx900 - # env: - # AMDGPU: gfx900 - # HSA_OVERRIDE: 1 - # HSA_OVERRIDE_GFX_VERSION: 9.0.0 - # uses: docker/bake-action@v3 - # with: - # push: true - # targets: rocm - # files: docker/rocm/rocm.hcl - # set: | - # rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx900 - # *.cache-from=type=gha - #- name: AMD/ROCm gfx1030 - # env: - # AMDGPU: gfx1030 - # HSA_OVERRIDE: 1 - # HSA_OVERRIDE_GFX_VERSION: 10.3.0 - # uses: docker/bake-action@v3 - # with: - # push: true - # targets: rocm - # files: docker/rocm/rocm.hcl - # set: | - # rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1030 - # *.cache-from=type=gha - #- name: AMD/ROCm gfx1100 - # env: - # AMDGPU: gfx1100 - # HSA_OVERRIDE: 1 - # HSA_OVERRIDE_GFX_VERSION: 11.0.0 - # uses: docker/bake-action@v3 - # with: - # push: true - # targets: rocm - # files: docker/rocm/rocm.hcl - # set: | - # rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1100 - # *.cache-from=type=gha + - name: AMD/ROCm general build + env: + AMDGPU: gfx + HSA_OVERRIDE: 0 + uses: docker/bake-action@v3 + with: + push: true + targets: rocm + files: docker/rocm/rocm.hcl + set: | + rocm.tags=${{ steps.setup.outputs.image-name }}-rocm + *.cache-from=type=gha # The majority of users running arm64 are rpi users, so the rpi # build should be the primary arm64 image assemble_default_build: diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index a1a6fa934..a1d6ce832 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -23,11 +23,11 @@ COPY docker/rocm/rocm-pin-600 /etc/apt/preferences.d/ RUN apt-get update -RUN apt-get -y install --no-install-recommends migraphx +RUN apt-get -y install --no-install-recommends migraphx hipfft roctracer RUN apt-get -y install --no-install-recommends migraphx-dev RUN mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib -RUN cd /opt/rocm-$ROCM/lib && cp -dpr libMIOpen*.so* libamd*.so* libhip*.so* libhsa*.so* libmigraphx*.so* librocm*.so* librocblas*.so* /opt/rocm-dist/opt/rocm-$ROCM/lib/ +RUN cd /opt/rocm-$ROCM/lib && cp -dpr libMIOpen*.so* libamd*.so* libhip*.so* libhsa*.so* libmigraphx*.so* librocm*.so* librocblas*.so* libroctracer*.so* librocfft*.so* /opt/rocm-dist/opt/rocm-$ROCM/lib/ RUN cd /opt/rocm-dist/opt/ && ln -s rocm-$ROCM rocm RUN mkdir -p /opt/rocm-dist/etc/ld.so.conf.d/ @@ -70,6 +70,11 @@ RUN apt-get -y install libnuma1 WORKDIR /opt/frigate/ COPY --from=rootfs / / +COPY docker/rocm/requirements-wheels-rocm.txt /requirements.txt +RUN python3 -m pip install --upgrade pip \ + && pip3 uninstall -y onnxruntime-openvino \ + && pip3 install -r /requirements.txt + ####################################################################### FROM scratch AS rocm-dist @@ -100,6 +105,3 @@ ENV HSA_OVERRIDE_GFX_VERSION=$HSA_OVERRIDE_GFX_VERSION ####################################################################### FROM rocm-prelim-hsa-override$HSA_OVERRIDE as rocm-deps -# Request yolov8 download at startup -ENV DOWNLOAD_YOLOV8=1 - diff --git a/docker/rocm/requirements-wheels-rocm.txt b/docker/rocm/requirements-wheels-rocm.txt new file mode 100644 index 000000000..89d0e6096 --- /dev/null +++ b/docker/rocm/requirements-wheels-rocm.txt @@ -0,0 +1 @@ +onnxruntime-rocm @ https://github.com/NickM-27/frigate-onnxruntime-rocm/releases/download/v1.0.0/onnxruntime_rocm-1.17.3-cp39-cp39-linux_x86_64.whl \ No newline at end of file