Gentoo Wiki


This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related



Detecting your hardware and configuration is a vital tool in helping you tweak your Gentoo settings, USE flags, make.conf, kernel configuration, and package preferences in order to help you maximize performance and stability. Various packages can be found in portage which will help you detect your computer's makeup.

Hardware detection tools

GUI system profilers


download the ebuild; (HOWTO Installing 3rd Party Ebuilds)

HardInfo is an excellent GTK+2 system information and benchmark tool. It provides a well structured information about your system - hardware, Operating System, modules, various logs, etc. It can perform benchmarking, e.g. comparing the speed of encrypting with the blowfish algorithm on your machine and that on similar hardware. It can also generate a nicely formated .html report. For those coming from Windows and looking for a Linux alternative to the look and feel of Aida32, this is most definitely your choice.

Currently Gentoo seeks a maintainer for this ebuild (see: Bug 147547).


emerge lshw

In order to have the GTK+2 frontend, be sure to emerge lshw with the gtk USE flag. This frontend provides you with more or less the same output as lshw does, however the system information is structured differently. For more information on lshw, please read bellow.

CLI system profilers


emerge pciutils

This utility is useful for obtaining information about your PCI settings with varying levels of verbosity. Run lspci -vvnn or lspci -vmnn to get verbose output. It is important to note that just because lspci identifies the hardware on your computer, it does not mean that the kernel has loaded the drivers for it.

Before you run it, you might want to update the hardware-ID database for lspci with 'update-pciids'. You can check PCI ID's against the database manually by looking them up at the Linux PCI ID Repository.

Here is a sample output:

# lspci
0000:00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (rev c1)
0000:00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev c1)
0000:00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev c1)
0000:00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev c1)
0000:00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev c1)
0000:00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev c1)
0000:00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a4)
0000:00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2)
0000:00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)
0000:00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)
0000:00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)
0000:00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1)
0000:00:05.0 Multimedia audio controller: nVidia Corporation nForce MultiMedia audio [Via VT82C686B] (rev a2)
0000:00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)
0000:00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3)
0000:00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)
0000:00:0c.0 PCI bridge: nVidia Corporation nForce2 PCI Bridge (rev a3)
0000:00:0d.0 FireWire (IEEE 1394): nVidia Corporation nForce2 FireWire (IEEE 1394) Controller (rev a3)
0000:00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev c1)
0000:01:0a.0 SCSI storage controller: Adaptec AIC-7892B U160/m (rev 02)
0000:01:0b.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology Inc) SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 02)
0000:02:01.0 Ethernet controller: 3Com Corporation 3C920B-EMB Integrated Fast Ethernet Controller [Tornado] (rev 40)
0000:03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G550 AGP (rev 01)


 emerge hwreport

This is another excellent system profiler. Basically, you need to run # hwreport output_file in order to get a ~/output_file.tar.bz2 archive. The archive will contain around 20 text files. The file names are intuitive and thus allow quick retrieval of the needed information.

This utility is part of the Hardware4Linux Project, a web site to lookup and report hardware compatibility and incompatibility with Linux distributions. If you are good hearted, please do report your hardware configuration.


emerge lshw

# lshw is a great place to get a structured list of your hardware and its respective features, which in turn can tell you what settings to enable in your kernel.

Here is a snippet of a sample output:

# lshw
         description: CPU
         product: AMD Athlon(tm) XP 2500+
         vendor: Advanced Micro Devices [AMD]
         physical id: 4
         version: 6.10.0
         slot: Socket A
         size: 1833MHz
         capacity: 3GHz
         clock: 166MHz
         capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic
sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow

From this, you can see that the CPU (an AMD Athlon XP 2500+) supports apic, mtrr, mmx, sse, and 3dnow. As a result, you can enable APIC and MTRR in the kernel, and set your USE flags to include "mmx sse 3dnow".


emerge hwinfo

# hwinfo is the hardware detection tool used in SuSE Linux. It probably cats all the possible hardware relevant files from your system. Useful if you are looking for advanced information (input/output ports, IRQs, etc).


emerge hwsetup

hwsetup is the hardware setup program used in the Knoppix LiveCD. It has a libkudzu dependency. Portage allows you to use either kudzu or hwsetup, because of the hwdata-gentoo and hwdata-redhat dependencies, which block each other.

You probably do not want to use it in "setup" mode, so be sure on what you run. hwsetup -n -v will probe only, without configuring anything, in verbose mode. It is useful for determining what module you would want to modprobe for a particular device.

Warning: - sys-apps/hwsetup-1.2 (masked by: package.mask)
# Chris Gianelloni <> (20 Feb 2008)
# Masking these so people will quit installing them on their systems.  These
# packages are designed for use on the LiveCD only and will do unspeakably
# horrible and unexpected things on a normal system.  YOU HAVE BEEN WARNED!!!


emerge kudzu

kudzu is a Red Hat package tool which can detect your hardware and its settings.

Specific hardware detection


emerge usbutils

Like lspci, lsusb lists the current USB devices connected to the system.

A sample output snippet:

# lsusb
Bus 002 Device 001: ID 0000:0000  
Bus 001 Device 001: ID 0000:0000  
Bus 001 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. 
Bus 001 Device 003: ID 046d:c505 Logitech, Inc. Cordless Mouse+Keyboard Receiver
Bus 001 Device 004: ID 03f0:1017 Hewlett-Packard 
Bus 001 Device 005: ID 046d:c501 Logitech, Inc. Cordless Mouse Receiver

As you can see, lsusb detects my wireless kbd, wireless trackball mouse, hp printer, and some other device (perhaps some sort of card-reader or usb-hub in my case).

If you have a USB-device plugged into your system, it may not detect it if it's turned off. Before you run it, you might want to update the hardware-ID database for lsusb with 'update-usbids'.


emerge mkxf86config

mkxf86config is a Gentoo script loosely based on the Knoppix tool that will automatically detect video and monitor capabilities, and create a generic XF86Config to use. The Gentoo version of this package, any version above 0.9, makes xorg.conf files, as X.Org's server is now used in Gentoo.

Warning: Be sure to backup your current xorg.conf file. This script doesn't ask you much and replaces your X.Org configuration. Running mkxf86config --help rendered my system X-less (was lucky that nano left a backup of my old configuration file)
Warning: The hwsetup warning is also valid for mkxf86config. The package is masked in Portage.

dstat / vmstat / free

emerge dstat
emerge procps

These utilities may help you to determine the amount of installed/available RAM (where utilities like lshw may provide incorrect information). The vmstat command will provide a report showing statistics for system processes, memory, swap, I/O, and the CPU. dstat is a versatile replacement for vmstat, iostat and ifstat. Use vmstat -s -S M or dstat -m -s to report virtual memory statistics, hence the RAM available. Use free for a much simpler but equally useful display of memory data.


comes with cups (to the best of my knowledge)

Use lpinfo -v or -m in order to list the available devices or drivers known to the CUPS server. Make sure that your printer is physically connected and turned on.


download the script from here

Often modems (used for dialup access) built-in your computer cannot easily be detected by conventional methods like those listed above. scanModem is a script used to detect such devices. It offers a lot of debugging information and suggests possible options for a driver.

Advanced hardware detection

The /proc filesystem

The above utilities provide a more administrator-friendly method of detecting and viewing hardware available on the machine. In this section we delve deeper into the /proc filesystem, which is a bit more difficult to understand, but contains just as much information.

The /proc filesystem is a generated filesystem - it doesn't exist in persistent media like /, or /mnt/cdrom do. Instead, it is a drive-like interface into the configuration and capabilities of the kernel.

Here is a listing of the contents of /proc on one of my desktop Gentoo machines:

# ls /proc
1      17013  23383  6093  8          driver       loadavg     sys
10112  17083  23384  6156  9          execdomains  locks       sysrq-trigger
10115  17455  25289  6172  900        fb           meminfo     sysvipc
11052  18699  25399  6173  acpi       filesystems  misc        tty
124    2      27765  6174  buddyinfo  fs           modules     uptime
125    20652  3      6185  bus        ide          mounts      version
126    22258  3007   6186  cmdline    interrupts   mtrr        vmstat
12624  22455  3008   6187  config.gz  iomem        net         zoneinfo
12627  22906  4      7149  cpuinfo    ioports      partitions
127    23074  5      7170  devices    irq          self
13108  23164  51     729   diskstats  kallsyms     slabinfo
15174  23165  54     7342  dma        kcore        stat
15436  23226  6048   788   dri        kmsg         swaps

This machine's /proc contains files and directories describing the network interfaces (/proc/net), partitioning (/proc/partitions), the CPUs (/proc/cpuinfo).

For example, to see the capabilities of the primary IDE drive (/dev/hda), we should look at the /proc/ide directory.

# tree /proc/ide
|-- drivers
|-- hda -> ide0/hda
`-- ide0
    |-- channel
    |-- hda
    |   |-- cache
    |   |-- capacity
    |   |-- driver
    |   |-- geometry
    |   |-- identify
    |   |-- media
    |   |-- model
    |   |-- settings
    |   |-- smart_thresholds
    |   `-- smart_values
    |-- mate
    `-- model

3 directories, 14 files

A more thorough explanation of the /proc filesystem can be found here:


Use cat /proc/cpuinfo for a crude, but quick way to display your processor information.

# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Athlon(TM) XP 1800+
stepping        : 1
cpu MHz         : 1529.707
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr
pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips        : 3022.84

In this example, you can quickly determine your processor type (Athlon XP 1800+), and some of the relevant USE flags that can be added: apic, mmx, sse, mmxext, 3dnowext and 3dnow.

See also

External links

Retrieved from ""

Last modified: Sun, 05 Oct 2008 05:16:00 +0000 Hits: 82,573