displayname of vaapi device
This commit is contained in:
parent
ba178bef5e
commit
143bdcfd9b
@ -1211,10 +1211,13 @@ EOF
|
|||||||
|
|
||||||
if [[ "$CT_TYPE" == "0" || "$is_vaapi_app" == "true" ]]; then
|
if [[ "$CT_TYPE" == "0" || "$is_vaapi_app" == "true" ]]; then
|
||||||
VAAPI_DEVICES=()
|
VAAPI_DEVICES=()
|
||||||
for bypath in /dev/dri/by-path/*; do
|
for bypath in /dev/dri/by-path/*-render; do
|
||||||
[[ "$bypath" =~ -card$ || "$bypath" =~ -render$ ]] || continue
|
dev_target=$(readlink -f "$bypath")
|
||||||
target=$(readlink -f "$bypath")
|
pci_addr=$(basename "$bypath" | cut -d- -f1 --complement | sed 's/-render//')
|
||||||
[[ -e "$target" ]] && VAAPI_DEVICES+=("$target")
|
pci_info=$(lspci -nn | grep "$pci_addr")
|
||||||
|
name="${pci_info#*: }"
|
||||||
|
label="$(basename "$dev_target") - ${name:-Unknown GPU}"
|
||||||
|
VAAPI_DEVICES+=("$dev_target" "$label" "OFF")
|
||||||
done
|
done
|
||||||
[[ -e /dev/fb0 ]] && VAAPI_DEVICES+=("/dev/fb0")
|
[[ -e /dev/fb0 ]] && VAAPI_DEVICES+=("/dev/fb0")
|
||||||
|
|
||||||
@ -1243,15 +1246,9 @@ This allows GPU hardware acceleration (e.g., video transcoding for Jellyfin, Ple
|
|||||||
|
|
||||||
You will now be prompted to select which VAAPI devices should be passed through." 12 72
|
You will now be prompted to select which VAAPI devices should be passed through." 12 72
|
||||||
|
|
||||||
CHOICES=()
|
|
||||||
for dev in "${VAAPI_DEVICES[@]}"; do
|
|
||||||
desc="$(basename "$dev")"
|
|
||||||
CHOICES+=("$dev" "$desc" "OFF")
|
|
||||||
done
|
|
||||||
|
|
||||||
SELECTED_DEVICES=$(whiptail --title "VAAPI Device Selection" \
|
SELECTED_DEVICES=$(whiptail --title "VAAPI Device Selection" \
|
||||||
--checklist "Select VAAPI device(s) to passthrough:" 20 70 10 \
|
--checklist "Select VAAPI device(s) / GPU(s) to passthrough:" 20 70 10 \
|
||||||
"${CHOICES[@]}" 3>&1 1>&2 2>&3)
|
"${VAAPI_DEVICES[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
if [[ -n "$SELECTED_DEVICES" ]]; then
|
if [[ -n "$SELECTED_DEVICES" ]]; then
|
||||||
IDX=0
|
IDX=0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user