Refactor VAAPI and NVIDIA passthrough setup for LXC

Consolidates and simplifies VAAPI and NVIDIA passthrough logic by introducing unified GPU app detection and moving userland package installation into dedicated *_inside_setup functions. Updates build.func to use new function names and ensures setup is only performed for relevant apps and non-Alpine containers. Improves maintainability and clarity of passthrough.func.
This commit is contained in:
CanbiZ
2025-09-22 14:09:59 +02:00
parent 821c4f36f6
commit ddf5781e55
2 changed files with 51 additions and 76 deletions

View File

@@ -2201,8 +2201,8 @@ EOF
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/passthrough.func)
usb_handle_passthrough "$CTID" "$CT_TYPE"
vaapi_handle_passthrough "$CTID" "$CT_TYPE" "$APP"
nvidia_handle_passthrough "$CTID" "$CT_TYPE" "$APP"
vaapi_select_and_apply "$CTID" "$CT_TYPE"
nvidia_passthrough_to_lxc "$CTID" "$CT_TYPE"
# TUN device passthrough
if [ "$ENABLE_TUN" == "yes" ]; then
@@ -2276,9 +2276,10 @@ EOF
fi
msg_info "Customizing LXC Container"
# Container erfolgreich gestartet
vaapi_inside_setup "$CTID" "$CT_TYPE"
nvidia_inside_setup "$CTID" "$CT_TYPE"
if [ "$var_os" != "alpine" ]; then
vaapi_inside_setup "$CTID" "$CT_TYPE" "$APP"
nvidia_inside_setup "$CTID" "$CT_TYPE" "$APP"
fi
if [ "$var_os" == "alpine" ]; then
sleep 3
pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories