Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I briefly read the manual of lspci, where I found out that there is a machine-readable format lspci output using "-m" or "-mm" or "-vmm".

I need to print out the device name, the device id and the kernel module driver in use using the machine-readable format.

I tried this command:

$ lspci -vmm -v -nn -d 10de:0393
Slot:   01:00.0
Class:  VGA compatible controller [0300]
Vendor: NVIDIA Corporation [10de]
Device: G73 [GeForce 7300 GT] [0393]
SVendor:    Micro-Star International Co., Ltd. [1462]
SDevice:    NX7300GT-TD256EH [0412]
Rev:    a1

Compared to this output:

$ lspci -nn -v -d 10de:0393
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G73 [GeForce 7300 GT] [10de:0393] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Micro-Star International Co., Ltd. NX7300GT-TD256EH [1462:0412]
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
    Memory at fc000000 (64-bit, non-prefetchable) [size=16M]
    I/O ports at cc00 [size=128]
    [virtual] Expansion ROM at fe9e0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    Kernel modules: nvidia_current, nouveau, nvidiafb

You can see that the normal (non-machine-readable) format shows the kernel driver/module in use.

How do I get it to show the Driver/Module lines in machine-readable format?

In the manual it says that "Module" and "Driver" lines are optional. Does that mean that I have to compile it from source with some special attributes?

P.S. I know about awk and sed and other workarounds, I'm just curious why it doesn't work.

I use ubuntu 12.10, pciutils version 3.1.9-5ubuntu4

share|improve this question
up vote 1 down vote accepted

I contacted the developer, it seems it was not a bug per se, but at least it's now a feature request of some sort. :)

I'm not sure if it's a bug, but I can't print the "Driver" / "Module" lines using -vmm -v option. It works without it (only -v).

It's a good idea, I will add it.

share|improve this answer
Feel free to accept your own answer, as it's actually accurate :-) – njsg May 23 '13 at 11:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.