feat: Custom VGA adaptor (#573)

This commit is contained in:
Kroese 2024-01-17 19:42:30 +01:00 committed by GitHub
parent 3706ca873b
commit f3e17e399d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,17 +3,19 @@ set -Eeuo pipefail
# Docker environment variables # Docker environment variables
: "${GPU:="N"}" # GPU passthrough : "${GPU:="N"}" # GPU passthrough
: "${VGA:="virtio"}" # VGA adaptor
: "${DISPLAY:="none"}" # Display type : "${DISPLAY:="none"}" # Display type
if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then
DISPLAY_OPTS="-display $DISPLAY -vga none" [[ "${DISPLAY,,}" == "none" ]] && VGA="none"
DISPLAY_OPTS="-display $DISPLAY -vga $VGA"
return 0 return 0
fi fi
DISPLAY_OPTS="-display egl-headless,rendernode=/dev/dri/renderD128 -vga virtio" DISPLAY_OPTS="-display egl-headless,rendernode=/dev/dri/renderD128 -vga $VGA"
[ ! -d /dev/dri ] && mkdir -m 755 /dev/dri [ ! -d /dev/dri ] && mkdir -m 755 /dev/dri