From 19485e10b057ed3a4175a5d615504d09508b8572 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Tue, 16 Jul 2024 20:49:30 +0100 Subject: [PATCH] fix: better checks in for nvidia driver configs fixes #179 --- images/base/overlay/etc/cont-init.d/30-nvidia.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/images/base/overlay/etc/cont-init.d/30-nvidia.sh b/images/base/overlay/etc/cont-init.d/30-nvidia.sh index fd50e65a..32f30362 100644 --- a/images/base/overlay/etc/cont-init.d/30-nvidia.sh +++ b/images/base/overlay/etc/cont-init.d/30-nvidia.sh @@ -35,15 +35,13 @@ if [ -d /usr/nvidia ]; then mkdir -p /usr/lib/x86_64-linux-gnu/gbm/ cp /usr/nvidia/lib/gbm/* /usr/lib/x86_64-linux-gnu/gbm/ fi -fi - # Check if there's libnvidia-allocator.so.1 -if [ -L /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.1 ]; then +elif [ -e /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.1 ]; then gow_log "Nvidia driver detected, assuming it's using the nvidia driver volume" ldconfig # Create a symlink to the nvidia-drm_gbm.so (if not present) - if [ ! -L /usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so ]; then + if [ ! -e /usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so ]; then gow_log "Creating symlink to nvidia-drm_gbm.so" mkdir -p /usr/lib/x86_64-linux-gnu/gbm ln -sv ../libnvidia-allocator.so.1 /usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so