Install the NVIDIA patch on container restarts

This commit is contained in:
Josh.5
2023-09-04 17:43:05 +12:00
parent 63137d43ec
commit c8d613da5b

View File

@@ -44,8 +44,7 @@ function download_driver {
function install_nvidia_driver {
# Check here if the currently installed version matches using nvidia-settings
nvidia_settings_version=$(nvidia-settings --version 2> /dev/null | grep version | cut -d ' ' -f 4)
[ "${nvidia_settings_version:-}X" == "${nvidia_host_driver_version:-}X" ] && return 0;
if [ "${nvidia_settings_version:-}X" != "${nvidia_host_driver_version:-}X" ]; then
# Download the driver (if it does not yet exist locally)
download_driver
@@ -58,7 +57,6 @@ function install_nvidia_driver {
# vulkan-icd-loader \
# && echo
# fi
if (($(echo $nvidia_host_driver_version | cut -d '.' -f 1) > 500)); then
echo "Installing NVIDIA driver v${nvidia_host_driver_version:?} to match what is running on the host"
chmod +x "${USER_HOME:?}/Downloads/NVIDIA_${nvidia_host_driver_version:?}.run"
@@ -102,6 +100,7 @@ function install_nvidia_driver {
--no-install-libglvnd \
> "${USER_HOME:?}/Downloads/nvidia_gpu_install.log" 2>&1
fi
fi
# REF: https://github.com/keylase/nvidia-patch#docker-support
if [ "${NVIDIA_PATCH_VERSION:-}X" != "X" ]; then
echo "Patch NVIDIA Driver"