|
@@ -39,8 +39,8 @@ export PIPEWIRE_RUNTIME_DIR="${PIPEWIRE_RUNTIME_DIR:-${XDG_RUNTIME_DIR:-/tmp}}"
|
|
|
export PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}"
|
|
export PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}"
|
|
|
export PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"
|
|
export PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"
|
|
|
|
|
|
|
|
|
|
+# Install NVIDIA userspace driver components including X graphic libraries, keep contents except outermost if condition same as docker-nvidia-egl-desktop
|
|
|
if ! command -v nvidia-xconfig >/dev/null 2>&1; then
|
|
if ! command -v nvidia-xconfig >/dev/null 2>&1; then
|
|
|
- # Install NVIDIA userspace driver components including X graphic libraries, keep contents same as docker-nvidia-egl-desktop
|
|
|
|
|
export NVIDIA_DRIVER_ARCH="$(dpkg --print-architecture | sed -e 's/arm64/aarch64/' -e 's/armhf/32bit-ARM/' -e 's/i.*86/x86/' -e 's/amd64/x86_64/' -e 's/unknown/x86_64/')"
|
|
export NVIDIA_DRIVER_ARCH="$(dpkg --print-architecture | sed -e 's/arm64/aarch64/' -e 's/armhf/32bit-ARM/' -e 's/i.*86/x86/' -e 's/amd64/x86_64/' -e 's/unknown/x86_64/')"
|
|
|
if [ -z "${NVIDIA_DRIVER_VERSION}" ]; then
|
|
if [ -z "${NVIDIA_DRIVER_VERSION}" ]; then
|
|
|
# Driver version is provided by the kernel through the container toolkit, prioritize kernel driver version if available
|
|
# Driver version is provided by the kernel through the container toolkit, prioritize kernel driver version if available
|
|
@@ -50,31 +50,34 @@ if ! command -v nvidia-xconfig >/dev/null 2>&1; then
|
|
|
# Use NVIDIA-SMI when not available
|
|
# Use NVIDIA-SMI when not available
|
|
|
export NVIDIA_DRIVER_VERSION="$(nvidia-smi --version | grep 'DRIVER version' | cut -d: -f2 | tr -d ' ')"
|
|
export NVIDIA_DRIVER_VERSION="$(nvidia-smi --version | grep 'DRIVER version' | cut -d: -f2 | tr -d ' ')"
|
|
|
else
|
|
else
|
|
|
- echo "Failed to find NVIDIA GPU driver version. You might not be using the NVIDIA container toolkit. Exiting."
|
|
|
|
|
- exit 1
|
|
|
|
|
|
|
+ echo 'Failed to find NVIDIA GPU driver version, container will likely not start because of no NVIDIA container toolkit or NVIDIA GPU driver present'
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
cd /tmp
|
|
cd /tmp
|
|
|
# If version is different, new installer will overwrite the existing components
|
|
# If version is different, new installer will overwrite the existing components
|
|
|
if [ ! -f "/tmp/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" ]; then
|
|
if [ ! -f "/tmp/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" ]; then
|
|
|
# Check multiple sources in order to probe both consumer and datacenter driver versions
|
|
# Check multiple sources in order to probe both consumer and datacenter driver versions
|
|
|
- curl -fsSL -O "https://international.download.nvidia.com/XFree86/Linux-${NVIDIA_DRIVER_ARCH}/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" || curl -fsSL -O "https://international.download.nvidia.com/tesla/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" || { echo "Failed NVIDIA GPU driver download. Exiting."; exit 1; }
|
|
|
|
|
|
|
+ curl -fsSL -O "https://international.download.nvidia.com/XFree86/Linux-${NVIDIA_DRIVER_ARCH}/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" || curl -fsSL -O "https://international.download.nvidia.com/tesla/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" || echo 'Failed NVIDIA GPU driver download'
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ -f "/tmp/NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" ]; then
|
|
|
|
|
+ # Extract installer before installing
|
|
|
|
|
+ sh "NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" -x
|
|
|
|
|
+ cd "NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}"
|
|
|
|
|
+ # Run NVIDIA driver installation without the kernel modules and host components
|
|
|
|
|
+ sudo ./nvidia-installer --silent \
|
|
|
|
|
+ --accept-license \
|
|
|
|
|
+ --no-kernel-module \
|
|
|
|
|
+ --install-compat32-libs \
|
|
|
|
|
+ --no-nouveau-check \
|
|
|
|
|
+ --no-nvidia-modprobe \
|
|
|
|
|
+ --no-systemd \
|
|
|
|
|
+ --no-rpms \
|
|
|
|
|
+ --no-backup \
|
|
|
|
|
+ --no-check-for-alternate-installs
|
|
|
|
|
+ rm -rf /tmp/NVIDIA* && cd ~
|
|
|
|
|
+ else
|
|
|
|
|
+ echo 'Unless using non-NVIDIA GPUs, container will likely not work correctly'
|
|
|
fi
|
|
fi
|
|
|
- # Extract installer before installing
|
|
|
|
|
- sh "NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" -x
|
|
|
|
|
- cd "NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}"
|
|
|
|
|
- # Run NVIDIA driver installation without the kernel modules and host components
|
|
|
|
|
- sudo ./nvidia-installer --silent \
|
|
|
|
|
- --accept-license \
|
|
|
|
|
- --no-kernel-module \
|
|
|
|
|
- --install-compat32-libs \
|
|
|
|
|
- --no-nouveau-check \
|
|
|
|
|
- --no-nvidia-modprobe \
|
|
|
|
|
- --no-systemd \
|
|
|
|
|
- --no-rpms \
|
|
|
|
|
- --no-backup \
|
|
|
|
|
- --no-check-for-alternate-installs
|
|
|
|
|
- rm -rf /tmp/NVIDIA* && cd ~
|
|
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Allow starting Xorg from a pseudoterminal instead of strictly on a tty console
|
|
# Allow starting Xorg from a pseudoterminal instead of strictly on a tty console
|