{
    "mode": "man",
    "parameter": "setpci",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/setpci/8/json",
    "generated": "2026-06-16T06:19:04Z",
    "synopsis": "setpci [options] devices operations...",
    "sections": {
        "NAME": {
            "content": "setpci - configure PCI devices\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "setpci [options] devices operations...\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "setpci is a utility for querying and configuring PCI devices.\n\nAll numbers are entered in hexadecimal notation.\n\nRoot  privileges  are  necessary  for  almost all operations, excluding reads of the standard\nheader of the configuration space on some operating systems.  Please see lspci(8) for details\non access rights.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "General options",
                    "content": ""
                },
                {
                    "name": "-v",
                    "content": "accesses.\n",
                    "flag": "-v"
                },
                {
                    "name": "-f",
                    "content": "lected).   This option is intended for use in widely-distributed configuration scripts\nwhere it's uncertain whether the device in question is present in the machine or not.\n",
                    "flag": "-f"
                },
                {
                    "name": "-D",
                    "content": "try setpci -vD to verify that your complex sequence of setpci operations does what you\nthink it should do.\n",
                    "flag": "-D"
                },
                {
                    "name": "-r -s",
                    "content": "specific  domain, bus, slot, and function). This is faster, but if the device does not\nexist, it fails instead of matching an empty set of devices.\n",
                    "flag": "-s"
                },
                {
                    "name": "--version",
                    "content": "Show setpci version. This option should be used stand-alone.\n\n--help Show detailed help on available options. This option should be used stand-alone.\n",
                    "long": "--version"
                },
                {
                    "name": "--dumpregs",
                    "content": "Show a list of all known PCI registers and capabilities. This option  should  be  used\nstand-alone.\n\n",
                    "long": "--dumpregs"
                },
                {
                    "name": "PCI access options",
                    "content": "The PCI utilities use the PCI library to talk to PCI devices (see pcilib(7) for details). You\ncan use the following options to influence its behavior:\n"
                },
                {
                    "name": "-A <method>",
                    "content": "The library supports a variety of methods to access the PCI hardware.  By default,  it\nuses  the  first access method available, but you can use this option to override this\ndecision. See -A help for a list of available methods and their descriptions.\n",
                    "flag": "-A",
                    "arg": "<method>"
                },
                {
                    "name": "-O <param>=<value>",
                    "content": "The behavior of the library is controlled by several named  parameters.   This  option\nallows  one to set the value of any of the parameters. Use -O help for a list of known\nparameters and their default values.\n",
                    "flag": "-O"
                },
                {
                    "name": "-H1",
                    "content": "for -A intel-conf1.)\n"
                },
                {
                    "name": "-H2",
                    "content": "for -A intel-conf2.)\n"
                },
                {
                    "name": "-G",
                    "content": "",
                    "flag": "-G"
                }
            ]
        },
        "DEVICE SELECTION": {
            "content": "Before each sequence of operations you need to select which devices you wish  that  operation\nto affect.\n",
            "subsections": [
                {
                    "name": "-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]",
                    "content": "Consider  only  devices in the specified domain (in case your machine has several host\nbridges, they can either share a common bus number space or each of them can address a\nPCI domain of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to\n1f) and function (0 to 7).  Each component of the device address can be omitted or set\nto  \"*\",  both meaning \"any value\". All numbers are hexadecimal.  E.g., \"0:\" means all\ndevices on bus 0, \"0\" means all functions of device 0 on any bus, \"0.3\" selects  third\nfunction  of  device  0 on all buses and \".4\" matches only the fourth function of each\ndevice.\n",
                    "flag": "-s"
                },
                {
                    "name": "-d [<vendor>]:[<device>]",
                    "content": "Select devices with specified vendor and device ID. Both ID's are given in hexadecimal\nand may be omitted or given as \"*\", both meaning \"any value\".\n\nWhen  -s and -d are combined, only devices that match both criteria are selected. When multi‐\nple options of the same kind are specified, the rightmost one overrides the others.\n\n",
                    "flag": "-d"
                }
            ]
        },
        "OPERATIONS": {
            "content": "There are two kinds of operations: reads and writes. To read a  register,  just  specify  its\nname.  Writes have the form name=value,value... where each value is either a hexadecimal num‐\nber or an expression of type data:mask where both data and mask are hexadecimal  numbers.  In\nthe  latter case, only the bits corresponding to binary ones in the mask are changed (techni‐\ncally, this is a read-modify-write operation).\n\n\nThere are several ways how to identity a register:\n\n•      Tell its address in hexadecimal.\n\n•      Spell its name. Setpci knows the names of all registers in the standard  configuration\nheaders. Use `setpci --dumpregs' to get the complete list.  See PCI bus specifications\nfor  the  precise  meaning  of  these  registers  or  consult  header.h  or   /usr/in‐‐\nclude/pci/pci.h for a brief sketch.\n\n•      If  the  register is a part of a PCI capability, you can specify the name of the capa‐\nbility to get the address of its first register. See the names starting with `CAP' or\n`ECAP' in the --dumpregs output.\n\n•      If  the name of the capability is not known to setpci, you can refer to it by its num‐\nber in the form CAPid or ECAPid, where id is the numeric identifier of the  capability\nin hexadecimal.\n\n•      Each  of  the previous formats can be followed by +offset to add an offset (a hex num‐\nber) to the address. This feature can be useful for  addressing  of  registers  living\nwithin a capability, or to modify parts of standard registers.\n\n•      To choose how many bytes (1, 2, or 4) should be transferred, you should append a width\nspecifier .B, .W, or .L. The width can be omitted if you are referring to  a  register\nby its name and the width of the register is well known.\n\n•      Finally,  if a capability exists multiple times you can choose which one to target us‐\ning @number. Indexing starts at 0.\n\n\nAll names of registers and width specifiers are case-insensitive.\n\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "COMMAND\nasks for the word-sized command register.\n\n4.w    is a numeric address of the same register.\n\nCOMMAND.l\nasks for a 32-bit word starting at the location of the  command  register,  i.e.,  the\ncommand and status registers together.\n\nVENDORID+1.b\nspecifies the upper byte of the vendor ID register (remember, PCI is little-endian).\n\nCAPPM+2.w\ncorresponds to the second word of the power management capability.\n\nECAP108.l\nasks for the first 32-bit word of the extended capability with ID 0x108.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "lspci(8), pcilib(7)\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.\n\n\n\npciutils-3.7.0                               31 May 2020                                   setpci(8)",
            "subsections": []
        }
    },
    "summary": "setpci - configure PCI devices",
    "flags": [
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "accesses."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "lected). This option is intended for use in widely-distributed configuration scripts where it's uncertain whether the device in question is present in the machine or not."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "try setpci -vD to verify that your complex sequence of setpci operations does what you think it should do."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "specific domain, bus, slot, and function). This is faster, but if the device does not exist, it fails instead of matching an empty set of devices."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Show setpci version. This option should be used stand-alone. --help Show detailed help on available options. This option should be used stand-alone."
        },
        {
            "flag": "",
            "long": "--dumpregs",
            "arg": null,
            "description": "Show a list of all known PCI registers and capabilities. This option should be used stand-alone."
        },
        {
            "flag": "-A",
            "long": null,
            "arg": "<method>",
            "description": "The library supports a variety of methods to access the PCI hardware. By default, it uses the first access method available, but you can use this option to override this decision. See -A help for a list of available methods and their descriptions."
        },
        {
            "flag": "-O",
            "long": null,
            "arg": null,
            "description": "The behavior of the library is controlled by several named parameters. This option allows one to set the value of any of the parameters. Use -O help for a list of known parameters and their default values."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "for -A intel-conf1.)"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "for -A intel-conf2.)"
        },
        {
            "flag": "-G",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [
        "COMMAND",
        "asks for the word-sized command register.",
        "4.w    is a numeric address of the same register.",
        "COMMAND.l",
        "asks for a 32-bit word starting at the location of the  command  register,  i.e.,  the",
        "command and status registers together.",
        "VENDORID+1.b",
        "specifies the upper byte of the vendor ID register (remember, PCI is little-endian).",
        "CAPPM+2.w",
        "corresponds to the second word of the power management capability.",
        "ECAP108.l",
        "asks for the first 32-bit word of the extended capability with ID 0x108."
    ],
    "see_also": [
        {
            "name": "lspci",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/lspci/8/json"
        },
        {
            "name": "pcilib",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pcilib/7/json"
        }
    ]
}