nvidia check installation
Lat
Status: Interested
Joined: 11 Apr 2008
Posts: 29
Reply Quote
Finally a dist-upgrade "destroyed" the nvidia driver and I could create a script to check whether the driver should be reinstalled or not.

The base of the script is to use the installer to check the driver's files

:: Quote ::
/usr/src/NVIDIA-Linux-x86-173.14.05-pkg0.run -s --sanity
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 173.14.05....................................................................................................................................

ERROR: The installed file '/usr/include/GL/gl.h' has a different checksum (3414684992) than when it was installed
(448874206).


ERROR: The installed file '/usr/include/GL/glext.h' has a different checksum (1007380581) than when it was installed
(105207836).


ERROR: The installed file '/usr/include/GL/glx.h' has a different checksum (4214119892) than when it was installed
(3417090754).


ERROR: The installed file '/usr/include/GL/glxext.h' has a different checksum (513042228) than when it was installed
(1340427798).


ERROR: File '/usr/lib/xorg/modules/extensions/libglx.so' is not a symbolic link.

root@lappy:/home/lat# /usr/src/NVIDIA-Linux-x86-173.14.05-pkg0.run -s --sanity 2>/dev/null ; echo 0
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 173.14.05....................................................................................................................................
1


root@lappy:/home/lat# /usr/src/NVIDIA-Linux-x86-173.14.05-pkg0.run -s --sanity 1>/dev/null 2>/dev/null || echo "Reinstall"
Reinstall

something like this could be added in smxi after the dist-upgrade part and right before the gfx install questions

:: Code ::
#!/bin/bash
# - This script uses the nvidia installer file to check sanity of the nvidia's driver files
# if the installer gives an error (meaning one or more files have been modified) then the
# driver should be reinstalled.
# - Any installer file can check the sanity of a driver, no matter if they aren't from
# different versions.
# - The test fails if the driver has been installed for another kernel
# - if the driver has been installed for a kernel other than the current one,
# the test won't warn about the driver won't work in the current kernel.

if [ "$(id -u)" -ne 0 ]; then
 if [ -x "$(which su-to-root)" ]; then
#             [ -n "$DISPLAY" ] &&  exec su-to-root -X -c "${0} $@"
              exec su-to-root -c "${0} $@"
 fi
 printf "ERROR: $0 needs root capabilities, please start it as root.\n\n" >&2
 exit 1
fi

# the variable name "ff" stands for nothing, feel free to change it
ff="$(ls /usr/src/NVIDIA* 2>/dev/null |head -n 1 )"

if [[ ! -n "$ff" ]]
then
 echo "No NVIDIA file installer was found in /usr/src - This file is needed to run the test"
 echo "Quiting script"
 exit 1
fi

echo "Checking sanity of nvidia driver ..."

eval "$ff -s --sanity 1>/dev/null 2>/dev/null" &&
 echo "Nvidia driver is okay" ||
  echo "Please Reinstall the binary nvidia driver"


The logic of the script might need some testing before is merged to smxi, but the NVIDIA-blah -s --sanity test has been doing a good job for me in the past month. There hasn't been any time that the test would say the files are okay and X (and compiz sometimes) wouldn't work
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
no way to know which driver is being used by user in this test, I have at least 20 nvidia drivers in my /usr/src, and I could be using one of several of them.

I've found the xorg update test is pretty effective to alert users, and if it were coupled with a few more alerts, and improved gfx card dection, especially right post du, it will , it's what's used to trigger the graphics question to tell you to update.

Keep in mind, IF xorg changes, and if xorg.conf has either Driver "nvidia" OR Driver "fglrx" THEN the user needs to reinstall their graphics driver.

I just added a function to test installed versions of packages easily too, but I haven't yet updated the xorg version setter to use it.

I'd say the only thing missing is a small function to test and output update non free driver message both post du and in gfx question, an alert.

This catches pretty much all users, with a few rare exceptions that could be fixed by adding a few more packages to the xorg version tester.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Update: I found a small bug in the xorg version detection, see code.google.com/p/smxi/source/detail?r=432 for the updated fix.

This test is now much better, more robust, the old version was missing one of the package version numbers.

Usually when I add a new utility function I find something like this.

Next will be to use that information more effectively to let users know they need to reinstall the driver after a more active detection.
Back to top
Lat
Status: Interested
Joined: 11 Apr 2008
Posts: 29
Reply Quote
You're right, I forgot that in the stage when this test would be there's no card detection so we can't know what make is the card. I guess this script can be use as stand-alone for people that already know they have nvidia.

About what file to use in /usr/src, that doesn't matter
[code]root@mypc:/usr/src# cls ; la NVI*
-rw-r--r-- 1 root src 19820877 2008-05-28 10:21 NVIDIA-Linux-x86-173.14.05-pkg1.run
-rwxr-xr-x 1 root src 11590266 2008-06-16 09:56 NVIDIA-Linux-x86-173.14.09-pkg0.run
-rw-r--r-- 1 root src 11339132 2008-07-16 01:57 NVIDIA-Linux-x86-71.86.06-pkg1.run
root@mypc:/usr/src# sh NVIDIA-Linux-x86-173.14.05-pkg1.run -s --sanity
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 173.14.05.....................
root@mypc:/usr/src# sh NVIDIA-Linux-x86-173.14.09-pkg0.run -s --sanity
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 173.14.09..............................
root@mypc:/usr/src# sh NVIDIA-Linux-x86-71.86.06-pkg1.run -s --sanity
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 71.86.06.............................
the script uses whichever finds first
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
now that the xorg version detection is updated and working correctly again, I will create a small print update driver message function and run it both post du, and in graphics install question.

It is easy to forget that and just start desktop right after du runs, it won't be hard to update this to make it a global option.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
The xorg/new kernel detection is now updated and improved. Alerts occur now post kernel install, post dist-upgrade, post du options, and graphics install question.

If either a new kernel is installed or if xorg updates, and if xorg.conf has driver "nvidia/fglrx" in it, which means that the user system has installed that driver, the users will see an alert letting them know specifically what occured and that driver reinstall is now required.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours