only install on supported archs

pull/17516/head
Steven Powell 2023-11-01 16:28:44 -07:00
parent dc47af631d
commit 2446584e90
2 changed files with 15 additions and 2 deletions

View File

@ -1456,6 +1456,9 @@ func validateGPUs(value, drvName, rtime string) error {
if value == "" {
return nil
}
if err := validateGPUsArch(); err != nil {
return err
}
if value != "nvidia" && value != "all" {
return errors.Errorf(`The gpus flag must be passed a value of "nvidia" or "all"`)
}
@ -1465,6 +1468,14 @@ func validateGPUs(value, drvName, rtime string) error {
return errors.Errorf("The gpus flag can only be used with the docker driver and docker container-runtime")
}
func validateGPUsArch() error {
switch runtime.GOARCH {
case "amd64", "arm64", "ppc64le":
return nil
}
return errors.Errorf("The GPUs flag is only supported on amd64, arm64 & ppc64le, currently using %s", runtime.GOARCH)
}
func getContainerRuntime(old *config.ClusterConfig) string {
paramRuntime := viper.GetString(containerRuntime)

View File

@ -211,11 +211,13 @@ RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/
clean-install cri-o cri-o-runc; fi
# install NVIDIA container toolkit
RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \
RUN export ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = 'amd64' ] || [ "$ARCH" = 'arm64' ] || [ "$ARCH" = 'ppc64el' ]; then \
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
clean-install nvidia-container-toolkit
clean-install nvidia-container-toolkit; fi
# install version.json
ARG VERSION_JSON