CTranslate2 Docker: 在linux/arm64/v8上执行格式错误

u0sqgete  于 2个月前  发布在  Docker
关注(0)|答案(1)|浏览(49)

软件/硬件设置:

  • Nvidia容器工具包版本1.11.0-rc1
  • Docker版本20.10.12,构建20.10.12-0ubuntu2~20.04.1
  • Ubuntu 20.04.5 LTS
  • ARMv8处理器修订版1

我正在尝试使用从GitHub提供的Docker镜像运行CTranslate2,但遇到了一些问题。我使用了文档中的Docker命令,但由于我试图在linux/arm64/v8平台上运行,所以出现了一些错误。

$ docker pull ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2
latest-ubuntu20.04-cuda11.2: Pulling from opennmt/ctranslate2
Digest: sha256:b206f9215f46260a43e4b0cc1e675ce4ed668bab4263eeae862f92aef795beb2
Status: Image is up to date for ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2
ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2

$ docker run --rm ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --help
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /opt/ctranslate2/bin/ct2-translator: exec format error

我还尝试使用**--platform linux/arm64/v8**运行,但得到了这个错误。

$ docker run --rm --platform linux/arm64/v8 ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 --help
Unable to find image 'ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2' locally
latest-ubuntu20.04-cuda11.2: Pulling from opennmt/ctranslate2
Digest: sha256:b206f9215f46260a43e4b0cc1e675ce4ed668bab4263eeae862f92aef795beb2
Status: Image is up to date for ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2
docker: Error response from daemon: image with reference ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64.
See 'docker run --help'.

我尝试使用CTranslate2/docker中的Dockerfile构建,但在下载Intel库时遇到了一个奇怪的错误:

$ docker build -f docker/Dockerfile .
Sending build context to Docker daemon   6.27MB
Step 1/33 : FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 as builder
---> 9915a4bd436c
Step 2/33 : RUN apt-get update &&     apt-get install -y --no-install-recommends         python3-dev         python3-pip         wget         &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
---> Using cache
---> 3ea5d64051a4
Step 3/33 : WORKDIR /root
---> Using cache
---> b2b53ebce051
Step 4/33 : ENV ONEAPI_VERSION=2023.0.0
---> Using cache
---> 8deb4922854f
Step 5/33 : ENV MKL_BUILD=25398
---> Using cache
---> c1690c6fac15
Step 6/33 : RUN wget -q https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB &&     apt-key add *.PUB &&     rm *.PUB &&     echo "deb https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/oneAPI.list &&     apt-get update &&     apt-get install -y --no-install-recommends         intel-oneapi-mkl-devel=$ONEAPI_VERSION-$MKL_BUILD         &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
---> Running in e9a37bfd77a0
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK
Get:1 https://apt.repos.intel.com/oneapi all InRelease [10.2 kB]
Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa  InRelease [1579 B]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:4 https://apt.repos.intel.com/oneapi all/main all Packages [575 kB]
Err:4 https://apt.repos.intel.com/oneapi all/main all Packages
File has unexpected size (82301 != 575480). Mirror sync in progress? [IP: 104.81.172.130 443]
Hashes of expected file:
- Filesize:575480 [weak]
- SHA512:0bd6679d44666fad76d116c1ed09006c477af56da1b9f436cb28fcef1c9400b61ce8626dfc5663b72b7d986707b0a59d90799b067828c915cd0df7aca551a0fb
- SHA256:e91a7554a31b2455a1bdb46b7ac297d4d087bf0260076167bde01bb60cf0e930
- SHA1:41c618a2f9818185eaa4c7d05de78dec14fc0d94 [weak]
- MD5Sum:d3c7b01eec8cbe3abe880c359263bf05 [weak]
Release file created at: Mon, 27 Mar 2023 16:38:50 +0000
Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa  Packages [553 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages [1234 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports focal/multiverse arm64 Packages [139 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports focal/restricted arm64 Packages [1317 B]
Get:12 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages [11.1 MB]
Get:13 http://ports.ubuntu.com/ubuntu-ports focal-updates/restricted arm64 Packages [5234 B]
Get:14 http://ports.ubuntu.com/ubuntu-ports focal-updates/multiverse arm64 Packages [9068 B]
Get:15 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 Packages [2236 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 Packages [1227 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports focal-backports/universe arm64 Packages [27.8 kB]
Get:18 http://ports.ubuntu.com/ubuntu-ports focal-backports/main arm64 Packages [54.8 kB]
Get:19 http://ports.ubuntu.com/ubuntu-ports focal-security/restricted arm64 Packages [4999 B]
Get:20 http://ports.ubuntu.com/ubuntu-ports focal-security/universe arm64 Packages [929 kB]
Get:21 http://ports.ubuntu.com/ubuntu-ports focal-security/multiverse arm64 Packages [3252 B]
Get:22 http://ports.ubuntu.com/ubuntu-ports focal-security/main arm64 Packages [1848 kB]
Fetched 20.0 MB in 3s (7338 kB/s)
Reading package lists...
E: Failed to fetch https://apt.repos.intel.com/oneapi/dists/all/main/binary-all/Packages.gz  File has unexpected size (82301 != 575480). Mirror sync in progress? [IP: 104.81.172.130 443]
Hashes of expected file:
- Filesize:575480 [weak]
- SHA512:0bd6679d44666fad76d116c1ed09006c477af56da1b9f436cb28fcef1c9400b61ce8626dfc5663b72b7d986707b0a59d90799b067828c915cd0df7aca551a0fb
- SHA256:e91a7554a31b2455a1bdb46b7ac297d4d087bf0260076167bde01bb60cf0e930
- SHA1:41c618a2f9818185eaa4c7d05de78dec14fc0d94 [weak]
- MD5Sum:d3c7b01eec8cbe3abe880c359263bf05 [weak]
Release file created at: Mon, 27 Mar 2023 16:38:50 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c wget -q https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB &&     apt-key add *.PUB &&     rm *.PUB &&     echo "deb https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/oneAPI.list &&     apt-get update &&     apt-get install -y --no-install-recommends         intel-oneapi-mkl-devel=$ONEAPI_VERSION-$MKL_BUILD         &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

如果有任何帮助,我将非常感激。

jpfvwuh4

jpfvwuh41#

当前的Dockerfile仅针对x86-64处理器进行定义和构建。我们需要为ARM处理器创建一个不同的Dockerfile。

相关问题