Add GPU app check and normalize GPU app list
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
Introduces the _is_gpu_app function to check if an app benefits from GPU passthrough, and updates the GPU app list to use lowercase names for consistency. The select_hw_passthrough function now only proceeds for GPU apps or when CTTYPE is 0.
This commit is contained in:
parent
020f55e26c
commit
dc45da17fe
@ -19,6 +19,10 @@ select_hw_passthrough() {
|
|||||||
local CTID="$1" CTTYPE="$2" APP="$3"
|
local CTID="$1" CTTYPE="$2" APP="$3"
|
||||||
local LXC_CONFIG="/etc/pve/lxc/${CTID}.conf"
|
local LXC_CONFIG="/etc/pve/lxc/${CTID}.conf"
|
||||||
|
|
||||||
|
if ! _is_gpu_app "$APP" && [[ "$CTTYPE" != "0" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
local choices=()
|
local choices=()
|
||||||
[[ -d /dev/dri ]] && choices+=("VAAPI" "Intel/AMD GPU via VAAPI" OFF)
|
[[ -d /dev/dri ]] && choices+=("VAAPI" "Intel/AMD GPU via VAAPI" OFF)
|
||||||
compgen -G "/dev/nvidia*" >/dev/null && choices+=("NVIDIA" "NVIDIA GPU passthrough" OFF)
|
compgen -G "/dev/nvidia*" >/dev/null && choices+=("NVIDIA" "NVIDIA GPU passthrough" OFF)
|
||||||
@ -58,22 +62,33 @@ select_hw_passthrough() {
|
|||||||
# Apps that benefit from GPU passthrough (VAAPI + NVIDIA)
|
# Apps that benefit from GPU passthrough (VAAPI + NVIDIA)
|
||||||
_GPU_APPS=(
|
_GPU_APPS=(
|
||||||
immich
|
immich
|
||||||
Channels
|
channels
|
||||||
Emby
|
emby
|
||||||
ErsatzTV
|
ersatztv
|
||||||
Frigate
|
frigate
|
||||||
Jellyfin
|
jellyfin
|
||||||
Plex
|
plex
|
||||||
Scrypted
|
scrypted
|
||||||
Tdarr
|
tdarr
|
||||||
Unmanic
|
unmanic
|
||||||
Ollama
|
ollama
|
||||||
FileFlows
|
fileflows
|
||||||
"Open WebUI"
|
"open webui"
|
||||||
Tunarr
|
tunarr
|
||||||
Debian
|
debian
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_is_gpu_app() {
|
||||||
|
local app="$1"
|
||||||
|
local a
|
||||||
|
shopt -s nocasematch
|
||||||
|
for a in "${_GPU_APPS[@]}"; do
|
||||||
|
[[ "$app" == "$a" ]] && shopt -u nocasematch && return 0
|
||||||
|
done
|
||||||
|
shopt -u nocasematch
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# ------------------------------ USB -------------------------------------------
|
# ------------------------------ USB -------------------------------------------
|
||||||
|
|
||||||
usb_handle_passthrough() {
|
usb_handle_passthrough() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user