Images Built for Different Architectures

The Vista cluster uses NVIDIA Grace CPUs, which are ARM-based CPUs, not the x86_64 (AMD64) architecture found on most Windows and Linux computers. This is an important fact for HPC users because container images are architecture-specific, and the builds that are available for an image may not include the architecture you need. On Vista, to run a container image, it must be built for arm64.

When you pull from a URI, Apptainer fetches the image build that matches the host's architecture by default. That means if a URI provides both an arm64 and an amd64 build, Apptainer will pull the arm64 build on Vista without needing any extra flags. This was already implied in our prior examples of the apptainer pull command.

But if a URI does not offer an arm64 build, then problems will occur. On Vista, if a docker:// URI does not include an arm64 build, Apptainer will pull and convert an incompatible image anyway, then throw an error when you try to run the resulting SIF file. In the example below, we pull an image that only has an amd64 build, and we receive a warning during the pull. When we try to run the container anyway, an error results.

You can check on Docker Hub to see which architectures are available for a given image. You do this by searching for the namespace or container name, browsing to the page for the exact image you want, and clicking the " Tags" tab on that page.

In contrast to what happens with docker://, if you pull from a library:// (or some other SIF-type) URI, and that URI does not include an arm64 build, then Apptainer might simply fail instead of pulling some other build that would be incompatible with Vista. This behavior might actually be preferable to what Apptainer does in the analogous situation with a docker:// URI.

But let's say you truly do need a specific build for an architecture that does not match the host's. In that case, you can specify the architecture you want with the --arch flag on the pull command. The resulting container will of course not run until it is moved to a host with the proper architecture. Here, we explicitly request an amd64 image that cannot run on Vista:

Adding --arch to your pull command is still no guarantee that you will get exactly what you want. Let's continue to assume you are on an arm64 host like Vista. If you specify --arch arm64 to match the host, and the URI does not include a build for that architecture, then the pull command will not necessarily fail. Just as we saw in the case where --arch was not specified, the pull command might instead give you the amd64 build, if that one is available.

The lesson here is that while containers are advertised as portable, there is a caveat. You might succeed in pulling a container image, but even if you find that it works on your local laptop or on another HPC system, it is important to try it on Vista or the HPC cluster of your choice before adding it to your job script.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)