Closed sean-smith closed 1 year ago
It's the case by default, --container-env
is used to override environment variables that are already set in the container image, as the environment variables in the container have precedence over the environment variables from the job.
$ srun --container-image=nvcr.io#nvidia/pytorch:23.09-py3 env | grep NCCL
pyxis: importing docker image: nvcr.io#nvidia/pytorch:23.09-py3
pyxis: imported docker image: nvcr.io#nvidia/pytorch:23.09-py3
NCCL_IB_PCI_RELAXED_ORDERING=0
NCCL_VERSION=2.18.5
$ NCCL_DEBUG=info srun --container-image=nvcr.io#nvidia/pytorch:23.09-py3 env | grep NCCL
pyxis: importing docker image: nvcr.io#nvidia/pytorch:23.09-py3
pyxis: imported docker image: nvcr.io#nvidia/pytorch:23.09-py3
NCCL_DEBUG=info
NCCL_IB_PCI_RELAXED_ORDERING=0
NCCL_VERSION=2.18.5
Is there a way to export all environment variables without explicitly setting them in
--container-env=
?Basically I want to do this: