From b934bf23e62b7f6a89a2a73921018dd113db5fba Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Mon, 25 Sep 2023 15:30:58 -0700 Subject: [PATCH] exit on unknown distro (#594) --- scripts/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 6b90f0a9..1ee81d4c 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -198,16 +198,19 @@ if ! check_gpu nvidia-smi || [ -z "$(nvidia-smi | grep -o "CUDA Version: [0-9]*\ centos|rhel) install_cuda_driver_yum 'rhel' $OS_VERSION ;; rocky) install_cuda_driver_yum 'rhel' $(echo $OS_VERSION | cut -c1) ;; fedora) install_cuda_driver_yum $OS_NAME $OS_VERSION ;; + amzn) install_cuda_driver_yum 'fedora' '35' ;; debian) install_cuda_driver_apt $OS_NAME $OS_VERSION ;; ubuntu) install_cuda_driver_apt $OS_NAME $(echo $OS_VERSION | sed 's/\.//') ;; + *) exit ;; esac fi if ! lsmod | grep -q nvidia; then KERNEL_RELEASE="$(uname -r)" case $OS_NAME in - centos|rhel|rocky|fedora) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE kernel-headers-$KERNEL_RELEASE ;; + centos|rhel|rocky|fedora|amzn) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE kernel-headers-$KERNEL_RELEASE ;; debian|ubuntu) $SUDO apt-get -y install linux-headers-$KERNEL_RELEASE ;; + *) exit ;; esac NVIDIA_CUDA_VERSION=$($SUDO dkms status | awk -F: '/added/ { print $1 }')