Skip to content

Commit

Permalink
Prevent setting VIDEO_PORT - Users are breaking host machines with im…
Browse files Browse the repository at this point in the history
…compatible settings
  • Loading branch information
robballantyne committed Mar 7, 2024
1 parent 09ce949 commit 963d076
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function cleanup() {

function start() {
source /opt/ai-dock/etc/environment.sh

# Hardcode VIDEO_PORT: Users are breaking host machines!!
export VIDEO_PORT=DFP
env-store VIDEO_PORT

if [[ ${SERVERLESS,,} = "true" ]]; then
printf "Refusing to start $SERVICE_NAME in serverless mode\n"
Expand All @@ -28,8 +32,7 @@ function start() {
done

cleanup
# This symbolic link enables running Xorg inside a container with `-sharevts`
sudo ln -snf /dev/ptmx /dev/tty7

sudo mkdir -pm700 /tmp/runtime-user
sudo chown $(id -u):$(id -u) /tmp/runtime-user

Expand All @@ -40,7 +43,7 @@ function start() {
start_nvidia
else
printf "Starting proxy X server...\n"
export X_PROXY=true
export X_PROXY=forced
env-store X_PROXY
start_proxy
fi
Expand All @@ -49,6 +52,9 @@ function start() {
function start_nvidia() {
# Mostly copied from https://github.com/selkies-project/docker-nvidia-glx-desktop

# This symbolic link enables running Xorg inside a container with `-sharevts`
sudo ln -snf /dev/ptmx /dev/tty7

# Check if nvidia display drivers are present - Download if not
if ! which nvidia-xconfig /dev/null 2>&1; then
# Driver version is provided by the kernel through the container toolkit
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ENV SIZEH 1080
ENV REFRESH 60
ENV DPI 96
ENV CDEPTH 24
ENV VIDEO_PORT DFP
# Hardcoded in x-server init. Users are breaking host machines. Do not use the on vast/runpod!!
#ENV VIDEO_PORT DFP

ENV WEBRTC_ENCODER nvh264enc
ENV WEBRTC_ENABLE_RESIZE false
Expand Down

0 comments on commit 963d076

Please sign in to comment.