From 76c5f2be0846b6583f7fe15213c19d6c9377b5df Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Tue, 17 May 2022 20:55:38 +0200 Subject: [PATCH 1/3] use libtorch c++ distribution with c++11 strings in gpu image --- docker/Dockerfile.ci_gpu | 3 +++ docker/install/ubuntu_install_libtorch.sh | 27 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 docker/install/ubuntu_install_libtorch.sh diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu index 5d0a642d3f20..73d13007f1d0 100644 --- a/docker/Dockerfile.ci_gpu +++ b/docker/Dockerfile.ci_gpu @@ -85,6 +85,9 @@ RUN bash /install/ubuntu_install_darknet.sh COPY install/ubuntu_install_onnx.sh /install/ubuntu_install_onnx.sh RUN bash /install/ubuntu_install_onnx.sh +COPY install/ubuntu_install_libtorch.sh /install/ubuntu_install_libtorch.sh +RUN bash /install/ubuntu_install_libtorch.sh + COPY install/ubuntu_install_tflite.sh /install/ubuntu_install_tflite.sh RUN bash /install/ubuntu_install_tflite.sh diff --git a/docker/install/ubuntu_install_libtorch.sh b/docker/install/ubuntu_install_libtorch.sh new file mode 100755 index 000000000000..d7eddc85402a --- /dev/null +++ b/docker/install/ubuntu_install_libtorch.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e +set -u +set -o pipefail + +pushd /usr/local/ +wget -q https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcpu.zip +unzip libtorch-cxx11-abi-shared-with-deps-1.11.0+cpu.zip +# now it is in /usr/local/libtorch +popd From 99c9b1f6fda96ee2d4f78992d41eb897a180dd74 Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Tue, 17 May 2022 21:14:51 +0200 Subject: [PATCH 2/3] libtorch path --- tests/scripts/task_config_build_gpu.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scripts/task_config_build_gpu.sh b/tests/scripts/task_config_build_gpu.sh index 0145eb387bf4..6f37054264c4 100755 --- a/tests/scripts/task_config_build_gpu.sh +++ b/tests/scripts/task_config_build_gpu.sh @@ -48,3 +48,4 @@ echo set\(USE_LIBBACKTRACE AUTO\) >> config.cmake echo set\(USE_CCACHE OFF\) >> config.cmake echo set\(SUMMARIZE ON\) >> config.cmake echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake +echo set\(USE_LIBTORCH /usr/local/libtorch\) >> config.cmake From bc67c34edacef4b88d943b8f45f7919e4d1fae60 Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Wed, 18 May 2022 16:21:26 +0200 Subject: [PATCH 3/3] don't activate libtorch before merging the image --- tests/scripts/task_config_build_gpu.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/scripts/task_config_build_gpu.sh b/tests/scripts/task_config_build_gpu.sh index 6f37054264c4..0145eb387bf4 100755 --- a/tests/scripts/task_config_build_gpu.sh +++ b/tests/scripts/task_config_build_gpu.sh @@ -48,4 +48,3 @@ echo set\(USE_LIBBACKTRACE AUTO\) >> config.cmake echo set\(USE_CCACHE OFF\) >> config.cmake echo set\(SUMMARIZE ON\) >> config.cmake echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake -echo set\(USE_LIBTORCH /usr/local/libtorch\) >> config.cmake