diff --git a/config.sh b/config.sh index fef0193..d4a4881 100644 --- a/config.sh +++ b/config.sh @@ -2,4 +2,4 @@ DRIVER_VERSION="${DRIVER_VERSION}" DRIVER_KIND="${DRIVER_KIND}" NVIDIA_CONTAINER_TOOLKIT_VER="1.17.6" NVIDIA_PACKAGES="libnvidia-container1 libnvidia-container-tools nvidia-container-toolkit-base nvidia-container-toolkit" -GPU_DEST="/usr/local/nvidia" +GPU_DEST="/usr/bin" diff --git a/install.sh b/install.sh index 3a5b662..f71ff5d 100644 --- a/install.sh +++ b/install.sh @@ -58,62 +58,12 @@ fi # install nvidia drivers pushd /opt/gpu -/opt/gpu/${RUNFILE}/nvidia-installer -s -k=$KERNEL_NAME --log-file-name=${LOG_FILE_NAME} -a --no-drm --dkms --utility-prefix="${GPU_DEST}" --opengl-prefix="${GPU_DEST}" +/opt/gpu/${RUNFILE}/nvidia-installer -s -k=$KERNEL_NAME --log-file-name=${LOG_FILE_NAME} -a --no-drm --dkms popd # move nvidia libs to correct location from temporary overlayfs cp -a /tmp/overlay/lib64 ${GPU_DEST}/lib64 -handle_nvidia_systemd_units() { - SYSTEMD_SRC="/usr/lib/nvidia/systemd" - SYSTEMD_DEST="/etc/systemd/system" - moved_units=() - - # Check if the source directory exists - if [[ -d "$SYSTEMD_SRC" ]]; then - # Use find to list *.service files in the source directory - found_files=$(find "$SYSTEMD_SRC" -maxdepth 1 -name "*.service") - if [ -z "$found_files" ]; then - echo "No systemd unit files found in $SYSTEMD_SRC" - else - # Loop through each found file, move it, and record its name - while IFS= read -r unit; do - mv "$unit" "$SYSTEMD_DEST/" - unit_name=$(basename "$unit") - moved_units+=("$unit_name") - echo "Moved $unit_name to $SYSTEMD_DEST" - done <<< "$found_files" - fi - else - echo "Source directory $SYSTEMD_SRC does not exist. Skipping systemd unit file move." - fi - - # Reload systemd to pick up the moved unit files - systemctl daemon-reload - - # Enable and restart only the moved units - for unit_name in "${moved_units[@]}"; do - systemctl enable "$unit_name" - systemctl restart "$unit_name" - echo "$unit_name enabled and restarted." - done -} - -# grid starts a daemon that prevents copying binaries -if [ "${DRIVER_KIND}" == "grid" ]; then - systemctl stop nvidia-gridd || true -fi - -# move nvidia binaries to /usr/bin...because we like that? -cp -rvT ${GPU_DEST}/bin /usr/bin || true - -# restart that daemon, lol -if [ "${DRIVER_KIND}" == "grid" ]; then - systemctl restart nvidia-gridd || true -fi - -handle_nvidia_systemd_units - # configure system to know about nvidia lib paths echo "${GPU_DEST}/lib64" > /etc/ld.so.conf.d/nvidia.conf ldconfig