Fix up Ubnuntu server installation

This commit is contained in:
Josh.5
2025-06-23 04:30:05 +00:00
parent 0ac3a94009
commit c3dc444a8f
6 changed files with 82 additions and 66 deletions

View File

@@ -307,11 +307,6 @@ RUN \
&& \ && \
echo 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 # Install Web Frontend
ARG NODE_VERSION="v20" ARG NODE_VERSION="v20"
ARG FRONTEND_VERSION=a8eb92f ARG FRONTEND_VERSION=a8eb92f
@@ -464,6 +459,28 @@ RUN \
&& \ && \
echo 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 # Install Sunshine
COPY --from=lizardbyte/sunshine:v2025.122.141614-debian-bookworm /sunshine.deb /usr/src/sunshine.deb COPY --from=lizardbyte/sunshine:v2025.122.141614-debian-bookworm /sunshine.deb /usr/src/sunshine.deb
RUN \ RUN \
@@ -488,27 +505,10 @@ RUN \
&& \ && \
echo echo
# Install Steam # TODO: Deprecate neko
RUN \ # Install Neko server
echo "**** Update apt database ****" \ COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko
&& dpkg --add-architecture i386 \ COPY --from=m1k1o/neko:base /var/www /var/www
&& 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
# Various other tools # Various other tools
ARG DUMB_INIT_VERSION=1.2.5 ARG DUMB_INIT_VERSION=1.2.5

View File

@@ -15,15 +15,7 @@ services:
hard: 524288 hard: 524288
# GPU PASSTHROUGH # GPU PASSTHROUGH
deploy: runtime: nvidia
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}"]
# NETWORK: # NETWORK:
## NOTE: With this configuration, if we do not use the host network, then physical device input ## NOTE: With this configuration, if we do not use the host network, then physical device input

View File

@@ -20,15 +20,7 @@ services:
- apparmor:unconfined - apparmor:unconfined
# GPU PASSTHROUGH # GPU PASSTHROUGH
deploy: runtime: nvidia
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}"]
# NETWORK: # NETWORK:
## NOTE: With this configuration, if we do not use the host network, then physical device input ## NOTE: With this configuration, if we do not use the host network, then physical device input

View File

@@ -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! > These steps assume you are running a minimal **Ubuntu Server** installation **without any desktop environment**.
> > This setup **will not work** on Ubuntu Desktop.
> This will not work with 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:
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 ## 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: ## 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.

View File

@@ -42,6 +42,11 @@ function print_error {
echo -e "\e[31mERROR: ${@}\e[0m" echo -e "\e[31mERROR: ${@}\e[0m"
} }
function print_note {
# Cyan
echo -e "\e[36mNOTE: ${@}\e[0m"
}
# Execute all container init scripts # Execute all container init scripts
for init_script in /etc/cont-init.d/*.sh ; do for init_script in /etc/cont-init.d/*.sh ; do
echo echo

View File

@@ -41,8 +41,8 @@ function download_driver {
# Try downloading from a list of NVIDIA driver hosting servers # Try downloading from a list of NVIDIA driver hosting servers
stripped_version="${nvidia_host_driver_version#v}" # Strip 'v' if present stripped_version="${nvidia_host_driver_version#v}" # Strip 'v' if present
declare -a sources=( declare -a sources=(
"http://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"
"http://us.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" "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 fi
done 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!" print_error "Unable to download driver from any source. Exit!"
sleep 10
return 1 return 1
fi fi
} }
function install_nvidia_driver { function install_nvidia_driver {
@@ -119,6 +120,8 @@ function install_nvidia_driver {
--no-install-libglvnd \ --no-install-libglvnd \
>"${USER_HOME:?}/Downloads/nvidia_gpu_install.log" 2>&1 >"${USER_HOME:?}/Downloads/nvidia_gpu_install.log" 2>&1
fi fi
else
print_step_header "NVIDIA driver version ${nvidia_settings_version:-} is already installed"
fi fi
} }
@@ -240,15 +243,15 @@ else
print_header "No AMD device found" print_header "No AMD device found"
fi fi
# NVIDIA GPU # NVIDIA GPU
if [ "${nvidia_pci_address:-}X" != "X" ]; then if [ "${NVIDIA_DRIVER_VERSION:-}X" != "X" ]; then
print_header "Found NVIDIA device '${nvidia_gpu_name:?}'"
install_nvidia_driver
patch_nvidia_driver
elif [ "${NVIDIA_DRIVER_VERSION:-}X" != "X" ]; then
export nvidia_host_driver_version="${NVIDIA_DRIVER_VERSION:?}" 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." print_header "Forcing install of NVIDIA driver version '${nvidia_host_driver_version:?}' because the 'NVIDIA_DRIVER_VERSION' variable is set."
install_nvidia_driver install_nvidia_driver
patch_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 else
print_header "No NVIDIA device found" print_header "No NVIDIA device found"
fi fi