Skip to content

Commit 21ad20a

Browse files
committed
Bump selkies, fix Linux IME bug, fallback to jpeg on hosts that require it, fix spacebar not working for some games, #113 launch to set resolution for app, cleanup lock files for xorg and dbus before launching, update readme regarding virtual display clamping
1 parent b498107 commit 21ad20a

7 files changed

Lines changed: 59 additions & 9 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN \
1616
https://github.com/selkies-project/selkies.git \
1717
/src && \
1818
cd /src && \
19-
git checkout -f 0fab9f9c41354cbb0e782604b0c3c511842a3289
19+
git checkout -f c3cf4cc2a3b6984104e494572b232730883c9aa6
2020

2121
RUN \
2222
echo "**** build shared core library ****" && \
@@ -190,7 +190,7 @@ RUN \
190190
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
191191
curl -o \
192192
/tmp/selkies.tar.gz -L \
193-
"https://github.com/selkies-project/selkies/archive/0fab9f9c41354cbb0e782604b0c3c511842a3289.tar.gz" && \
193+
"https://github.com/selkies-project/selkies/archive/c3cf4cc2a3b6984104e494572b232730883c9aa6.tar.gz" && \
194194
cd /tmp && \
195195
tar xf selkies.tar.gz && \
196196
cd selkies-* && \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN \
1616
https://github.com/selkies-project/selkies.git \
1717
/src && \
1818
cd /src && \
19-
git checkout -f 0fab9f9c41354cbb0e782604b0c3c511842a3289
19+
git checkout -f c3cf4cc2a3b6984104e494572b232730883c9aa6
2020

2121
RUN \
2222
echo "**** build shared core library ****" && \
@@ -188,7 +188,7 @@ RUN \
188188
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
189189
curl -o \
190190
/tmp/selkies.tar.gz -L \
191-
"https://github.com/selkies-project/selkies/archive/0fab9f9c41354cbb0e782604b0c3c511842a3289.tar.gz" && \
191+
"https://github.com/selkies-project/selkies/archive/c3cf4cc2a3b6984104e494572b232730883c9aa6.tar.gz" && \
192192
cd /tmp && \
193193
tar xf selkies.tar.gz && \
194194
cd selkies-* && \

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,21 @@ curl -X POST http://localhost:8083/tokens \
249249
250250
Clients in this mode must connect with a valid token (`?token=...`) to establish a WebSocket connection.
251251
252+
### All GPU Acceleration - use sane resolutions
253+
254+
When using 3d acceleration via Nvidia DRM or DRI3 it is important to clamp the virtual display to a reasonable max resolution. This can be achieved with the environment setting:
255+
256+
* `-e MAX_RESOLUTION=3840x2160`
257+
258+
This will set the total virtual framebuffer to 4K, you can also set a manual resolution to achieve this.
259+
By default the virtual monitor in the session is 16K to support large monitors and dual display configurations. Leaving it this large has no impact on CPU based performance but costs GPU memory usage and memory bandwidth when leveraging one for acceleration. If you have performance issues in an accelerated session, try clamping the resolution to 1080p and work up from there:
260+
261+
```
262+
-e SELKIES_MANUAL_WIDTH=1920
263+
-e SELKIES_MANUAL_HEIGHT=1080
264+
-e MAX_RESOLUTION=1920x1080
265+
```
266+
252267
### DRI3 GPU Acceleration
253268
254269
For accelerated apps or games, render devices can be mounted into the container and leveraged by applications using:

readme-vars.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,21 @@ full_custom_readme: |
253253
254254
Clients in this mode must connect with a valid token (`?token=...`) to establish a WebSocket connection.
255255
256+
### All GPU Acceleration - use sane resolutions
257+
258+
When using 3d acceleration via Nvidia DRM or DRI3 it is important to clamp the virtual display to a reasonable max resolution. This can be achieved with the environment setting:
259+
260+
* `-e MAX_RESOLUTION=3840x2160`
261+
262+
This will set the total virtual framebuffer to 4K, you can also set a manual resolution to achieve this.
263+
By default the virtual monitor in the session is 16K to support large monitors and dual display configurations. Leaving it this large has no impact on CPU based performance but costs GPU memory usage and memory bandwidth when leveraging one for acceleration. If you have performance issues in an accelerated session, try clamping the resolution to 1080p and work up from there:
264+
265+
```
266+
-e SELKIES_MANUAL_WIDTH=1920
267+
-e SELKIES_MANUAL_HEIGHT=1080
268+
-e MAX_RESOLUTION=1920x1080
269+
```
270+
256271
### DRI3 GPU Acceleration
257272
258273
For accelerated apps or games, render devices can be mounted into the container and leveraged by applications using:

root/etc/s6-overlay/s6-rc.d/svc-dbus/run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Folder setup
44
mkdir -p /run/dbus
55
chown abc:abc /run/dbus
6+
rm -f /run/dbus/pid
67

78
# Run dbus
89
exec s6-setuidgid abc \

root/etc/s6-overlay/s6-rc.d/svc-de/run

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ while true; do
88
sleep .5
99
done
1010

11-
# set sane resolution before starting apps
12-
if ! s6-setuidgid abc xrandr | grep -q "1024x768"; then
13-
s6-setuidgid abc xrandr --newmode "1024x768" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
14-
s6-setuidgid abc xrandr --addmode screen "1024x768"
15-
s6-setuidgid abc xrandr --output screen --mode "1024x768" --dpi 96
11+
# set resolution before starting apps
12+
RESOLUTION_WIDTH=${SELKIES_MANUAL_WIDTH:-1024}
13+
RESOLUTION_HEIGHT=${SELKIES_MANUAL_HEIGHT:-768}
14+
if [ "$RESOLUTION_WIDTH" = "0" ]; then RESOLUTION_WIDTH=1024; fi
15+
if [ "$RESOLUTION_HEIGHT" = "0" ]; then RESOLUTION_HEIGHT=768; fi
16+
MODELINE=$(s6-setuidgid abc cvt "${RESOLUTION_WIDTH}" "${RESOLUTION_HEIGHT}" | grep "Modeline" | sed 's/^.*Modeline //')
17+
MODELINE_ARGS=$(echo "$MODELINE" | tr -d '"')
18+
MODELINE_NAME=$(echo "$MODELINE_ARGS" | awk '{print $1}')
19+
if ! s6-setuidgid abc xrandr | grep -q "$MODELINE_NAME"; then
20+
s6-setuidgid abc xrandr --newmode $MODELINE_ARGS
21+
s6-setuidgid abc xrandr --addmode screen "$MODELINE_NAME"
22+
s6-setuidgid abc xrandr --output screen --mode "$MODELINE_NAME" --dpi 96
1623
fi
1724

1825
# set xresources

root/etc/s6-overlay/s6-rc.d/svc-xorg/run

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3+
# Cleanup
4+
rm -f /tmp/.X1-lock
5+
36
# Enable DRI3 support if detected
47
VFBCOMMAND=""
58
if ! which nvidia-smi && [ -e "/dev/dri/renderD128" ]; then
@@ -11,10 +14,19 @@ fi
1114
if [ "${DISABLE_DRI3}" != "false" ]; then
1215
VFBCOMMAND=""
1316
fi
17+
18+
# Clamp virtual screen max size based on env
1419
DEFAULT_RES="15360x8640"
1520
if [ ! -z ${MAX_RES+x} ]; then
1621
DEFAULT_RES="${MAX_RES}"
1722
fi
23+
if [ -n "${SELKIES_MANUAL_HEIGHT}" ] || [ -n "${SELKIES_MANUAL_WIDTH}" ]; then
24+
T_WIDTH="${SELKIES_MANUAL_WIDTH:-1024}"
25+
T_HEIGHT="${SELKIES_MANUAL_HEIGHT:-768}"
26+
if [ "${T_WIDTH}" = "0" ]; then T_WIDTH="1024"; fi
27+
if [ "${T_HEIGHT}" = "0" ]; then T_HEIGHT="768"; fi
28+
DEFAULT_RES="${T_WIDTH}x${T_HEIGHT}"
29+
fi
1830

1931
# Run Xvfb server with required extensions
2032
exec s6-setuidgid abc \

0 commit comments

Comments
 (0)