Skip to content

Commit

Permalink
Cleanup the logic for Zink Override (#8571)
Browse files Browse the repository at this point in the history
Simplify logic for AppRun
  • Loading branch information
klylabs authored Feb 26, 2025
1 parent c275e84 commit f9e644b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/platform/unix/BuildLinuxImage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,12 @@ if [ "\$XDG_SESSION_TYPE" = "wayland" ] && [ "\$ZINK_DISABLE_OVERRIDE" != "1" ];
if command -v glxinfo >/dev/null 2>&1; then
RENDERER=\$(glxinfo | grep "OpenGL renderer string:" | sed 's/.*: //')
if echo "\$RENDERER" | grep -qi "NVIDIA"; then
if [ "\$ZINK_FORCE_OVERRIDE" = "1" ]; then
APPLY_OVERRIDE=1
else
if command -v nvidia-smi >/dev/null 2>&1; then
DRIVER_VERSION=\$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1)
DRIVER_MAJOR=\$(echo "\$DRIVER_VERSION" | cut -d. -f1)
[ "\$DRIVER_MAJOR" -gt 555 ] && APPLY_OVERRIDE=1
fi
if command -v nvidia-smi >/dev/null 2>&1; then
DRIVER_VERSION=\$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1)
DRIVER_MAJOR=\$(echo "\$DRIVER_VERSION" | cut -d. -f1)
[ "\$DRIVER_MAJOR" -gt 555 ] && ZINK_FORCE_OVERRIDE=1
fi
if [ "\$APPLY_OVERRIDE" = "1" ]; then
if [ "\$ZINK_FORCE_OVERRIDE" = "1" ]; then
export __GLX_VENDOR_LIBRARY_NAME=mesa
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
export MESA_LOADER_DRIVER_OVERRIDE=zink
Expand Down

0 comments on commit f9e644b

Please sign in to comment.