From c114d6d752437f04c2aa11167660e53156423744 Mon Sep 17 00:00:00 2001 From: ciscon Date: Tue, 14 Jan 2025 17:22:28 -0500 Subject: [PATCH] run nvidia-xconfig if x11 hasn't started properly on nvidia gpus --- resources/rc.local | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/rc.local b/resources/rc.local index ae0f6bd..ce629b5 100644 --- a/resources/rc.local +++ b/resources/rc.local @@ -86,3 +86,13 @@ echo "booting..." #if hash X 2>/dev/null;then # su - quakeuser -l -c /usr/bin/startx >/tmp/startx.log 2>&1& #fi + +if (hash nvidia-xconfig >/dev/null 2>&1) && (lsmod|grep -cE 'nvidia_modeset' >/dev/null 2>&1);then + echo "nvidia gpu detected, checking if x11 has started correctly..." + sleep 15 + systemctl status slim >/dev/null 2>&1 || ( + echo "x11 hasn't started properly, running nvidia-xconfig..." + nvidia-xconfig + systemctl restart slim + ) +fi