🐛 fix(server): Support the Open Kernel Module (#62)

## Description

**What issue are you solving (or what feature are you adding) and how
are you doing it?**

Currently, the container fails when trying to download drivers for a
container running non-proprietary Nvidia drivers. So, this is a fix
which searches for numbers rather than a fixed point in the string.
This commit is contained in:
Wanjohi
2024-05-25 00:07:27 +03:00
committed by GitHub
parent ea157b4898
commit e6fa6ea6e1

View File

@@ -67,7 +67,7 @@ netris-proton -i
if ! command -v nvidia-xconfig &>/dev/null; then if ! command -v nvidia-xconfig &>/dev/null; then
# Driver version is provided by the kernel through the container toolkit # Driver version is provided by the kernel through the container toolkit
export 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 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 DRIVER_VERSION="$(head -n1 </proc/driver/nvidia/version | awk '{print $8}')" export DRIVER_VERSION="$(head -n1 </proc/driver/nvidia/version | awk '{for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9\.]+/) {print $i; exit}}' )"
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-${DRIVER_ARCH}-${DRIVER_VERSION}.run" ]; then if [ ! -f "/tmp/NVIDIA-Linux-${DRIVER_ARCH}-${DRIVER_VERSION}.run" ]; then