diff --git a/data-science-stack b/data-science-stack index ff0e486..d31498b 100755 --- a/data-science-stack +++ b/data-science-stack @@ -34,7 +34,7 @@ OS_RELEASE=$VERSION_ID OS_RELEASE_MAJOR=${VERSION_ID%%.*} # extract major release, e.g. 1.2 -> 1, 1.2.3 -> 1 case $OS_FLAVOR$OS_RELEASE in - ubuntu18.04 | ubuntu20.04 | rhel7* | rhel8* ) + ubuntu18.04 | ubuntu20.04 | rhel7* | rhel8* | fedora32 ) ;; *) echo "Unknown system type: $OS_FLAVOR $OS_RELEASE" @@ -127,7 +127,7 @@ install_base () { wget \ which \ yum-utils - else # RHEL 8 + elif [ $OS_FLAVOR$OS_RELEASE_MAJOR = "rhel8" ]; then sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm || true sudo yum groupinstall -y 'Development Tools' sudo yum install -y \ @@ -146,6 +146,27 @@ install_base () { wget \ which \ yum-utils + elif [ $OS_FLAVOR$OS_RELEASE = "fedora32" ]; then + sudo yum groupinstall -y 'Development Tools' + sudo yum install -y \ + bzip2 \ + clang \ + curl \ + device-mapper-persistent-data \ + file \ + git \ + graphviz \ + jq \ + lvm2 \ + npm \ + screen \ + vim \ + wget \ + which \ + yum-utils + else + nvlog "ERROR: install_base(): unknown system type: $OS_FLAVOR $OS_RELEASE" + exit 1 fi set +e @@ -220,8 +241,14 @@ EOF sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r) sudo dnf -y module install nvidia-driver:460-dkms # REBOOT not necessary + elif [ $OS_FLAVOR$OS_RELEASE = "fedora32" ]; then + sudo dnf -y update + sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm + sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm + sudo dnf -y install akmod-nvidia + REBOOT=1 else - nvlog "Automated NVIDIA driver install on $OS_FLAVOR $OS_RELEASE_FULL is not supported." + nvlog "Automated NVIDIA driver install on $OS_FLAVOR $OS_RELEASE is not supported." nvlog "Please install NVIDIA driver $MIN_DRIVER or newer and run again." exit 1 fi @@ -286,6 +313,11 @@ detect_cuda () { if [ $? -ne 0 ]; then CUDA_VER=0 fi + elif which rpm > /dev/null; then + CUDA_VER=$(rpm -q --queryformat '%{VERSION}' cuda 2> /dev/null) + if [ $? -ne 0 ]; then + CUDA_VER=0 + fi else CUDA_VER=0 fi @@ -326,10 +358,17 @@ install_cuda () { sudo yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo sudo yum clean all sudo yum install -y cuda-toolkit-11-0 - else + elif [ $OS_FLAVOR$OS_RELEASE_MAJOR = "rhel8" ]; then sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo sudo dnf clean all sudo dnf -y install cuda-toolkit-11-0 + elif [ $OS_FLAVOR$OS_RELEASE = "fedora32" ]; then + sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/fedora$(rpm -E %fedora)/x86_64/cuda-fedora$(rpm -E %fedora).repo + sudo dnf clean all + sudo dnf -y install cuda-toolkit-11-0 + else + nvlog "ERROR: install_cuda(): unknown system type: $OS_FLAVOR $OS_RELEASE" + exit 1 fi fi set +e @@ -445,7 +484,7 @@ install_docker () { sudo systemctl restart docker fi - else # RHEL 8 + elif [ $OS_FLAVOR$OS_RELEASE_MAJOR = "rhel8" ]; then # NVIDIA Repos curl -s -L https://nvidia.github.io/nvidia-docker/$OS_FLAVOR$OS_RELEASE/nvidia-docker.repo | \ sudo tee /etc/yum.repos.d/nvidia-docker.repo @@ -480,6 +519,26 @@ install_docker () { sudo systemctl restart docker fi + elif [ $OS_FLAVOR$OS_RELEASE = "fedora32" ]; then + sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + sudo dnf -y remove podman-docker # XXX: this deserves a warning to the user + sudo dnf -y install docker-ce docker-ce-cli containerd.io + + # XXX: nvidia-docker does not support Fedora, using RHEL 8.3 instead + sudo dnf config-manager --add-repo https://nvidia.github.io/nvidia-docker/rhel8.3/nvidia-docker.repo + sudo dnf -y install nvidia-docker2 + + # XXX: need to do something for WSL? + sudo systemctl start docker + sudo groupadd -f docker + sudo systemctl restart docker + + # XXX: test docker with: docker run hello-world + # XXX: test nvidia-docker with: docker run --runtime=nvidia --rm nvidia/cuda:11.2.0-base nvidia-smi + + else + nvlog "ERROR: install_docker(): unknown system type: $OS_FLAVOR $OS_RELEASE" + exit 1 fi set +e