Try to use the VirtualGL's EGL backend

This commit is contained in:
Héctor Molinero Fernández
2021-05-09 17:14:06 +02:00
parent 02f94da242
commit 608981cd13
4 changed files with 18 additions and 3 deletions

View File

@@ -450,7 +450,6 @@ ENV UNPRIVILEGED_USER_SHELL=/bin/bash
ENV XRDP_TLS_KEY_PATH=/etc/xrdp/key.pem
ENV XRDP_TLS_CRT_PATH=/etc/xrdp/cert.pem
ENV ENABLE_XDUMMY=false
ENV VGL_DISPLAY=:0.0
## Use Adwaita theme in QT applications
ENV QT_STYLE_OVERRIDE=Adwaita

View File

@@ -48,7 +48,7 @@ encounter any problem related to this you may use the `--shm-size` option.
* `UNPRIVILEGED_USER_PASSWORD`: unprivileged user password (`password` by default).
* `UNPRIVILEGED_USER_GROUPS`: comma-separated list of additional GIDs for the unprivileged user (none by default).
* `UNPRIVILEGED_USER_SHELL`: unprivileged user shell (`/bin/bash` by default).
* `ENABLE_XDUMMY`: enable an X dummy server (`false` by default).
* `ENABLE_XDUMMY`: enable a dummy X server (`false` by default).
## License

View File

@@ -11,6 +11,6 @@ export XDG_RUNTIME_DIR=/run/user/${UNPRIVILEGED_USER_UID:?}
export XDG_SESSION_DESKTOP=xubuntu
export XDG_SESSION_TYPE=x11
if [ "${ENABLE_XDUMMY:?}" != 'true' ]; then
if [ -z "${VGL_DISPLAY-}" ] && [ -n "${DISPLAY-}" ]; then
export VGL_DISPLAY=${DISPLAY:?}
fi

View File

@@ -60,6 +60,22 @@ if [ "${ENABLE_XDUMMY:?}" = 'true' ]; then
ln -s /etc/sv/xdummy /etc/service/
fi
# Define VGL_DISPLAY variable if it is not set
if [ -z "${VGL_DISPLAY-}" ]; then
# Use the dummy X server if it is enabled
if [ "${ENABLE_XDUMMY:?}" = 'true' ]; then
export VGL_DISPLAY=:0.0
# Otherwise try to use the EGL backend
else
for card in /dev/dri/card*; do
if /opt/VirtualGL/bin/eglinfo -B "${card:?}" 2>/dev/null; then
export VGL_DISPLAY=${card:?}
break
fi
done
fi
fi
# Create RANDFILE if it does not exist
RANDFILE=${RANDFILE-${HOME:?}/.rnd}
if [ ! -f "${RANDFILE:?}" ] && [ -c /dev/urandom ]; then