From f3fcf9efab1e3b01ba28c9926a961ce735cbeeaf Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Mon, 27 Sep 2021 20:14:51 -0500 Subject: [PATCH 1/7] Intel GPU support and always running as odm user. --- Dockerfile.gpu | 6 +++++- Dockerfile.gpu.intel | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.gpu.intel diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 9c79247..a739569 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -15,8 +15,12 @@ RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ RUN mkdir /var/www WORKDIR "/var/www" -COPY . /var/www +COPY --chown=odm:odm . /var/www RUN npm install && mkdir -p tmp +RUN chown -R /var/www + +USER odm + ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"] diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel new file mode 100644 index 0000000..fba7b39 --- /dev/null +++ b/Dockerfile.gpu.intel @@ -0,0 +1,34 @@ +FROM opendronemap/nodeodm:gpu + +ARG RENDER_GROUP_ID=0 + +USER root + +RUN apt-get remove --purge -y intel-opencl-icd && \ + apt-get autoremove -y + +RUN mkdir /tmp/opencl +WORKDIR /tmp/opencl +RUN apt-get update && \ + apt-get install -y --no-install-recommends ocl-icd-libopencl1 curl && \ + rm -rf /var/lib/apt/lists/* && \ + curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-gmmlib_19.3.2_amd64.deb" --output "intel-gmmlib_19.3.2_amd64.deb" && \ + curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-core_1.0.2597_amd64.deb" --output "intel-igc-core_1.0.2597_amd64.deb" && \ + curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-opencl_1.0.2597_amd64.deb" --output "intel-igc-opencl_1.0.2597_amd64.deb" && \ + curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-opencl_19.41.14441_amd64.deb" --output "intel-opencl_19.41.14441_amd64.deb" && \ + curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-ocloc_19.41.14441_amd64.deb" --output "intel-ocloc_19.04.12237_amd64.deb" && \ + dpkg -i /tmp/opencl/*.deb && \ + ldconfig && \ + rm -Rf /tmp/opencl +WORKDIR /var/www + +RUN apt-get update && \ + apt-get install -y --no-install-recommends clinfo + +RUN usermod -aG video,users odm +RUN usermod -aG video,users,odm root +RUN if [ "${RENDER_GROUP_ID}" -ne 0 ]; then groupadd -g "${RENDER_GROUP_ID}" render; fi + +USER odm + +ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"] From 14cd70ecee1764d612300e1decf234e2bf0be7d1 Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Tue, 28 Sep 2021 16:47:17 -0500 Subject: [PATCH 2/7] Try newer drivers --- Dockerfile.gpu.intel | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel index fba7b39..735d246 100644 --- a/Dockerfile.gpu.intel +++ b/Dockerfile.gpu.intel @@ -10,13 +10,14 @@ RUN apt-get remove --purge -y intel-opencl-icd && \ RUN mkdir /tmp/opencl WORKDIR /tmp/opencl RUN apt-get update && \ - apt-get install -y --no-install-recommends ocl-icd-libopencl1 curl && \ + apt-get install -y --no-install-recommends ocl-icd-libopencl1 wget && \ rm -rf /var/lib/apt/lists/* && \ - curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-gmmlib_19.3.2_amd64.deb" --output "intel-gmmlib_19.3.2_amd64.deb" && \ - curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-core_1.0.2597_amd64.deb" --output "intel-igc-core_1.0.2597_amd64.deb" && \ - curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-opencl_1.0.2597_amd64.deb" --output "intel-igc-opencl_1.0.2597_amd64.deb" && \ - curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-opencl_19.41.14441_amd64.deb" --output "intel-opencl_19.41.14441_amd64.deb" && \ - curl -L "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-ocloc_19.41.14441_amd64.deb" --output "intel-ocloc_19.04.12237_amd64.deb" && \ + wget https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-gmmlib_21.2.1_amd64.deb && \ + wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8708/intel-igc-core_1.0.8708_amd64.deb && \ + wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8708/intel-igc-opencl_1.0.8708_amd64.deb && \ + wget https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-opencl_21.38.21026_amd64.deb && \ + wget https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-ocloc_21.38.21026_amd64.deb && \ + wget https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-level-zero-gpu_1.2.21026_amd64.deb && \ dpkg -i /tmp/opencl/*.deb && \ ldconfig && \ rm -Rf /tmp/opencl From 7ff7a3e080fd3023cd862bf05959a1f183a2967c Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Tue, 28 Sep 2021 17:52:38 -0500 Subject: [PATCH 3/7] intel fixes --- Dockerfile.gpu | 3 ++- Dockerfile.gpu.intel | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index a739569..da917d3 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -15,11 +15,12 @@ RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ RUN mkdir /var/www WORKDIR "/var/www" +RUN useradd -m -d "/home/odm" -s /bin/bash odm COPY --chown=odm:odm . /var/www RUN npm install && mkdir -p tmp -RUN chown -R /var/www +RUN chown -R odm:odm /var/www USER odm diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel index 735d246..de7a5a0 100644 --- a/Dockerfile.gpu.intel +++ b/Dockerfile.gpu.intel @@ -28,7 +28,7 @@ RUN apt-get update && \ RUN usermod -aG video,users odm RUN usermod -aG video,users,odm root -RUN if [ "${RENDER_GROUP_ID}" -ne 0 ]; then groupadd -g "${RENDER_GROUP_ID}" render; fi +RUN if [ "${RENDER_GROUP_ID}" -ne 0 ]; then groupadd -g "${RENDER_GROUP_ID}" render; usermod -aG render odm; fi USER odm From c00f1b7900c6c2d00fbdb0f719311cc6f4d50513 Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Fri, 1 Oct 2021 19:45:15 -0500 Subject: [PATCH 4/7] Temporary fix for nodesource repo. --- Dockerfile.gpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index da917d3..0544e60 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -4,7 +4,7 @@ MAINTAINER Piero Toffanin EXPOSE 3000 USER root -RUN apt-get update && apt-get install -y curl gpg-agent +RUN apt-get update && apt-get install -y curl gpg-agent ca-certificates RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \ From 27d9ddfefb0e19ba9a4cd98e1ca1a024608db402 Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Mon, 4 Oct 2021 19:39:09 -0500 Subject: [PATCH 5/7] Move WORKDIR and revert certificates. --- Dockerfile.gpu | 2 +- Dockerfile.gpu.intel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 0544e60..da917d3 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -4,7 +4,7 @@ MAINTAINER Piero Toffanin EXPOSE 3000 USER root -RUN apt-get update && apt-get install -y curl gpg-agent ca-certificates +RUN apt-get update && apt-get install -y curl gpg-agent RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \ diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel index de7a5a0..5bceb83 100644 --- a/Dockerfile.gpu.intel +++ b/Dockerfile.gpu.intel @@ -21,7 +21,6 @@ RUN apt-get update && \ dpkg -i /tmp/opencl/*.deb && \ ldconfig && \ rm -Rf /tmp/opencl -WORKDIR /var/www RUN apt-get update && \ apt-get install -y --no-install-recommends clinfo @@ -30,6 +29,7 @@ RUN usermod -aG video,users odm RUN usermod -aG video,users,odm root RUN if [ "${RENDER_GROUP_ID}" -ne 0 ]; then groupadd -g "${RENDER_GROUP_ID}" render; usermod -aG render odm; fi +WORKDIR /var/www USER odm ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"] From c4bb06001ac06d6c21678f599200931619707094 Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Mon, 4 Oct 2021 23:32:27 -0500 Subject: [PATCH 6/7] Add port. --- Dockerfile.gpu.intel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.gpu.intel b/Dockerfile.gpu.intel index 5bceb83..74ab784 100644 --- a/Dockerfile.gpu.intel +++ b/Dockerfile.gpu.intel @@ -1,5 +1,7 @@ FROM opendronemap/nodeodm:gpu +EXPOSE 3000 + ARG RENDER_GROUP_ID=0 USER root From 1623651bda58aced7362fda4213bdbfcd0f68640 Mon Sep 17 00:00:00 2001 From: Branton Davis Date: Tue, 5 Oct 2021 01:01:31 -0500 Subject: [PATCH 7/7] this is apparently still needed --- Dockerfile.gpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index da917d3..0544e60 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -4,7 +4,7 @@ MAINTAINER Piero Toffanin EXPOSE 3000 USER root -RUN apt-get update && apt-get install -y curl gpg-agent +RUN apt-get update && apt-get install -y curl gpg-agent ca-certificates RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \