| Charles Curley - Software Engineer, Writer
| << | < | > | >>
+ Larger Font | - Smaller Font
Charles Curley

Valid XHTML 1.0! Valid CSS!


which.nvidia

I recently spent several hours wrestling with NVIDIA drivers. After much frustration and some emailing on the Fedora list, it turned out I had pulled in the wrong driver. Gnrrrr.

To save the next victim some frustration, I cobbled together this perl script.

#! /usr/bin/perl

# A script to identify the correct NVIDIA proprietary driver, if any,
# for the computer.

$version = "Time-stamp: <2007-06-20 10:59:08 ccurley which-nvidia.pl>";

# A program to detect which, if any, NVIDIA card(s) are present, and
# recommend a suitable driver. This is based on the list of supported
# products in the NVIDIA Read Me file, at
# http://us.download.nvidia.com/XFree86/Linux-x86/100.14.09/README/appendix-a.html. Corrections
# and additions are welcome. http://www.charlescurley.com

# NVIDIA is a registered trademark of NVIDIA Corporation.

# Copyright 2007 through the last date of modification Charles Curley.

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

print ("Which NVIDIA, $version\n");

# NVIDIA's manufacturer ID. All NVIDIA video cards should have this
# manufacturer ID.

$nvidiamfg="10de";

$found = 0;                     # Set this if we find an NVIDIA card.


# Set up two hashes. Both hash on the card ID. The first tells us the
# product name.

%names = (
    "0040" => "GeForce 6800 Ultra",
    "0041" => "GeForce 6800",
    "0042" => "GeForce 6800 LE",
    "0043" => "GeForce 6800 XE",
    "0044" => "GeForce 6800 XT",
    "0045" => "GeForce 6800 GT",
    "0046" => "GeForce 6800 GT",
    "0047" => "GeForce 6800 GS",
    "0048" => "GeForce 6800 XT",
    "0090" => "GeForce 7800 GTX",
    "0091" => "GeForce 7800 GTX",
    "0092" => "GeForce 7800 GTX",
    "0093" => "GeForce 7800 GS",
    "0095" => "GeForce 7800 SLI",
    "0098" => "GeForce Go 7800",
    "0099" => "GeForce Go 7800 GTX",
    "00C0" => "GeForce 6800 GS",
    "00C1" => "GeForce 6800",
    "00C2" => "GeForce 6800 LE",
    "00C3" => "GeForce 6800 XT",
    "00C8" => "GeForce Go 6800",
    "00C9" => "GeForce Go 6800 Ultra",
    "00F0" => "GeForce 6800 Ultra/GeForce 6800",
    "00F1" => "GeForce 6600 GT",
    "00F2" => "GeForce 6600",
    "00F3" => "GeForce 6200",
    "00F4" => "GeForce 6600 LE",
    "00F5" => "GeForce 7800 GS",
    "00F6" => "GeForce 6800 GS/XT",
    "00F9" => "GeForce 6800 Ultra",
    "00FA" => "GeForce PCX 5750",
    "00FB" => "GeForce PCX 5900",
    "00FC" => "GeForce PCX 5300",
    "00FF" => "GeForce PCX 4300",
    "0140" => "GeForce 6600 GT",
    "0141" => "GeForce 6600",
    "0142" => "GeForce 6600 LE",
    "0143" => "GeForce 6600 VE",
    "0144" => "GeForce Go 6600",
    "0145" => "GeForce 6610 XL",
    "0146" => "GeForce Go 6600 TE/6200 TE",
    "0147" => "GeForce 6700 XL",
    "0148" => "GeForce Go 6600",
    "0149" => "GeForce Go 6600 GT",
    "014F" => "GeForce 6200",
    "0160" => "GeForce 6500",
    "0161" => "GeForce 6200 TurboCache(TM)",
    "0162" => "GeForce 6200SE TurboCache(TM)",
    "0163" => "GeForce 6200 LE",
    "0164" => "GeForce Go 6200",
    "0166" => "GeForce Go 6400",
    "0167" => "GeForce Go 6200",
    "0168" => "GeForce Go 6400",
    "0169" => "GeForce 6250",
    "016A" => "GeForce 7100 GS",
    "0191" => "GeForce 8800 GTX",
    "0193" => "GeForce 8800 GTS",
    "0194" => "GeForce 8800 Ultra",
    "01D0" => "GeForce 7350 LE",
    "01D1" => "GeForce 7300 LE",
    "01D3" => "GeForce 7300 SE/7200 GS",
    "01D6" => "GeForce Go 7200",
    "01D7" => "GeForce Go 7300",
    "01D8" => "GeForce Go 7400",
    "01DD" => "GeForce 7500 LE",
    "01DF" => "GeForce 7300 GS",
    "0211" => "GeForce 6800",
    "0212" => "GeForce 6800 LE",
    "0215" => "GeForce 6800 GT",
    "0218" => "GeForce 6800 XT",
    "0221" => "GeForce 6200",
    "0222" => "GeForce 6200 A-LE",
    "0240" => "GeForce 6150",
    "0241" => "GeForce 6150 LE",
    "0242" => "GeForce 6100",
    "0244" => "GeForce Go 6150",
    "0247" => "GeForce Go 6100",
    "0290" => "GeForce 7900 GTX",
    "0291" => "GeForce 7900 GT/GTO",
    "0292" => "GeForce 7900 GS",
    "0293" => "GeForce 7950 GX2",
    "0294" => "GeForce 7950 GX2",
    "0295" => "GeForce 7950 GT",
    "0297" => "GeForce Go 7950 GTX",
    "0298" => "GeForce Go 7900 GS",
    "0299" => "GeForce Go 7900 GTX",
    "02E0" => "GeForce 7600 GT/Unknown GPU",
    "02E1" => "GeForce 7600 GS",
    "0301" => "GeForce FX 5800 Ultra",
    "0302" => "GeForce FX 5800",
    "0311" => "GeForce FX 5600 Ultra",
    "0312" => "GeForce FX 5600",
    "0314" => "GeForce FX 5600XT",
    "031A" => "GeForce FX Go5600",
    "031B" => "GeForce FX Go5650",
    "0320" => "GeForce FX 5200",
    "0321" => "GeForce FX 5200 Ultra",
    "0322" => "GeForce FX 5200",
    "0323" => "GeForce FX 5200LE",
    "0324" => "GeForce FX Go5200",
    "0325" => "GeForce FX Go5250",
    "0326" => "GeForce FX 5500",
    "0327" => "GeForce FX 5100",
    "0328" => "GeForce FX Go5200 32M/64M",
    "032C" => "GeForce FX Go53xx",
    "032D" => "GeForce FX Go5100",
    "0330" => "GeForce FX 5900 Ultra",
    "0331" => "GeForce FX 5900",
    "0332" => "GeForce FX 5900XT",
    "0333" => "GeForce FX 5950 Ultra",
    "0334" => "GeForce FX 5900ZT",
    "0341" => "GeForce FX 5700 Ultra",
    "0342" => "GeForce FX 5700",
    "0343" => "GeForce FX 5700LE",
    "0344" => "GeForce FX 5700VE",
    "0347" => "GeForce FX Go5700",
    "0348" => "GeForce FX Go5700",
    "0390" => "GeForce 7650 GS",
    "0391" => "GeForce 7600 GT",
    "0392" => "GeForce 7600 GS",
    "0393" => "GeForce 7300 GT",
    "0394" => "GeForce 7600 LE",
    "0395" => "GeForce 7300 GT",
    "0398" => "GeForce Go 7600",
    "03D0" => "GeForce 6150SE nForce 430",
    "03D1" => "GeForce 6100 nForce 405",
    "03D2" => "GeForce 6100 nForce 400",
    "03D5" => "GeForce 6100 nForce 420",
    "0400" => "GeForce 8600 GTS",
    "0402" => "GeForce 8600 GT",
    "0407" => "GeForce 8600M GT",
    "0421" => "GeForce 8500 GT",
    "0422" => "GeForce 8400 GS",
    "0423" => "GeForce 8300 GS",
    "0425" => "GeForce 8600M GS",
    "0426" => "GeForce 8400M GT",
    "0427" => "GeForce 8400M GS",
    "0428" => "GeForce 8400M G",
# NVIDIA Quadro
# NVIDIA GPU product    Device PCI ID
    "004E" => "Quadro FX 4000",
    "009D" => "Quadro FX 4500",
    "00CC" => "Quadro FX Go1400",
    "00CD" => "Quadro FX 3450/4000 SDI",
    "00CE" => "Quadro FX 1400",
    "00F8" => "Quadro FX 4400/Quadro FX 3400",
    "00FC" => "Quadro FX 330",
    "00FD" => "Quadro NVS 280 PCI-E/Quadro FX 330",
    "00FE" => "Quadro FX 1300",
    "014A" => "Quadro NVS 440",
    "014C" => "Quadro FX 540M/Quadro FX 540M",
    "014D" => "Quadro FX 550",
    "014E" => "Quadro FX 540",
    "0165" => "Quadro NVS 285",
    "019D" => "Quadro FX 5600",
    "019E" => "Quadro FX 4600",
    "01D7" => "Quadro NVS 110M",
    "01DA" => "Quadro NVS 110M",
    "01DB" => "Quadro NVS 120M",
    "01DC" => "Quadro FX 350M",
    "01DE" => "Quadro FX 350",
    "0245" => "Quadro NVS 210S / NVIDIA GeForce 6150LE",
    "029A" => "Quadro FX 2500M",
    "029B" => "Quadro FX 1500M",
    "029C" => "Quadro FX 5500",
    "029D" => "Quadro FX 3500",
    "029E" => "Quadro FX 1500",
    "029F" => "Quadro FX 4500 X2",
    "0308" => "Quadro FX 2000",
    "0309" => "Quadro FX 1000",
    "031C" => "Quadro FX Go700",
    "032A" => "Quadro NVS 55/280 PCI",
    "032B" => "Quadro FX 500/FX 600",
    "0338" => "Quadro FX 3000",
    "033F" => "Quadro FX 700",
    "034C" => "Quadro FX Go1000",
    "034E" => "Quadro FX 1100",
    "039E" => "Quadro FX 560",
    "040B" => "Quadro NVS 320M",
    "040C" => "Quadro FX 570M",
    "040D" => "Quadro FX 1600M",
    "0429" => "Quadro NVS 140M",
    "042A" => "Quadro NVS 130M",
    "042B" => "Quadro NVS 135M",
    "042D" => "Quadro FX 360M",

# Below are the legacy GPUs that are no longer supported in the
# unified driver. These GPUs will continue to be maintained through
# the special legacy NVIDIA GPU driver releases.

# The 1.0-96xx driver supports the following set of GPUs:

    "0110" => "GeForce2 MX/MX 400",
    "0111" => "GeForce2 MX 100/200",
    "0112" => "GeForce2 Go",
    "0113" => "Quadro2 MXR/EX/Go",
    "0170" => "GeForce4 MX 460",
    "0171" => "GeForce4 MX 440",
    "0172" => "GeForce4 MX 420",
    "0173" => "GeForce4 MX 440-SE",
    "0174" => "GeForce4 440 Go",
    "0175" => "GeForce4 420 Go",
    "0176" => "GeForce4 420 Go 32M",
    "0177" => "GeForce4 460 Go",
    "0178" => "Quadro4 550 XGL",
    "0179" => "GeForce4 440 Go 64M",
    "017A" => "Quadro NVS 400",
    "017C" => "Quadro4 500 GoGL",
    "017D" => "GeForce4 410 Go 16M",
    "0181" => "GeForce4 MX 440 with AGP8X",
    "0182" => "GeForce4 MX 440SE with AGP8X",
    "0183" => "GeForce4 MX 420 with AGP8X",
    "0185" => "GeForce4 MX 4000",
    "0188" => "Quadro4 580 XGL",
    "018A" => "Quadro NVS 280 SD",
    "018B" => "Quadro4 380 XGL",
    "018C" => "Quadro NVS 50 PCI",
    "01A0" => "GeForce2 Integrated GPU",
    "01F0" => "GeForce4 MX Integrated GPU",
    "0200" => "GeForce3",
    "0201" => "GeForce3 Ti 200",
    "0202" => "GeForce3 Ti 500",
    "0203" => "Quadro DCC",
    "0250" => "GeForce4 Ti 4600",
    "0251" => "GeForce4 Ti 4400",
    "0253" => "GeForce4 Ti 4200",
    "0258" => "Quadro4 900 XGL",
    "0259" => "Quadro4 750 XGL",
    "025B" => "Quadro4 700 XGL",
    "0280" => "GeForce4 Ti 4800",
    "0281" => "GeForce4 Ti 4200 with AGP8X",
    "0282" => "GeForce4 Ti 4800 SE",
    "0286" => "GeForce4 4200 Go",
    "0288" => "Quadro4 980 XGL",
    "0289" => "Quadro4 780 XGL",
    "028C" => "Quadro4 700 GoGL",

# The 1.0-71xx driver supports the following set of GPUs:

    "0020" => "RIVA TNT",
    "0028" => "RIVA TNT2/TNT2 Pro",
    "0029" => "RIVA TNT2 Ultra",
    "002C" => "Vanta/Vanta LT",
    "002D" => "RIVA TNT2 Model 64/Model 64 Pro",
    "00A0" => "Aladdin TNT2",
    "0100" => "GeForce 256",
    "0101" => "GeForce DDR",
    "0103" => "Quadro",
    "0150" => "GeForce2 GTS/GeForce2 Pro",
    "0151" => "GeForce2 Ti",
    "0152" => "GeForce2 Ultra",
    "0153" => "Quadro2 Pro",
);

# The second hash gives us the preferred driver.

%drivers = (
            "0040" => "100.14.xx",
            "0041" => "100.14.xx",
            "0042" => "100.14.xx",
            "0043" => "100.14.xx",
            "0044" => "100.14.xx",
            "0045" => "100.14.xx",
            "0046" => "100.14.xx",
            "0047" => "100.14.xx",
            "0048" => "100.14.xx",
            "0090" => "100.14.xx",
            "0091" => "100.14.xx",
            "0092" => "100.14.xx",
            "0093" => "100.14.xx",
            "0095" => "100.14.xx",
            "0098" => "100.14.xx",
            "0099" => "100.14.xx",
            "00C0" => "100.14.xx",
            "00C1" => "100.14.xx",
            "00C2" => "100.14.xx",
            "00C3" => "100.14.xx",
            "00C8" => "100.14.xx",
            "00C9" => "100.14.xx",
            "00F0" => "100.14.xx",
            "00F1" => "100.14.xx",
            "00F2" => "100.14.xx",
            "00F3" => "100.14.xx",
            "00F4" => "100.14.xx",
            "00F5" => "100.14.xx",
            "00F6" => "100.14.xx",
            "00F9" => "100.14.xx",
            "00FA" => "100.14.xx",
            "00FB" => "100.14.xx",
            "00FC" => "100.14.xx",
            "00FF" => "100.14.xx",
            "0140" => "100.14.xx",
            "0141" => "100.14.xx",
            "0142" => "100.14.xx",
            "0143" => "100.14.xx",
            "0144" => "100.14.xx",
            "0145" => "100.14.xx",
            "0146" => "100.14.xx",
            "0147" => "100.14.xx",
            "0148" => "100.14.xx",
            "0149" => "100.14.xx",
            "014F" => "100.14.xx",
            "0160" => "100.14.xx",
            "0161" => "100.14.xx",
            "0162" => "100.14.xx",
            "0163" => "100.14.xx",
            "0164" => "100.14.xx",
            "0166" => "100.14.xx",
            "0167" => "100.14.xx",
            "0168" => "100.14.xx",
            "0169" => "100.14.xx",
            "016A" => "100.14.xx",
            "0191" => "100.14.xx",
            "0193" => "100.14.xx",
            "0194" => "100.14.xx",
            "01D0" => "100.14.xx",
            "01D1" => "100.14.xx",
            "01D3" => "100.14.xx",
            "01D6" => "100.14.xx",
            "01D7" => "100.14.xx",
            "01D8" => "100.14.xx",
            "01DD" => "100.14.xx",
            "01DF" => "100.14.xx",
            "0211" => "100.14.xx",
            "0212" => "100.14.xx",
            "0215" => "100.14.xx",
            "0218" => "100.14.xx",
            "0221" => "100.14.xx",
            "0222" => "100.14.xx",
            "0240" => "100.14.xx",
            "0241" => "100.14.xx",
            "0242" => "100.14.xx",
            "0244" => "100.14.xx",
            "0247" => "100.14.xx",
            "0290" => "100.14.xx",
            "0291" => "100.14.xx",
            "0292" => "100.14.xx",
            "0293" => "100.14.xx",
            "0294" => "100.14.xx",
            "0295" => "100.14.xx",
            "0297" => "100.14.xx",
            "0298" => "100.14.xx",
            "0299" => "100.14.xx",
            "02E0" => "100.14.xx",
            "02E1" => "100.14.xx",
            "0301" => "100.14.xx",
            "0302" => "100.14.xx",
            "0311" => "100.14.xx",
            "0312" => "100.14.xx",
            "0314" => "100.14.xx",
            "031A" => "100.14.xx",
            "031B" => "100.14.xx",
            "0320" => "100.14.xx",
            "0321" => "100.14.xx",
            "0322" => "100.14.xx",
            "0323" => "100.14.xx",
            "0324" => "100.14.xx",
            "0325" => "100.14.xx",
            "0326" => "100.14.xx",
            "0327" => "100.14.xx",
            "0328" => "100.14.xx",
            "032C" => "100.14.xx",
            "032D" => "100.14.xx",
            "0330" => "100.14.xx",
            "0331" => "100.14.xx",
            "0332" => "100.14.xx",
            "0333" => "100.14.xx",
            "0334" => "100.14.xx",
            "0341" => "100.14.xx",
            "0342" => "100.14.xx",
            "0343" => "100.14.xx",
            "0344" => "100.14.xx",
            "0347" => "100.14.xx",
            "0348" => "100.14.xx",
            "0390" => "100.14.xx",
            "0391" => "100.14.xx",
            "0392" => "100.14.xx",
            "0393" => "100.14.xx",
            "0394" => "100.14.xx",
            "0395" => "100.14.xx",
            "0398" => "100.14.xx",
            "03D0" => "100.14.xx",
            "03D1" => "100.14.xx",
            "03D2" => "100.14.xx",
            "03D5" => "100.14.xx",
            "0400" => "100.14.xx",
            "0402" => "100.14.xx",
            "0407" => "100.14.xx",
            "0421" => "100.14.xx",
            "0422" => "100.14.xx",
            "0423" => "100.14.xx",
            "0425" => "100.14.xx",
            "0426" => "100.14.xx",
            "0427" => "100.14.xx",
            "0428" => "100.14.xx",
# NVIDIA Quadro
# NVIDIA GPU product    Device PCI ID
            "004E" => "100.14.xx",
            "009D" => "100.14.xx",
            "00CC" => "100.14.xx",
            "00CD" => "100.14.xx",
            "00CE" => "100.14.xx",
            "00F8" => "100.14.xx",
            "00FC" => "100.14.xx",
            "00FD" => "100.14.xx",
            "00FE" => "100.14.xx",
            "014A" => "100.14.xx",
            "014C" => "100.14.xx",
            "014D" => "100.14.xx",
            "014E" => "100.14.xx",
            "0165" => "100.14.xx",
            "019D" => "100.14.xx",
            "019E" => "100.14.xx",
            "01D7" => "100.14.xx",
            "01DA" => "100.14.xx",
            "01DB" => "100.14.xx",
            "01DC" => "100.14.xx",
            "01DE" => "100.14.xx",
            "0245" => "100.14.xx",
            "029A" => "100.14.xx",
            "029B" => "100.14.xx",
            "029C" => "100.14.xx",
            "029D" => "100.14.xx",
            "029E" => "100.14.xx",
            "029F" => "100.14.xx",
            "0308" => "100.14.xx",
            "0309" => "100.14.xx",
            "031C" => "100.14.xx",
            "032A" => "100.14.xx",
            "032B" => "100.14.xx",
            "0338" => "100.14.xx",
            "033F" => "100.14.xx",
            "034C" => "100.14.xx",
            "034E" => "100.14.xx",
            "039E" => "100.14.xx",
            "040B" => "100.14.xx",
            "040C" => "100.14.xx",
            "040D" => "100.14.xx",
            "0429" => "100.14.xx",
            "042A" => "100.14.xx",
            "042B" => "100.14.xx",
            "042D" => "100.14.xx",

# Below are the legacy GPUs that are no longer supported in the
# unified driver. These GPUs will continue to be maintained through
# the special legacy NVIDIA GPU driver releases.

# The 1.0-96xx driver supports the following set of GPUs:

            "0110" => "1.0-96xx",
            "0111" => "1.0-96xx",
            "0112" => "1.0-96xx",
            "0113" => "1.0-96xx",
            "0170" => "1.0-96xx",
            "0171" => "1.0-96xx",
            "0172" => "1.0-96xx",
            "0173" => "1.0-96xx",
            "0174" => "1.0-96xx",
            "0175" => "1.0-96xx",
            "0176" => "1.0-96xx",
            "0177" => "1.0-96xx",
            "0178" => "1.0-96xx",
            "0179" => "1.0-96xx",
            "017A" => "1.0-96xx",
            "017C" => "1.0-96xx",
            "017D" => "1.0-96xx",
            "0181" => "1.0-96xx",
            "0182" => "1.0-96xx",
            "0183" => "1.0-96xx",
            "0185" => "1.0-96xx",
            "0188" => "1.0-96xx",
            "018A" => "1.0-96xx",
            "018B" => "1.0-96xx",
            "018C" => "1.0-96xx",
            "01A0" => "1.0-96xx",
            "01F0" => "1.0-96xx",
            "0200" => "1.0-96xx",
            "0201" => "1.0-96xx",
            "0202" => "1.0-96xx",
            "0203" => "1.0-96xx",
            "0250" => "1.0-96xx",
            "0251" => "1.0-96xx",
            "0253" => "1.0-96xx",
            "0258" => "1.0-96xx",
            "0259" => "1.0-96xx",
            "025B" => "1.0-96xx",
            "0280" => "1.0-96xx",
            "0281" => "1.0-96xx",
            "0282" => "1.0-96xx",
            "0286" => "1.0-96xx",
            "0288" => "1.0-96xx",
            "0289" => "1.0-96xx",
            "028C" => "1.0-96xx",

# The 1.0-71xx driver supports the following set of GPUs:

            "0020" => "1.0-71xx",
            "0028" => "1.0-71xx",
            "0029" => "1.0-71xx",
            "002C" => "1.0-71xx",
            "002D" => "1.0-71xx",
            "00A0" => "1.0-71xx",
            "0100" => "1.0-71xx",
            "0101" => "1.0-71xx",
            "0103" => "1.0-71xx",
            "0150" => "1.0-71xx",
            "0151" => "1.0-71xx",
            "0152" => "1.0-71xx",
            "0153" => "1.0-71xx",
            );

if ($< != 0) {
    die ("Sorry, you must be root to run this program.\n");
}

$lspci = open (LSPCI, "lspci -n |")
    or die ("Couldn't open lspci.\n\n");
while (defined (my $line = <LSPCI>)) {
    chop ($line);
    ($loc, $num, $id, $rev) = split (" ", $line);
    ($mfg, $card) = split (":", $id);
    if ($mfg eq $nvidiamfg) {
#         print ("$line");
#         print ("    $id, $mfg, $card");
        print (" Your NVIDIA card at $loc is a $names{$card},");
        print (" which requires the $drivers{$card} driver.\n");
        $found++;
    }
}

if ($found) {
    print ("$found NVIDIA cards were found.\n");
    print ("Download from http://www.nvidia.com/object/unix.html\n");
    print ("Or \"yum list \\*nvidia\\*\" and install as appropriate.\n");
} else {
    print ("Sorry, I found no NVIDIA cards. Please run \"lspci\"\n");
    print ("or something like \"lspci | grep -i vga\" to check.\n");
}

Copyright © 1996 through 2008 by Charles Curley
Last Modified: 30 Nov, 2008
100% Microsoft-free web site.