diff --git a/docs/static/install.sh b/docs/static/install.sh old mode 100644 new mode 100755 index c3c668d0..39b3430f --- a/docs/static/install.sh +++ b/docs/static/install.sh @@ -282,62 +282,6 @@ EOF esac } -install_fedora_nvidia_kernel_drivers(){ - - #We want to give the user the choice to install the akmod kernel drivers or not, since it could break some setups - warn "+----------------------------------------------------------------------------------------------+" - warn "| WARNING: |" - warn "| Looks like the NVIDIA Kernel modules are not installed. |" - warn "| |" - warn "| This script can try to install them using akmod-nvidia (will pull all the x11 dependencies). |" - warn "| |" - warn "| |" - warn "| Otherwise you can exit the install script and install them yourself. |" - warn "| NOTE: you will need to reboot after the installation. |" - warn "+----------------------------------------------------------------------------------------------+" - - while true; do - choice_warn "Do you wish for the script to try and install them? (akmod/exit) "; - read Answer - - if [ "$Answer" = "akmod" ]; then - - DNF_VERSION=$($PACKAGE_MANAGER --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1 | cut -d. -f1) - - FEDORA_VERSION=$(rpm -E %fedora) - FREE_URL="https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VERSION}.noarch.rpm" - NONFREE_URL="https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VERSION}.noarch.rpm" - - curl -LO "$FREE_URL" - curl -LO "$NONFREE_URL" - - if [ "$DNF_VERSION" -ge 5 ]; then - # DNF5: - $SUDO $PACKAGE_MANAGER install -y "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" - $SUDO $PACKAGE_MANAGER install -y akmod-nvidia - else - # DNF4: - $SUDO $PACKAGE_MANAGER install -y "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" - $SUDO $PACKAGE_MANAGER install -y akmod-nvidia - fi - - $SUDO rm "rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" - $SUDO rm "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" - - install_cuda_driver_yum - - info "Nvidia driver installation complete, please reboot now and run the Install script again to complete the setup." - exit - - elif [ "$Answer" = "exit" ]; then - - aborted - else - warn "Invalid choice. Please enter 'akmod' or 'exit'." - fi - done -} - # ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-yum-or-dnf install_container_toolkit_yum() { info 'Installing NVIDIA container toolkit repository...' @@ -415,16 +359,16 @@ install_cuda_driver_yum() { case $PACKAGE_MANAGER in yum) $SUDO $PACKAGE_MANAGER -y install yum-utils - $SUDO $PACKAGE_MANAGER-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo + $SUDO $PACKAGE_MANAGER-config-manager --add-repo "https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo" ;; dnf) DNF_VERSION=$($PACKAGE_MANAGER --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1 | cut -d. -f1) if [ "$DNF_VERSION" -ge 5 ]; then # DNF5: Use 'addrepo' to add the repository - $SUDO $PACKAGE_MANAGER config-manager addrepo --id=nvidia-cuda --set=name="nvidia-cuda" --set=baseurl="https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo" + $SUDO $PACKAGE_MANAGER config-manager addrepo --overwrite --from-repofile="https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo" else # DNF4: Use '--add-repo' to add the repository - $SUDO $PACKAGE_MANAGER config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo + $SUDO $PACKAGE_MANAGER config-manager --add-repo "https://developer.download.nvidia.com/compute/cuda/repos/$1$2/$(uname -m)/cuda-$1$2.repo" fi ;; esac @@ -433,7 +377,7 @@ install_cuda_driver_yum() { rhel) info 'Installing EPEL repository...' # EPEL is required for third-party dependencies such as dkms and libvdpau - $SUDO $PACKAGE_MANAGER -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$2.noarch.rpm || true + $SUDO $PACKAGE_MANAGER -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-"$2".noarch.rpm || true ;; esac @@ -443,7 +387,73 @@ install_cuda_driver_yum() { $SUDO $PACKAGE_MANAGER -y install nvidia-driver-latest-dkms fi - $SUDO $PACKAGE_MANAGER -y install cuda-drivers + #added cuda-toolkit from rpm-fusion instead of cuda-drivers for fedora since it is suggested by rpm-fusion since it contains specific fedora fix + # ref: https://rpmfusion.org/Howto/CUDA#Installation + # ref: https://rpmfusion.org/Howto/CUDA#Which_driver_Package + case $1 in + fedora) $SUDO $PACKAGE_MANAGER config-manager setopt "cuda-$1$2-$(uname -m).exclude=nvidia-driver,nvidia-modprobe,nvidia-persistenced,nvidia-settings,nvidia-libXNVCtrl,nvidia-xconfig" && \ + $SUDO $PACKAGE_MANAGER -y install cuda-toolkit + ;; + centos|rhel) $SUDO $PACKAGE_MANAGER -y install cuda-drivers;; + esac +} + +install_fedora_nvidia_kernel_drivers(){ + + #We want to give the user the choice to install the akmod kernel drivers or not, since it could break some setups + warn "+----------------------------------------------------------------------------------------------+" + warn "| WARNING: |" + warn "| Looks like the NVIDIA Kernel modules are not installed. |" + warn "| |" + warn "| This script can try to install them using akmod-nvidia (will pull all the x11 dependencies). |" + warn "| |" + warn "| |" + warn "| Otherwise you can exit the install script and install them yourself. |" + warn "| NOTE: you will need to reboot after the installation. |" + warn "+----------------------------------------------------------------------------------------------+" + + while true; do + choice_warn "Do you wish for the script to try and install them? (akmod/exit) "; + read Answer + + if [ "$Answer" = "akmod" ]; then + + DNF_VERSION=$($PACKAGE_MANAGER --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1 | cut -d. -f1) + + OS_NAME=$ID + OS_VERSION=$VERSION_ID + + FREE_URL="https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${OS_VERSION}.noarch.rpm" + NONFREE_URL="https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${OS_VERSION}.noarch.rpm" + + curl -LO "$FREE_URL" + curl -LO "$NONFREE_URL" + + if [ "$DNF_VERSION" -ge 5 ]; then + # DNF5: + $SUDO $PACKAGE_MANAGER install -y "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" + $SUDO $PACKAGE_MANAGER install -y akmod-nvidia + else + # DNF4: + $SUDO $PACKAGE_MANAGER install -y "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" + $SUDO $PACKAGE_MANAGER install -y akmod-nvidia + fi + + $SUDO rm "rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" + $SUDO rm "rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" + + install_cuda_driver_yum "$OS_NAME" '41' + + info "Nvidia driver installation complete, please reboot now and run the Install script again to complete the setup." + exit + + elif [ "$Answer" = "exit" ]; then + + aborted + else + warn "Invalid choice. Please enter 'akmod' or 'exit'." + fi + done } # ref: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu @@ -607,7 +617,6 @@ install_docker() { info "Checking Nvidia Kernel Drivers presence..." if ! available nvidia-smi; then - #TODO Temporary Bypass for Fedora Headless (Cloud Edition), need to find a way to install nvidia-smi without pulling x11 OS_NAME=$ID OS_VERSION=$VERSION_ID