@@ -86,15 +86,6 @@ if ! docker info > /dev/null 2>&1; then
8686 exit 1
8787fi
8888
89- # Check for NVIDIA Container Toolkit for GPU support
90- NVIDIA_FLAGS=" "
91- if command -v dpkg > /dev/null 2>&1 && dpkg -l | grep -q nvidia-container-toolkit; then
92- NVIDIA_FLAGS=" --gpus all"
93- else
94- # if dpkg isn't present (non-debian host) or toolkit not installed, we leave NVIDIA_FLAGS empty
95- echo -e " \n\e[33mWarning:\e[0m 'nvidia-container-toolkit' not detected (or dpkg unavailable). GPU support may be disabled."
96- fi
97-
9889# Build if requested
9990if [ " $BUILD_FIRST " = true ]; then
10091 echo " Building image first as requested..."
@@ -123,21 +114,12 @@ for dir in build install log; do
123114 fi
124115done
125116
126- # Allow GUI applications
127- xhost +
128-
129117# Run the container
130118docker run -it \
131119 --user=$( id -u) :$( id -g) \
132120 --net=host \
133121 ${NVIDIA_FLAGS} \
134122 --name " ${CONTAINER_NAME} " \
135- -e DISPLAY=$DISPLAY \
136- -e QT_X11_NO_MITSHM=1 \
137- -e XDG_RUNTIME_DIR=/tmp/runtime-${USER} \
138- -e NVIDIA_DRIVER_CAPABILITIES=all \
139- --device /dev/dri:/dev/dri \
140- -v /tmp/.X11-unix:/tmp/.X11-unix \
141123 -v ${REPOSITORY_FOLDER_PATH} /modules:${WORKSPACE_ROOT_CONTAINER} /src/ \
142124 -v ${REPOSITORY_FOLDER_PATH} /build:${WORKSPACE_ROOT_CONTAINER} /build/ \
143125 -v ${REPOSITORY_FOLDER_PATH} /install:${WORKSPACE_ROOT_CONTAINER} /install/ \
@@ -147,9 +129,6 @@ docker run -it \
147129 " ${IMAGE_NAME} :${TAG} " \
148130 " ${ARGS[@]} "
149131
150- # Disallow GUI applications after container exits
151- xhost -
152-
153132# Function to be able to overwrite the image on exit
154133function onexit() {
155134 while true ; do
0 commit comments