site  contact  subhomenews

Abort load NVIDIA SFS if GPU missing

November 24, 2023 — BarryK

Federico posted that loads an NVIDIA SFS with Easy booted on a USB-stick on one computer, but when boot on another computer that does not have NVIDIA GPU, openGL is broken:

https://forum.puppylinux.com/viewtopic.php?p=104137#p104137

I posted recently that an NVIDIA SFS is now provided for Easy, installable via SFSget:

https://bkhome.org/news/202311/automatic-nvidia-sfs-updating.html

https://bkhome.org/news/202311/kernel-515138-compiled-and-nvidia-sfss-updated.html

I have modified the 'init' script in the initrd, so that if boot on a computer without NVIDIA GPU, then the SFS won't load:

https://github.com/bkauler/woofq/commit/0f0219f4ebf827c5831384ffbdf1f993cc3672cd

The new code is at line 1899:

    #20231124 for nvidia.sfs check that nvidia gpu exists...
case "$ANAME" in
nvidia*)
lspci | grep -qF 'Class 10de:' #note, requires busybox lspci
if [ $? -ne 0 ];then
echo -e "\\033[1;31m${S400}\\033[0;39m" #red 'No NVIDIA GPU detected, so will not load NVIDIA SFS'
continue
fi
;;
esac

So, if boot up on another computer without NVIDIA GPU, the SFS will not load, and the situation will be as if the SFS was never ever loaded.

As long as you haven't made any manual changes, such as blacklisting the 'i915' kernel driver. Blacklisting is taken care of by /etc/modprobe.d/nvidia.conf in the SFS, so if the SFS is not loaded then also the backlisting of i915 and nouveau won't happen.   

Tags: easy