Added env examples and scripts
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install proprietary NVIDIA driver + NVIDIA Container Toolkit on Ubuntu (for Docker GPU).
|
||||
# Run on the server: bash scripts/install-nvidia-stack.sh
|
||||
# Reboot after completion, then: nvidia-smi
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "==> Updating apt"
|
||||
sudo apt-get update
|
||||
|
||||
echo "==> Installing ubuntu-drivers-common"
|
||||
sudo apt-get install -y ubuntu-drivers-common
|
||||
|
||||
echo "==> Detected devices / recommendations:"
|
||||
ubuntu-drivers devices || true
|
||||
|
||||
echo "==> Installing recommended proprietary NVIDIA driver"
|
||||
sudo ubuntu-drivers autoinstall
|
||||
|
||||
echo "==> Adding NVIDIA Container Toolkit repository"
|
||||
sudo apt-get install -y curl gnupg2
|
||||
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
|
||||
|
||||
echo "==> Installing nvidia-container-toolkit"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y nvidia-container-toolkit
|
||||
|
||||
echo "==> Configuring Docker to use NVIDIA runtime"
|
||||
sudo nvidia-ctk runtime configure --runtime=docker
|
||||
sudo systemctl restart docker
|
||||
|
||||
echo ""
|
||||
echo "Done. Reboot the server so the kernel loads the NVIDIA driver:"
|
||||
echo " sudo reboot"
|
||||
echo ""
|
||||
echo "After reboot, verify:"
|
||||
echo " nvidia-smi"
|
||||
echo " docker run --rm --gpus all nvidia/cuda:12.6.3-base-ubuntu22.04 nvidia-smi"
|
||||
echo ""
|
||||
echo "Then recreate Jellyfin:"
|
||||
echo " cd $(dirname "$(dirname "$(readlink -f "$0")")") && docker compose up -d jellyfin"
|
||||
Reference in New Issue
Block a user