Turning nVidia driver on on machines that have the libraries and an NVidia card

June 2008


The following script can be put in /etc/init.d and linked to from /etc/rcS.d in order to modify the default Debian vesa video driver on machines that have an NVidia card and have the NVidia drivers installed:

#!/bin/bash

XORG_CONF=/etc/X11/xorg.conf
NVIDIA_LIBS_INDICATOR="/usr/lib/xorg/modules/drivers/nvidia_drv.so"
NVIDIA_CARD_INDICATOR=nVidia

if [ -f ${NVIDIA_LIBS_INDICATOR} ] && lspci|grep VGA|grep nVidia > /dev/null ; then
  sed -i 's%\([ \t]*Driver[ \t]\{1,\}\)"vesa"%\1"nvidia"%' ${XORG_CONF}
fi
    

On Debian machines, the proper links in /etc/rcn.d can be created with the command: sudo update-rc.d nvidia defaults

[Note]Note

The above script doesn't ensure that the drivers are actually suitable for the card, and it certainly doesn't finetune the xorg.conf for use with the NVidia card.