FAQ and Troubleshooting¶
The shifter --help command can be very useful.
Multi-arch builds¶
Users who build on non-x86 hardware may see an error like this:
shifter: /bin/bash: Exec format error
To fix this, users can consider trying a multi-arch build. Here is an example::
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64/v8 --push -t elvis/image:latest .
This example both builds the cross-platform image and pushes it to the registry. To verify that the build did work as intended, the user can check the image metadata in the registry (for example, dockerhub) to see if the image architecture is correct.
Using Intel compilers¶
Intel previously used to require access to a license server to use Intel compilers. Fortunately for container users, this is no longer the case. Users who wish to use the Intel compilers can pull and build using one of theirIntel oneAPI HPC Toolkit images. These images come with compilers like ifort. Users can use these as a base image and compile their own application on top.
Failed to lookup Image¶
Warning
If you are trying to start many tasks at the same time with Shifter, this can create congestion on the image gateway.
If all the processes will use the same image, then you can avoid this by specifying the image in the batch submit script instead of on the command-line. See Running jobs in Shifter for an example and more details.
By specifying it as part of the Slurm directives, the image will be looked up at submission time and cached as part of the job and avoid repeated lookup on the image gateway.
If your jobs needs to use multiple images during execution then the approach above will not be sufficient. A workaround is to specify the image by its ID which will avoid the lookup. See Looking up images by ID for an example and more details.
Note that the image ID lookup should be done in advance to avoid doing it during the job.
Invalid Volume Map¶
Sometimes volume mounting a directory will fail with invalid volume map or with this error:
ERROR: unclean exit from bind-mount routine. /var/udiMount/tmp may still be mounted.
BIND MOUNT FAILED from /var/udiMount/<full path to directory> to /var/udiMount/tmp
FAILED to setup user-requested mounts.
FAILED to setup image.
This can happen for different reasons but a common case has to do with the permissions of the directory being mounted. Let's take an example
shifter --volume /global/cfs/cdirs/myproj/a/b --image=myimage bash
In order for Shifter to allow the mount, it needs to be able to see up to the last path as user nobody. The easiest way to fix this is to use setfacl to allow limited access to the directory. This needs to be done for the full path up to the final directory. For example:
setfacl -m u:nobody:x /global/cfs/cdirs/myproj/
setfacl -m u:nobody:x /global/cfs/cdirs/myproj/a
Note that only the owner of a directory can change the access controls, so you may need the project owner to fix some path elements.
GLIBC_2.25 not found¶
This error will typically contain the following line but other variations may appear.
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /opt/udiImage/modules/mpich/mpich-7.7.19/lib64/dep/libexpat.so.1)
By default Shifter automatically injects libraries to support running MPI and GPU support (where applicable). This can sometimes conflict with the contents of the image if the image uses an older version of GLIBC. If the application doesn't require MPI support you can try adding the flag --module none to disable the injection.
elvis@nid00042:~> shifter --image=elvis/test:123 --module=none /bin/bash
If your application requires MPI support, you may need to rebuild your image on top of a newer OS.
Issues with MPI No space left on device¶
This can show up as an error like the following.
create_endpoint(1361).......: OFI EP enable failed (ofi_init.c:1361:create_endpoint:No space left on device)
Try adding a --network=no_nvi to the srun command.
srun --network=no_vni shifter myapp
Development in Shifter using VSCode¶
Here's how to do remote development at NERSC, inside of Shifter containers, using Visual Studio Code on your local machine. This will make the remote VS-Code server instance at NERSC run inside the the container instance, so the container's file system will be fully visible to VS-Code.
VS code doesn't natively support non-Docker-like container runtimes yet, the workaround described below works well in practice though. The procedure is a bit involved, but the result is worth the effort.
Requirements¶
You'll need VS-Code >= v1.64 (older versions don't support the SSH RemoteCommand setting)
Step 1¶
At NERSC, create a script $HOME/.local/bin/run-shifter that looks like this
#!/bin/sh
export XDG_RUNTIME_DIR="${TMPDIR:-/tmp}/`whoami`/run"
exec shifter --image="$1"
This is necessary since VS-Code tries to access the $XDG_RUNTIME_DIR. At NERSC, $XDG_RUNTIME_DIR points to /run/user/YOUR_UID by default, which is not accessible from within Shifter container instances, so we need to override the default location.
Step 2¶
In your "$HOME/.ssh/config" on your local system, add something like
Host someimage~*
RemoteCommand ~/.local/bin/run-shifter someorg/someimage:latest
RequestTTY yes
Host otherimage~*
RemoteCommand ~/.local/bin/run-shifter someorg/someimage:latest
RequestTTY yes
Host perlmutter*.nersc.gov
IdentityFile ~/.ssh/nersc
Host perlmutter someimage~perlmutter otherimage~perlmutter
HostName perlmutter.nersc.gov
User YOUR_NERSC_USERNAME
Test whether this works by running ssh someimage~perlmutter on your local system. This should drop you into an SSH session running inside of an instance of the someorg/someimage:latest container image at NERSC.
Step 3¶
In your VS-Code settings on your local system, set
"remote.SSH.enableRemoteCommand": true
Step 4¶
Since VS-Code reuses remote server instances, the above is not sufficient to run multiple container images on the same NERSC host at the same time. To get separate (per container image) VS-Code server instances on the same host, add something like this to your VS-Code settings on your local system:
"remote.SSH.serverInstallPath": {
"someimage~perlmutter": "$HOME/.vscode-container/someimage",
"otherimage~perlmutter": "$HOME/.vscode-container/otherimage"
}
Step 5¶
Connect to NERSC from with VS-Code running your local system:
F1 > "Connect to Host" > "someimage~perlmutter” should now start a remote VS-Code session with the VS-Code server component running inside a Shifter container instance at NERSC. The same for "otherimage~perlmutter".
Tips and tricks¶
If things don't work, try "Kill server on remote" from VS-Code and reconnect.
You can also try starting over from scratch with brute force: Close the VS-Code remote connection. Then, from an external terminal, kill the remote VS-Code server instance (and everything else):
ssh perlmutter
pkill -9 node
(This will kill all Node.jl processes you own on the remote host.)
Remove the ~/.vscode-server directory in your NERSC home directory.
Further troubleshooting¶
If you have a Shifter question or problem, please open a ticket at help.nersc.gov.