A typical question from my mailbag:
How do I find out if a given PCI hardware is supported of by the current CentOS / Debian / RHEL / Fedora Linux kernel?
You can easily find out find out if a given piece of PCI hardware such as RAID, network, sound, graphics card is supported or not by the current Linux kernel using the following utilities under any Linux distributions.
Required Tools
- /lib/modules/$(uname -r)/modules.pcimap : This file is automatically generated by depmod, and used by pcimodules command to determine which modules correspond to which PCI ID's. You need to use this file to find out if driver is supported or not.
- lspci command - list and query all PCI devices connected to the system.
Use lspci Command To List All PCI Devices
Will an Intel Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller Card be taken care of by a Linux kernel 2.6.27-11-server?
$ lspci
$ lspci | grep -i audio
Sample Output:
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
Note down the identifier in first field i.e. 00:1b.0. Now use lspci -n as follows to get result for device 00:1b.0.
$ lspci -n | grep 00:1b.0
Sample Output:
00:1b.0 0403: 8086:27d8 (rev 01)
Where,
- 00:1b.0 - Device
- 8086 - constructor code for Intel Corporation
- 27d8 - The model id.
Use the model id to search driver, as follows:
$ grep 27d8 /lib/modules/$(uname -r)/modules.pcimap
Sample Output:
snd-hda-intel 0x00008086 0x000027d8 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
snd-hda-intel is kernel driver handling PCI audio device. You can get more information about this driver by typing the following:
$ modinfo snd-hda-intel
$ modinfo snd-hda-intel| egrep 'description|filename|depends'
Sample Output:
filename: /lib/modules/2.6.27-11-server/kernel/sound/pci/hda/snd-hda-intel.ko description: Intel HDA driver depends: snd-pcm,snd-page-alloc,snd
Another example - Will an Adaptec AAC-RAID SCSI SA Card work with Linux kernel v2.6.18-128.1.10.el5 (CentOS / RHEL 5 kernel)?
Type the following commands:
$ lspci | grep -i RAID
Output:
07:0e.0 RAID bus controller: Adaptec AAC-RAID
Get device id:
$ lspci -n | grep '07:0e.0'
Output:
07:0e.0 0104: 9005:0285
Search for device id to driver mapping:
$ grep 0285 /lib/modules/$(uname -r)/modules.pcimap
Output:
aacraid 0x00009005 0x00000285 0x00009005 0x00000286 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000285 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000287 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x000017aa 0x00000286 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x000017aa 0x00000287 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000288 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000289 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x0000028a 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x0000028b 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x000002a4 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x000002a5 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x0000028e 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x0000028f 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000290 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00001028 0x00000291 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000292 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000293 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000294 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x0000103c 0x00003227 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000296 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000297 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00001014 0x000002f2 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00001014 0x00000312 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000298 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x00000299 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00009005 0x0000029a 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00001028 0x00000287 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x00001028 0xffffffff 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0x000017aa 0xffffffff 0x00000000 0x00000000 0x0 aacraid 0x00009005 0x00000285 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0 ata_piix 0x00008086 0x00002850 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
Get detailed information about aacraid driver:
$ modinfo aacraid | egrep 'description|filename|depends'
Output:
filename: filename: /lib/modules/2.6.18-128.1.10.el5/kernel/drivers/scsi/aacraid/aacraid.ko description: Dell PERC2, 2/Si, 3/Si, 3/Di, Adaptec Advanced Raid Products, HP NetRAID-4M, IBM ServeRAID & ICP SCSI driver depends: scsi_mod
Task: Show kernel drivers handling each device and also kernel modules capable of handling it
Pass the -k option (works with latest lspci version only):
$ lspci -k
Sample Output:
00:00.0 Host bridge: Intel Corporation 82975X Memory Controller Hub Kernel modules: i82975x_edac 00:01.0 PCI bridge: Intel Corporation 82975X PCI Express Root Port Kernel driver in use: pcieport-driver Kernel modules: shpchp 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01) Kernel driver in use: HDA Intel Kernel modules: snd-hda-intel 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01) Kernel driver in use: pcieport-driver Kernel modules: shpchp 00:1c.4 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 (rev 01) Kernel driver in use: pcieport-driver Kernel modules: shpchp 00:1c.5 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 6 (rev 01) Kernel driver in use: pcieport-driver Kernel modules: shpchp 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01) Kernel driver in use: uhci_hcd Kernel modules: uhci-hcd 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01) Kernel driver in use: uhci_hcd Kernel modules: uhci-hcd 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01) Kernel driver in use: uhci_hcd Kernel modules: uhci-hcd 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01) Kernel driver in use: uhci_hcd Kernel modules: uhci-hcd 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01) Kernel driver in use: ehci_hcd Kernel modules: ehci-hcd 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) 00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01) Kernel modules: intel-rng, iTCO_wdt 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01) Kernel driver in use: ata_piix Kernel modules: ata_piix 00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01) Kernel driver in use: ata_piix Kernel modules: ata_piix 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01) Kernel driver in use: i801_smbus Kernel modules: i2c-i801 01:00.0 VGA compatible controller: nVidia Corporation Quadro FX 570 (rev a1) Kernel driver in use: nvidia Kernel modules: nvidia, nvidiafb 03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE6145 SATA II PCI-E controller (rev a1) Kernel driver in use: pata_marvell Kernel modules: ahci, pata_marvell 04:00.0 Ethernet controller: Intel Corporation 82573E Gigabit Ethernet Controller (Copper) (rev 03) Kernel driver in use: e1000e Kernel modules: e1000e 04:00.3 Serial controller: Intel Corporation Active Management Technology - SOL (rev 03) Kernel driver in use: serial 04:00.4 IPMI SMIC interface: Intel Corporation 82573E KCS (Active Management) (rev 03) 05:02.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03) Kernel driver in use: ndiswrapper 05:04.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link) Kernel driver in use: ohci1394 Kernel modules: ohci1394
Task: Lists all driver modules for all currently plugged in PCI devices
Type the pcimodules command (again you need updated pciutils package):
$ pcimodules
Sample Output:
ohci1394 ipmi_si e1000e ahci pata_marvell nvidia nvidiafb i2c-i801 ata_piix ata_generic pata_acpi ata_piix ata_generic pata_acpi intel-rng iTCO_wdt ehci-hcd uhci-hcd shpchp snd-hda-intel shpchp i82975x_edac
Task: Update pci.ids Database
/usr/share/hwdata/pci.ids file is all known ID's used in PCI devices: ID's of vendors, devices, subsystems and device classes. You can update this database by typing the following command at a shell prompt:
$ update-pciids
Suggested Readings:
- Linux - lspci command to list and find out more information about all PCI devices.
- Linux find out or display IDs for adapters installed in a server
- Linux find out my VIDEO Card Memory RAM size using command line utility
- The PCI Utilities - The PCI Utilities are a collection of programs for inspecting and manipulating configuration of PCI devices, all based on a common portable library libpci which offers access to the PCI configuration space on a variety of operating systems.
- The PCI ID Repository - This is a public repository of all known ID's used in PCI devices: ID's of vendors, devices, subsystems and device classes. It is used in various programs (e.g., The PCI Utilities) to display full human-readable names instead of cryptic numeric codes.
- man pages lspci, update-pciids, and pcimodules
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: Jun/18/2009



{ 8 comments… read them below or add one }
Question: how can I find out the state of the RAID from lspci ?
For example if I have a RAID 1 with 4 HDD’s or a RAID 5 or 6 how can I find out
the health of the RAID matrix ?
@ Debian64,
You can’t use lspci. You need to use RAID utility supplied by vendor. For e.g. Adaptec RAID (standard on IBM/HP/Dell servers) can be controlled via arcconf getconfig 1 command.
See Linux Check The Health of Adaptec RAID array and Linux Check Health of 3ware RAID Array
Thanks for nice info
but man lspci -k doesnt work and i have just donwloaded rhel5 5.3 today its fully updated
and pls tell which package provides pcimodules becoz its seems to be not available here.
i just checked i have pciutils package installed its pciutils.2.2.3.-4.i386 do i need newer than this?
Yes, you need latest version. RHEL usually runs stable and older version for all packages. My current version is 3.0.x
Correct me if I’m wrong, but if you want to see if a given PCI hardware is supported by your kernel, shouldn’t you be able to do this without first inserting the PCI card in the server and seeing that is detected properly?
You can do that if you know PCI ID in advance. You can skip lspci step.
Hai, Please help me install NIC card in my PC, I am new to LINUX and dont have much idea. Card model is Realtek RTL8169/8110 Family Gigabit NIC. I have downloaded driver from Realtek site. and name of the folder is r8169-6.011.00.tar.bz2. so please help me to install.