Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback to GitHub for NVIDIA driver downloads #153

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions overlay/etc/cont-init.d/60-configure_gpu_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,18 @@ function download_driver {
wget -q --show-progress --progress=bar:force:noscroll \
-O /tmp/NVIDIA.run \
"http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version:?}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version:?}.run"
[[ $? -gt 0 ]] && print_error "Unable to download driver. Exit!" && return 1

if [[ $? -gt 0 ]]; then
print_error "Unable to download driver from NVIDIA. Trying GitHub..."
# Strip the 'v' from the version if present (v545.23.08 -> 545.23.08)
local stripped_version="${nvidia_host_driver_version#v}"
wget -q --show-progress --progress=bar:force:noscroll \
-O /tmp/NVIDIA.run \
"https://github.com/flathub/org.freedesktop.Platform.GL.nvidia/releases/download/cuda/NVIDIA-Linux-aarch64-${stripped_version}.run"
if [[ $? -gt 0 ]]; then
print_error "Unable to download driver from GitHub. Exit!"
return 1
fi
fi
mv /tmp/NVIDIA.run "${USER_HOME:?}/Downloads/NVIDIA_${nvidia_host_driver_version:?}.run"
fi
}
Expand Down