Skip to content

Unable to build docker image on Apple M4 chip (required for development, not for real inference) #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks
shkarupa-alex opened this issue May 23, 2025 · 1 comment

Comments

@shkarupa-alex
Copy link

System Info

This solution from README doesn't work

DISCLAIMER
As explained here pytorch/pytorch#81224, Metal / MPS is not supported via Docker. As such inference will be CPU bound and most likely pretty slow when using this docker image on an M1/M2 ARM CPU.

docker build . -f Dockerfile --platform=linux/arm64

It raises error:

9.351 E: Unable to locate package intel-oneapi-mkl-devel
------
Dockerfile:35
--------------------
  34 |     
  35 | >>> RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  36 | >>>     intel-oneapi-mkl-devel=2024.0.0-49656 \
  37 | >>>     build-essential \
  38 | >>>     && rm -rf /var/lib/apt/lists/*
  39 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends     intel-oneapi-mkl-devel=2024.0.0-49656     build-essential     && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

Information

  • Docker
  • The CLI directly

Tasks

  • An officially supported command
  • My own modifications

Reproduction

  1. Obtain Apple with M4 chip (MacBook Pro)
  2. Checkout v1.7.0 branch
  3. Run docker build . -f Dockerfile --platform=linux/arm64

Expected behavior

There should be way to use this project as a part of docker compose (for development).

@polarathene
Copy link

polarathene commented May 25, 2025

Unable to locate package intel-oneapi-mkl-devel

That dependency was added without much context in Nov 2024 via this PR. There's a separate Intel optimized Dockerfile that is implemented a little differently, so it's a bit unclear why that was brought into a generic CPU image 🤷‍♂

Presumably the package is no longer available with the version pinned. You could try editing the Dockerfile to remove the =2024.0.0-49656 portion and see if that works.

Version pinning deps can be important, but in doing so for that to work reliably over time other deps including the base image should be pinned with care taken when updating the image (or just building at a later date depending on any deps not version pinned).


Oh right... that dep is probably x86_64 arch only for Intel, so you'd probably need to avoid that entirely (like the Dockerfile prior to that PR, or compare to the current Dockerfile and remove the changes the PR introduced).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants