-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglitch.gui.cuda.sh
More file actions
executable file
·59 lines (51 loc) · 1.65 KB
/
glitch.gui.cuda.sh
File metadata and controls
executable file
·59 lines (51 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
xhost +local:docker
set -euo pipefail
# Image Name
IMAGE="ghcr.io/lostjared/acidcam-dev:latest"
# 1. Setup Host Share
HOST_SHARE="$HOME/container_share"
mkdir -p "$HOST_SHARE"
# 2. Allow X11 Access
# This grants the container permission to use your screen
xhost +si:localuser:$(id -un) >/dev/null 2>&1 || xhost + >/dev/null 2>&1
echo "🚀 Starting Glitch.GUI (NVIDIA/Root Mode)..."
echo "📂 Sharing: $HOST_SHARE -> /home/developer/share"
# 3. Run Podman
# Changes made:
# -u 0: Runs as Root to access GPU hardware.
# QTWEBENGINE variables: Fixes the crash where it cannot find resources.
exec podman run -it --rm \
--security-opt=label=disable \
--net=host \
-u 0 \
--cap-add=SYS_NICE \
--cap-add=SYS_RESOURCE \
--device nvidia.com/gpu=all \
--device /dev/dri \
-e DISPLAY="${DISPLAY:-:0}" \
-e QT_QPA_PLATFORM=xcb \
-e XDG_RUNTIME_DIR=/tmp/xdg \
-e QTWEBENGINE_DISABLE_SANDBOX=1 \
-e QTWEBENGINE_RESOURCES_PATH=/usr/share/qt6/resources \
-e QTWEBENGINE_LOCALES_PATH=/usr/share/qt6/translations \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$HOST_SHARE":/home/developer/share \
--workdir /home/developer/code/glitch.gui/glitch.gui \
"$IMAGE" bash -lc '
# 1. Create a fallback runtime dir
mkdir -p /tmp/xdg && chmod 700 /tmp/xdg
# 2. Check for the launcher
if [ -f "./glitch_gui" ]; then
EXE="./glitch_gui"
else
echo "❌ Error: Could not find Glitch.GUI binary."
echo "📂 Directory contents:"
ls -F
exit 1
fi
echo "✅ Found binary: $EXE"
echo "▶️ Launching..."
# Launch with no-sandbox as an extra safety measure for Root
exec $EXE --no-sandbox
'