mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-18 16:32:17 +00:00
feat: add NVIDIA driver install prompt for GPU-enabled containers (#11184)
This commit is contained in:
@@ -13,6 +13,7 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
|
msg_custom "ℹ️" "${GN}" "If NVIDIA GPU passthrough is detected, you'll be asked whether to install drivers in the container"
|
||||||
setup_hwaccel
|
setup_hwaccel
|
||||||
|
|
||||||
msg_info "Installing Jellyfin"
|
msg_info "Installing Jellyfin"
|
||||||
|
|||||||
@@ -2631,6 +2631,7 @@ function setup_hwaccel() {
|
|||||||
# GPU Selection - Let user choose which GPU(s) to configure
|
# GPU Selection - Let user choose which GPU(s) to configure
|
||||||
# ═══════════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
local -a SELECTED_INDICES=()
|
local -a SELECTED_INDICES=()
|
||||||
|
local install_nvidia_drivers="yes"
|
||||||
|
|
||||||
if [[ $gpu_count -eq 1 ]]; then
|
if [[ $gpu_count -eq 1 ]]; then
|
||||||
# Single GPU - auto-select
|
# Single GPU - auto-select
|
||||||
@@ -2692,6 +2693,30 @@ function setup_hwaccel() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ask whether to install NVIDIA drivers in the container
|
||||||
|
local nvidia_selected="no"
|
||||||
|
for idx in "${SELECTED_INDICES[@]}"; do
|
||||||
|
if [[ "${GPU_TYPES[$idx]}" == "NVIDIA" ]]; then
|
||||||
|
nvidia_selected="yes"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$nvidia_selected" == "yes" ]]; then
|
||||||
|
if [[ -n "${INSTALL_NVIDIA_DRIVERS:-}" ]]; then
|
||||||
|
install_nvidia_drivers="${INSTALL_NVIDIA_DRIVERS}"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
msg_custom "🎮" "${GN}" "NVIDIA GPU passthrough detected"
|
||||||
|
local nvidia_reply=""
|
||||||
|
read -r -t 60 -p "${TAB3}⚙️ Install NVIDIA driver libraries in the container? [Y/n] (auto-yes in 60s): " nvidia_reply || nvidia_reply=""
|
||||||
|
case "${nvidia_reply,,}" in
|
||||||
|
n | no) install_nvidia_drivers="no" ;;
|
||||||
|
*) install_nvidia_drivers="yes" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
# OS Detection
|
# OS Detection
|
||||||
# ═══════════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════════
|
||||||
@@ -2752,7 +2777,11 @@ function setup_hwaccel() {
|
|||||||
# NVIDIA GPUs
|
# NVIDIA GPUs
|
||||||
# ─────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────
|
||||||
NVIDIA)
|
NVIDIA)
|
||||||
_setup_nvidia_gpu "$os_id" "$os_codename" "$os_version"
|
if [[ "$install_nvidia_drivers" == "yes" ]]; then
|
||||||
|
_setup_nvidia_gpu "$os_id" "$os_codename" "$os_version"
|
||||||
|
else
|
||||||
|
msg_warn "Skipping NVIDIA driver installation (user opted to install manually)"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user