diff --git a/Dockerfile.debian b/Dockerfile.debian index 86b6ca4..7283bc5 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -307,11 +307,6 @@ RUN \ && \ echo -# TODO: Deprecate neko -# Install Neko server -COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko -COPY --from=m1k1o/neko:base /var/www /var/www - # Install Web Frontend ARG NODE_VERSION="v20" ARG FRONTEND_VERSION=a8eb92f @@ -464,6 +459,28 @@ RUN \ && \ echo +# Install Steam +RUN \ + echo "**** Update apt database ****" \ + && dpkg --add-architecture i386 \ + && apt-get update \ + && \ + echo "**** Install Steam ****" \ + && apt-get install -y --no-install-recommends \ + steam-installer \ + gamescope \ + && ln -sf /usr/games/steam /usr/bin/steam \ + && \ + echo "**** Section cleanup ****" \ + && apt-get clean autoclean -y \ + && apt-get autoremove -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* \ + && \ + echo + # Install Sunshine COPY --from=lizardbyte/sunshine:v2025.122.141614-debian-bookworm /sunshine.deb /usr/src/sunshine.deb RUN \ @@ -488,27 +505,10 @@ RUN \ && \ echo -# Install Steam -RUN \ - echo "**** Update apt database ****" \ - && dpkg --add-architecture i386 \ - && apt-get update \ - && \ - echo "**** Install Steam ****" \ - && apt-get install -y --no-install-recommends \ - steam-installer \ - gamescope \ - && ln -sf /usr/games/steam /usr/bin/steam \ - && \ - echo "**** Section cleanup ****" \ - && apt-get clean autoclean -y \ - && apt-get autoremove -y \ - && rm -rf \ - /var/lib/apt/lists/* \ - /var/tmp/* \ - /tmp/* \ - && \ - echo +# TODO: Deprecate neko +# Install Neko server +COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko +COPY --from=m1k1o/neko:base /var/www /var/www # Various other tools ARG DUMB_INIT_VERSION=1.2.5 diff --git a/docs/compose-files/docker-compose.nvidia.privileged.yml b/docs/compose-files/docker-compose.nvidia.privileged.yml index 5662402..c22e5ca 100644 --- a/docs/compose-files/docker-compose.nvidia.privileged.yml +++ b/docs/compose-files/docker-compose.nvidia.privileged.yml @@ -15,15 +15,7 @@ services: hard: 524288 # GPU PASSTHROUGH - deploy: - resources: - reservations: - # Enable support for NVIDIA GPUs. - # - # Ref: https://docs.docker.com/compose/gpu-support/#enabling-gpu-access-to-service-containers - devices: - - capabilities: [gpu] - device_ids: ["${NVIDIA_VISIBLE_DEVICES}"] + runtime: nvidia # NETWORK: ## NOTE: With this configuration, if we do not use the host network, then physical device input diff --git a/docs/compose-files/docker-compose.nvidia.yml b/docs/compose-files/docker-compose.nvidia.yml index fe526bd..a012280 100644 --- a/docs/compose-files/docker-compose.nvidia.yml +++ b/docs/compose-files/docker-compose.nvidia.yml @@ -20,15 +20,7 @@ services: - apparmor:unconfined # GPU PASSTHROUGH - deploy: - resources: - reservations: - # Enable support for NVIDIA GPUs. - # - # Ref: https://docs.docker.com/compose/gpu-support/#enabling-gpu-access-to-service-containers - devices: - - capabilities: [gpu] - device_ids: ["${NVIDIA_VISIBLE_DEVICES}"] + runtime: nvidia # NETWORK: ## NOTE: With this configuration, if we do not use the host network, then physical device input diff --git a/docs/ubuntu-server.md b/docs/ubuntu-server.md index 78b3ccd..34bc62a 100644 --- a/docs/ubuntu-server.md +++ b/docs/ubuntu-server.md @@ -1,33 +1,57 @@ -# Ubuntu Server +# Ubuntu Server Setup -Follow these instructions to install Steam Headless on Ubuntu Server. +Use these instructions to install **Steam Headless** on an Ubuntu Server system. -> __Note__ +> ⚠️ **Note** > -> This assumes that your Ubuntu Server has not be configured to run any desktop environment! -> -> This will not work with Ubuntu Desktop. +> These steps assume you are running a minimal **Ubuntu Server** installation **without any desktop environment**. +> This setup **will not work** on Ubuntu Desktop. +--- + +## INSTALL NVIDIA DRIVER: + +Although you're on a server system, using the `-server` variant of the NVIDIA driver can cause compatibility issues. +Instead, install the standard driver **without recommended extras**: + +```bash +apt install --no-install-recommends nvidia-driver-570 +``` + +> 🔍 Feel free to `570` with the latest available version. + +To find the latest version of the standard (non-`-server`, non-`-open`) drivers, run: + +```bash +apt-cache search ^nvidia-driver- | awk '{print $1}' | grep -vE '(-server|-open)' | xargs -n1 apt-cache policy | awk '/^nvidia-driver-/{driver=$1} /Candidate:/ {print driver, $2}' +``` + +--- ## INSTALL DOCKER: -Install docker-ce to your Ubuntu server following the [official instructions](https://docs.docker.com/engine/install/ubuntu/). +Install `docker-ce` on your Ubuntu server by following the [official Docker instructions](https://docs.docker.com/engine/install/ubuntu/). -Ensure you install the `docker-compose-plugin` mentioned within these instructions +Make sure you also install the `docker-compose-plugin` as noted in the Docker documentation. +--- ## INSTALL NVIDIA CONTAINER TOOLKIT -The easiest way to get running with NVIDIA GPUs is to install the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-container-toolkit?tab=readme-ov-file). +To enable GPU support inside Docker containers, install the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-container-toolkit?tab=readme-ov-file). -Follow the [official instructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt) for installing the container toolkit to your Ubuntu server with apt. +Follow the [APT-based installation steps](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt) provided in the official documentation. -If you do this, ensure that when you configure Docker Compose in the next step you choose the `nvidia` runtime. +Once installed, configure Docker to use the NVIDIA runtime by default: -Alternately, it is possible to run the container without the NVIDIA runtime by uncommenting the `/dev/nvidia` devices in the Compose file. +```bash +sudo nvidia-ctk runtime configure --runtime=docker +``` +> 💡 You *can* also run the container without the NVIDIA runtime by manually uncommenting the `/dev/nvidia*` device entries in the Compose file — but this approach is **not recommended**. + +--- ## CONFIGURE DOCKER COMPOSE: -Once you have installed docker, follow the [Compose Files](./docker-compose.md) section and select the right configuration file for your hardware. - +After installing Docker, proceed to the [Compose Files](./docker-compose.md) section and select the appropriate configuration for your hardware setup. diff --git a/overlay/entrypoint.sh b/overlay/entrypoint.sh index 0548efc..5020432 100644 --- a/overlay/entrypoint.sh +++ b/overlay/entrypoint.sh @@ -42,6 +42,11 @@ function print_error { echo -e "\e[31mERROR: ${@}\e[0m" } +function print_note { + # Cyan + echo -e "\e[36mNOTE: ${@}\e[0m" +} + # Execute all container init scripts for init_script in /etc/cont-init.d/*.sh ; do echo diff --git a/overlay/etc/cont-init.d/60-configure_gpu_driver.sh b/overlay/etc/cont-init.d/60-configure_gpu_driver.sh index 654f9e8..b69e26c 100644 --- a/overlay/etc/cont-init.d/60-configure_gpu_driver.sh +++ b/overlay/etc/cont-init.d/60-configure_gpu_driver.sh @@ -41,8 +41,8 @@ function download_driver { # Try downloading from a list of NVIDIA driver hosting servers stripped_version="${nvidia_host_driver_version#v}" # Strip 'v' if present declare -a sources=( - "http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run" - "http://us.download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run" + "https://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run" + "https://us.download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run" "https://github.com/flathub/org.freedesktop.Platform.GL.nvidia/releases/download/cuda/NVIDIA-Linux-x86_64-${stripped_version}.run" ) @@ -59,10 +59,11 @@ function download_driver { fi done + print_note "Visit https://download.nvidia.com/XFree86/Linux-x86_64/ in a browser and find the closest match to version '${nvidia_host_driver_version:?}', then set that version in the NVIDIA_DRIVER_VERSION environment variable." print_error "Unable to download driver from any source. Exit!" + sleep 10 return 1 fi - } function install_nvidia_driver { @@ -119,6 +120,8 @@ function install_nvidia_driver { --no-install-libglvnd \ >"${USER_HOME:?}/Downloads/nvidia_gpu_install.log" 2>&1 fi + else + print_step_header "NVIDIA driver version ${nvidia_settings_version:-} is already installed" fi } @@ -240,15 +243,15 @@ else print_header "No AMD device found" fi # NVIDIA GPU -if [ "${nvidia_pci_address:-}X" != "X" ]; then - print_header "Found NVIDIA device '${nvidia_gpu_name:?}'" - install_nvidia_driver - patch_nvidia_driver -elif [ "${NVIDIA_DRIVER_VERSION:-}X" != "X" ]; then +if [ "${NVIDIA_DRIVER_VERSION:-}X" != "X" ]; then export nvidia_host_driver_version="${NVIDIA_DRIVER_VERSION:?}" print_header "Forcing install of NVIDIA driver version '${nvidia_host_driver_version:?}' because the 'NVIDIA_DRIVER_VERSION' variable is set." install_nvidia_driver patch_nvidia_driver +elif [ "${nvidia_pci_address:-}X" != "X" ]; then + print_header "Found NVIDIA device '${nvidia_gpu_name:?}'" + install_nvidia_driver + patch_nvidia_driver else print_header "No NVIDIA device found" fi