Debian Codegraph @

upstream/debian-unstable/man8/lspci.8

raw
1 .TH lspci 8 "05 April 2026" "pciutils-3.15.0" "The PCI Utilities"
2 .SH NAME
3 lspci \- list all PCI devices
4 .SH SYNOPSIS
5 .B lspci
6 .RB [ options ]
7 .SH DESCRIPTION
8 .B lspci
9 is a utility for displaying information about PCI buses in the system and
10 devices connected to them.
11
12 By default, it shows a brief list of devices. Use the options described
13 below to request either a more verbose output or output intended for
14 parsing by other programs.
15
16 If you are going to report bugs in PCI device drivers or in
17 .I lspci
18 itself, please include output of "lspci -vvx" or even better "lspci -vvxxx"
19 (however, see below for possible caveats).
20
21 Some parts of the output, especially in the highly verbose modes, are probably
22 intelligible only to experienced PCI hackers. For exact definitions of
23 the fields, please consult either the PCI specifications or the
24 .B header.h
25 and
26 .B /usr/include/linux/pci.h
27 include files.
28
29 Access to some parts of the PCI configuration space is restricted to root
30 on many operating systems, so the features of
31 .I lspci
32 available to normal users are limited. However,
33 .I lspci
34 tries its best to display as much as available and mark all other
35 information with
36 .I <access denied>
37 text.
38
39 .SH OPTIONS
40
41 .SS Basic display modes
42 .TP
43 .B -m
44 Dump PCI device data in a backward-compatible machine readable form.
45 See below for details.
46 .TP
47 .B -mm
48 Dump PCI device data in a machine readable form for easy parsing by scripts.
49 See below for details.
50 .TP
51 .B -t
52 Show a tree-like diagram containing all buses, bridges, devices and connections
53 between them.
54
55 .SS Display options
56 .TP
57 .B -v
58 Be verbose and display detailed information about all devices.
59 .TP
60 .B -vv
61 Be very verbose and display more details. This level includes everything deemed
62 useful.
63 .TP
64 .B -vvv
65 Be even more verbose and display everything we are able to parse,
66 even if it doesn't look interesting at all (e.g., undefined memory regions).
67 .TP
68 .B -k
69 Show kernel drivers handling each device and also kernel modules capable of handling it.
70 Turned on by default when
71 .B -v
72 is given in the normal mode of output.
73 (Currently works only on Linux with kernel 2.6 or newer.)
74 .TP
75 .B -x
76 Show hexadecimal dump of the standard part of the configuration space (the first
77 64 bytes or 128 bytes for CardBus bridges).
78 .TP
79 .B -xxx
80 Show hexadecimal dump of the whole PCI configuration space. It is available only to root
81 as several PCI devices
82 .B crash
83 when you try to read some parts of the config space (this behavior probably
84 doesn't violate the PCI standard, but it's at least very stupid). However, such
85 devices are rare, so you needn't worry much.
86 .TP
87 .B -xxxx
88 Show hexadecimal dump of the extended (4096-byte) PCI configuration space available
89 on PCI-X 2.0 and PCI Express buses.
90 .TP
91 .B -b
92 Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
93 PCI bus instead of as seen by the kernel.
94 .TP
95 .B -D
96 Always show PCI domain numbers. By default, lspci suppresses them on machines which
97 have only domain 0.
98 .TP
99 .B -P
100 Identify PCI devices by path through each bridge, instead of by bus number.
101 .TP
102 .B -PP
103 Identify PCI devices by path through each bridge, showing the bus number as
104 well as the device number.
105
106 .SS Options to control resolving IDs to names
107 .TP
108 .B -n
109 Show PCI vendor and device codes as numbers instead of looking them up in the
110 PCI ID list.
111 .TP
112 .B -nn
113 Show PCI vendor and device codes as both numbers and names.
114 .TP
115 .B -q
116 Use DNS to query the central PCI ID database if a device is not found in the local
117 .B pci.ids
118 file. If the DNS query succeeds, the result is cached in
119 .B $XDG_CACHE_HOME/pci-ids
120 and it is recognized in subsequent runs even if
121 .B -q
122 is not given any more. Please use this switch inside automated scripts only
123 with caution to avoid overloading the database servers.
124 .TP
125 .B -qq
126 Same as
127 .BR -q ,
128 but the local cache is reset.
129 .TP
130 .B -Q
131 Query the central database even for entries which are recognized locally.
132 Use this if you suspect that the displayed entry is wrong.
133
134 .SS Options for selection of devices
135 .TP
136 .B -s [[[[<domain>]:]<bus>]:][<device>][.[<func>]]
137 Show only devices in the specified domain (in case your machine has several host bridges,
138 they can either share a common bus number space or each of them can address a PCI domain
139 of its own; domains are numbered from 0 to ffff), bus (0 to ff), device (0 to 1f) and function (0 to 7).
140 Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
141 hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
142 on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
143 the fourth function of each device.
144 .TP
145 .B -d [<vendor>]:[<device>][:<class>[:<prog-if>]]
146 Show only devices with specified vendor, device, class ID, and programming interface.
147 The IDs are given in hexadecimal and may be omitted or given as "*", both meaning
148 "any value". The class ID can contain "x" characters which stand for "any digit".
149 .PP
150 When
151 .B -s
152 and
153 .B -d
154 are combined, only devices that match both criteria are selected. When the same
155 option is used multiple times, the rightmost one overrides the others
156 and a warning is produced.
157
158 .SS Other options
159 .TP
160 .B -i <file>
161 Use
162 .B
163 <file>
164 as the PCI ID list instead of /usr/share/misc/pci.ids.
165 .TP
166 .B -p <file>
167 Use
168 .B
169 <file>
170 as the map of PCI IDs handled by kernel modules. By default, lspci uses
171 .RI /lib/modules/ kernel_version /modules.pcimap.
172 Applies only to Linux systems with recent enough module tools.
173 .TP
174 .B -M
175 Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
176 those behind misconfigured bridges, etc. This option gives meaningful results only
177 with a direct hardware access mode, which usually requires root privileges.
178 By default, the bus mapper scans domain. You can use the
179 .B -s
180 option to select a different domain.
181 .TP
182 .B --version
183 Shows
184 .I lspci
185 version. This option should be used stand-alone.
186
187 .SS PCI access options
188 .PP
189 The PCI utilities use the PCI library to talk to PCI devices (see
190 \fBpcilib\fP(7) for details). You can use the following options to
191 influence its behavior:
192 .TP
193 .B -A <method>
194 The library supports a variety of methods to access the PCI hardware.
195 By default, it uses the first access method available, but you can use
196 this option to override this decision. See \fB-A help\fP for a list of
197 available methods and their descriptions.
198 .TP
199 .B -O <param>=<value>
200 The behavior of the library is controlled by several named parameters.
201 This option sets the value of any of the parameters. Use \fB-O help\fP
202 for a list of known parameters and their default values.
203 .TP
204 .B -H1
205 Use direct hardware access via Intel configuration mechanism 1.
206 (This is a shorthand for \fB-A intel-conf1\fP.)
207 .TP
208 .B -H2
209 Use direct hardware access via Intel configuration mechanism 2.
210 (This is a shorthand for \fB-A intel-conf2\fP.)
211 .TP
212 .B -F <file>
213 Instead of accessing real hardware, read the list of devices and values of their
214 configuration registers from the given file produced by an earlier run of lspci -x.
215 If
216 .I file
217 is a single dash (\fB-\fP), read the contents from stdin.
218 .IP
219 This is very useful for analysis of user-supplied bug reports, because you can display
220 the hardware configuration in any way you want without disturbing the user with
221 requests for more dumps.
222 .TP
223 .B -G
224 Increase debug level of the library.
225
226 .SH MACHINE READABLE OUTPUT
227 If you intend to process the output of lspci automatically, please use one of the
228 machine-readable output formats
229 .RB ( -m ,
230 .BR -vm ,
231 .BR -vmm )
232 described in this section. All other formats are likely to change
233 between versions of lspci.
234
235 .P
236 All numbers are always printed in hexadecimal. If you want to process numeric IDs instead of
237 names, please add the
238 .B -n
239 switch.
240
241 .SS Simple format (-m)
242
243 In the simple format, each device is described on a single line, which is
244 formatted as parameters suitable for passing to a shell script, i.e., values
245 separated by whitespaces, quoted and escaped if necessary.
246 Some of the arguments are positional: slot, class, vendor name, device name,
247 subsystem vendor name and subsystem name (the last two are empty if
248 the device has no subsystem); the remaining arguments are option-like:
249
250 .TP
251 .BI -r rev
252 Revision number.
253
254 .TP
255 .BI -p progif
256 Programming interface.
257
258 .P
259 The relative order of positional arguments and options is undefined.
260 New options can be added in future versions, but they will always
261 have a single argument not separated from the option by any spaces,
262 so they can be easily ignored if not recognized.
263
264 .SS Verbose format (-vmm)
265
266 The verbose output is a sequence of records separated by blank lines.
267 Each record describes a single device by a sequence of lines, each line
268 containing a single
269 .RI ` tag :
270 .IR value '
271 pair. The
272 .I tag
273 and the
274 .I value
275 are separated by a single tab character.
276 Neither the records nor the lines within a record are in any particular order.
277 Tags are case-sensitive.
278
279 .P
280 The following tags are defined:
281
282 .TP
283 .B Slot
284 The name of the slot where the device resides
285 .RI ([ domain :] bus : device . function ).
286 This tag is always the first in a record.
287
288 .TP
289 .B Class
290 Name of the class.
291
292 .TP
293 .B Vendor
294 Name of the vendor.
295
296 .TP
297 .B Device
298 Name of the device.
299
300 .TP
301 .B SVendor
302 Name of the subsystem vendor (optional).
303
304 .TP
305 .B SDevice
306 Name of the subsystem (optional).
307
308 .TP
309 .B PhySlot
310 The physical slot where the device resides (optional, Linux only).
311
312 .TP
313 .B Rev
314 Revision number (optional).
315
316 .TP
317 .B ProgIf
318 Programming interface (optional).
319
320 .TP
321 .B Driver
322 Kernel driver currently handling the device (optional, Linux only).
323
324 .TP
325 .B Module
326 Kernel module reporting that it is capable of handling the device
327 (optional, Linux only). Multiple lines with this tag can occur.
328
329 .TP
330 .B NUMANode
331 NUMA node this device is connected to (optional, Linux only).
332
333 .TP
334 .B IOMMUGroup
335 IOMMU group that this device is part of (optional, Linux only).
336
337 .P
338 New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
339
340 .SS Backward-compatible verbose format (-vm)
341
342 In this mode, lspci tries to be perfectly compatible with its old versions.
343 It's almost the same as the regular verbose format, but the
344 .B
345 Device
346 tag is used for both the slot and the device name, so it occurs twice
347 in a single record. Please avoid using this format in any new code.
348
349 .SH FILES
350 .TP
351 .B /usr/share/misc/pci.ids
352 A list of all known PCI IDs (vendors, devices, classes and subclasses). Maintained
353 at https://pci-ids.ucw.cz/, use the
354 .B update-pciids
355 utility to download the most recent version.
356 .TP
357 .B /usr/share/misc/pci.ids.gz
358 If lspci is compiled with support for compression, this file is tried before pci.ids.
359 .TP
360 .B $XDG_CACHE_HOME/pci-ids
361 All IDs found in the DNS query mode are cached in this file.
362
363 .SH BUGS
364
365 Sometimes, lspci is not able to decode the configuration registers completely.
366 This usually happens when not enough documentation was available to the authors.
367 In such cases, it at least prints the
368 .B <?>
369 mark to signal that there is potentially something more to say. If you know
370 the details, patches will be of course welcome.
371
372 Access to the extended configuration space is currently supported only by the
373 .B linux_sysfs
374 back-end.
375
376 .SH SEE ALSO
377 .BR setpci (8),
378 .BR pci.ids (5),
379 .BR update-pciids (8),
380 .BR pcilib (7)
381
382 .SH AUTHOR
383 The PCI Utilities are maintained by Martin Mares <[email protected]>.