From e52239d774c3ed89dc56e77d62f81af31d954d36 Mon Sep 17 00:00:00 2001 From: thelamer Date: Wed, 22 May 2024 18:13:12 -0400 Subject: [PATCH] Add Zink nvidia support ubuntunoble --- Dockerfile | 5 ++++- Dockerfile.aarch64 | 5 ++++- root/defaults/startwm.sh | 8 ++++++++ root/etc/s6-overlay/s6-rc.d/svc-kasmvnc/run | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b3fb660..3fbba25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN \ FROM ghcr.io/linuxserver/baseimage-ubuntu:noble as buildstage -ARG KASMVNC_RELEASE="d49d07b88113d28eb183ca7c0ca59990fae1153c" +ARG KASMVNC_RELEASE="511e2ae542e95f5447a0a145bb54ced968e6cfec" COPY --from=wwwstage /build-out /www @@ -285,6 +285,7 @@ RUN \ libswitch-perl \ libtasn1-6 \ libtry-tiny-perl \ + libvulkan1 \ libwebp7 \ libx11-6 \ libxau6 \ @@ -300,6 +301,7 @@ RUN \ libyaml-tiny-perl \ locales-all \ mesa-va-drivers \ + mesa-vulkan-drivers \ nginx \ nodejs \ openbox \ @@ -316,6 +318,7 @@ RUN \ sudo \ tar \ util-linux \ + vulkan-tools \ x11-apps \ x11-common \ x11-utils \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 7929572..853fcf5 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -34,7 +34,7 @@ RUN \ FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble as buildstage -ARG KASMVNC_RELEASE="d49d07b88113d28eb183ca7c0ca59990fae1153c" +ARG KASMVNC_RELEASE="511e2ae542e95f5447a0a145bb54ced968e6cfec" COPY --from=wwwstage /build-out /www @@ -288,6 +288,7 @@ RUN \ libswitch-perl \ libtasn1-6 \ libtry-tiny-perl \ + libvulkan1 \ libwebp7 \ libx11-6 \ libxau6 \ @@ -303,6 +304,7 @@ RUN \ libyaml-tiny-perl \ locales-all \ mesa-va-drivers \ + mesa-vulkan-drivers \ nginx \ nodejs \ openbox \ @@ -319,6 +321,7 @@ RUN \ sudo \ tar \ util-linux \ + vulkan-tools \ x11-apps \ x11-common \ x11-utils \ diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index d1f6c50..a5e37ce 100755 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -1,2 +1,10 @@ #!/usr/bin/env bash + +# Enable Nvidia GPU support if detected +if which nvidia-smi; then + export LIBGL_KOPPER_DRI2=1 + export MESA_LOADER_DRIVER_OVERRIDE=zink + export GALLIUM_DRIVER=zink +fi + /usr/bin/openbox-session diff --git a/root/etc/s6-overlay/s6-rc.d/svc-kasmvnc/run b/root/etc/s6-overlay/s6-rc.d/svc-kasmvnc/run index aebd469..6eca289 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-kasmvnc/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-kasmvnc/run @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bash # Pass gpu flags if mounted -if ls /dev/dri/renderD* 1> /dev/null 2>&1 && [ -z ${DISABLE_DRI+x} ]; then +if ls /dev/dri/renderD* 1> /dev/null 2>&1 && [ -z ${DISABLE_DRI+x} ] && ! which nvidia-smi; then HW3D="-hw3d" fi if [ -z ${DRINODE+x} ]; then