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:

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

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:

The new code is at line 1899:

    #20231124 for nvidia.sfs check that nvidia gpu exists...
case "$ANAME" in
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'

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