Linux get installed drivers

How to check the information of current installed video drivers?

My CPU usage is high when I do trivial things such as scrolling through a PDF file. So I think my video driver is not properly installed. I want to confirm that by checking the information of my currently installed video driver, such as if there’s a driver installed and what version it is. Then I could decide whether to install a new one if it is not up to date. On Windows, I could use the device manager, how to do that on Ubuntu Linux? I don’t expect a GUI solution for this. Command line will be just good enough.

7 Answers 7

In Linux, there is two parts for the video driver, the kernel part and the X server part.

  1. Let’s identify your hardware first. By typing lspci | grep VGA in a terminal, you should see a line with you graphic card description (even if not configured at all).
  2. Let’s check the correct kernel driver is loaded find /dev -group video .
  3. Let’s check the correct X driver is loaded glxinfo | grep -i vendor .

If you want more help, I would like the result of following commands: (Remember, never trust command line that people ask you to execute without knowing what it does.)

lspci | grep VGA lsmod | grep "kms\|drm" find /dev -group video cat /proc/cmdline find /etc/modprobe.d/ cat /etc/modprobe.d/*kms* ls /etc/X11/xorg.conf glxinfo | grep -i "vendor\|rendering" grep LoadModule /var/log/Xorg.0.log 

If you copy-paste the last 4 lines in a terminal and add the result at the end of your question (edit), it will be easier to answer your question. But remember not to execute untrusted commands. Perhaps some stackoverflow trusted users could proof read them and acknowledge in comments.

The easiest way is to run

lspci -k | grep -EA3 'VGA|3D|Display' 
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06) Subsystem: ASUSTeK Computer Inc. HD Graphics 530 Kernel driver in use: i915 Kernel modules: i915 -- 01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 950M] (rev a2) Subsystem: ASUSTeK Computer Inc. GM107M [GeForce GTX 950M] Kernel driver in use: nvidia Kernel modules: nvidiafb, nouveau, nvidia_375_drm, nvidia_375 

This command will show all video PCI devices and kernel modules installed and in use.

Only VGA is not good enough, because Nvidia mobile adapters are shown as 3D and some AMD adapters are shown as Display .

Thanks! I run command, it showed two controllers as in your example. Now how to find out what driver does what?

@Martian2020 It is unclear what you are asking. You see all drivers and which is used. You can ask a new question if you are more specific.

I meant what driver controls display output at the moment. I’ve understood glxinfo | grep «OpenGL» could be used for that.

I use this command to see what Xorg is currently using:

egrep -i " connected|card detect|primary dev|Setting driver" /var/log/Xorg.0.log 

Here is an easier solution, using GUI instead of command line. on the Ubuntu desktop, choose:

Читайте также:  Linux стабилен чем windows

System Settings > Software and updates (in the bottom) -> Other drivers (the right most tab).

my video driver's information

This is a list of your video driver’s information.

For nvidia drivers at least, I usually use the following command in the terminal:

cat /proc/driver/nvidia/version 

Which will output something similar to the following:

NVRM version: NVIDIA UNIX x86_64 Kernel Module 346.96 Sun Aug 23 22:29:21 PDT 2015 

I’m running a 64bit Ubuntu 10.04 here. Here’s what I found out:

lspci will give you a list of found devices. Usually the video card is listed as «VGA controller» or somesuch, on my system it says:

01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 9800 GTX] (rev a2) 

If you meant X.org’s video driver, see /etc/X11/xorg.conf and look for Driver in Section «Device» (there might be multiple):

Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 9800 GTX/9800 GTX+" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 9800 GTX/9800 GTX+" BusID "PCI:1:0:0" Screen 1 EndSection 

If you need to find out the specific location of driver-file and version X.org’s using, try cat /var/log/Xorg.0.log and look for line which says something like LoadModule «‘Driver in the Device-section of xorg.conf’, in my case:

(II) LoadModule: "nvidia" (II) Loading /usr/lib/xorg/extra-modules/nvidia_drv.so (II) Module nvidia: vendor="NVIDIA Corporation" compiled for 4.0.2, module version = 1.0.0 Module class: X.Org Video Driver (II) NVIDIA dlloader X Driver 195.36.24 Thu Apr 22 19:18:54 PDT 2010 (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs (II) Primary Device is: PCI 01@00:00:0 

This answer only applies to older distros. The newer versions appear to have moved away from xorg.conf

X.org auto-probes everything these days so there is no xorg.conf configuration file (unless you’ve explicitly made one). *However the part about inspecting the X server log is still perfectly valid: less /var/log/Xorg.0.log

This should work with any unix-like operating system.

First to list all PCI devices, run:

-nn flag tells lspci to show PCI vendor and device codes as both numbers and names.

00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD/ATI] RS400 Host Bridge [1002:5a33] (rev 01) 00:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] RS4xx PCI Express Port [ext gfx] [1002:5a34] 00:11.0 IDE interface [0101]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB400 Serial ATA Controller [1002:437a] (rev 80) 00:12.0 IDE interface [0101]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 Serial ATA Controller [1002:4379] (rev 80) 00:13.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 USB Host Controller [1002:4375] (rev 80) 00:13.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 USB2 Host Controller [1002:4373] (rev 80) 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 SMBus Controller [1002:4372] (rev 81) 00:14.1 IDE interface [0101]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 IDE Controller [1002:4376] (rev 80) 00:14.2 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 High Definition Audio Controller [1002:437b] (rev 01) 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD/ATI] IXP SB4x0 PCI-PCI Bridge [1002:4371] (rev 80) 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G96 [GeForce 9500 GT] [10de:0640] (rev a1) 02:02.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter [10ec:8139] (rev 10) 
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G96 [GeForce 9500 GT] [10de:0640] (rev a1) 

Finally run

sudo lspci -vvv -d 10de:0640 

sudo and -vvv make it more verbose and helps display everything that it is able to parse. -d is for device in the format []:[]

Читайте также:  Linux приветствие при входе

The final command will list out all the possible capabilities and the kernel driver in use.

Источник

How can I check the information of currently installed WiFi drivers?

When I clicked on additional drivers on Ubuntu 12.04, I could not see any drivers.. How can I check what drivers are installed for WiFi on Ubuntu environment.

It’s not really possible (or useful) to enumerate all available device drivers in Linux (even when restricted to a particular device class). However, you can enumerate all available drivers that are capable of handling a particular device and, more importantly, the one currently claiming the device, i. e. the driver used to “drive” it.

6 Answers 6

The following commands are run in a terminal. Open one by Ctrl + Alt + T .

To check what drivers your wireless adapter is currently using, you may run the following command:

  • lshw lists information on your hardware
  • -C network filters the output to only show the network class.

In the output, look for the entry with description: Wireless interface .

Here’s the output from my Ubuntu:

alaa@aa-lu:~$ sudo lshw -C network [sudo] password for alaa: *-network description: Wireless interface product: RTL8723AE PCIe Wireless Network Adapter vendor: Realtek Semiconductor Co., Ltd. physical id: 0 bus info: pci@0000:08:00.0 logical name: wlan0 version: 00 serial: 24:ec:99:21:c9:29 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=rtl8723ae driverversion=3.8.0-27-generic firmware=N/A ip=192.168.1.74 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn resources: irq:17 ioport:3000(size=256) memory:c3000000-c3003fff

In the configuration line (line before last), you’ll see the driver currently being used by my card. I’ve highlighted it in the output.

Alternatively, you can use the command:

  • lspci lists information on your PCI connected cards
  • -nnk instructs lspci to output more information about these cards (including the driver being used)
  • | pipes the output to the next command
  • grep 0280 filters the output to show lines containing 0280 , which is the PCI class code for wireless PCI controllers in Ubuntu.
  • -A2 shows two more lines of information.

Here’s the output from my Ubuntu:

08:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723AE PCIe Wireless Network Adapter [10ec:8723] Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:0724] Kernel driver in use: rtl8723ae 

Once you determine the driver you’re using, you can use the following command to show more information about it:

To check what wireless drivers you currently have installed, but not necessarily being used by anything, you can do the following command:

find /lib/modules/$(uname -r)/kernel/drivers/net/wireless -name '*.ko' 

The above command will list all drivers you have installed. This will probably be an exhaustive list, because these are preinstalled drivers on your Ubuntu to make it possible for people to use their wireless drivers as soon as they install Ubuntu.

Читайте также:  Доступ интернет linux windows

Источник

Linux: How to find the device driver used for a device?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?

8 Answers 8

Example. I want to find the driver for my Ethernet card:

$ sudo lspci . 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01) $ find /sys | grep drivers.*02:00 /sys/bus/pci/drivers/r8169/0000:02:00.0 

First I need to find coordinates of the device using lspci ; then I find driver that is used for the devices with these coordinates.

I know the OP asked for «drivers being used», but what if the driver is not installed nor being used? How to find out just by the vendorID:productID ? Also, what if it is not a PCI device, and you only see it in lsusb for example?

@DrBeco: But if driver is not installed, what do you want to find? You should just google in this case

#!/bin/bash for f in /sys/class/net/*; do dev=$(basename $f) driver=$(readlink $f/device/driver/module) if [ $driver ]; then driver=$(basename $driver) fi addr=$(cat $f/address) operstate=$(cat $f/operstate) printf "%10s [%s]: %10s (%s)\n" "$dev" "$addr" "$driver" "$operstate" done 
$ ~/what_eth_drivers.sh eth0 [52:54:00:aa:bb:cc]: virtio_net (up) eth1 [52:54:00:dd:ee:ff]: virtio_net (up) eth2 [52:54:00:99:88:77]: virtio_net (up) lo [00:00:00:00:00:00]: (unknown) 

I’d like to find solution which would find also veth and other virtual drivers. IMHO the only solution is to use ethtool or lshw .

sudo lspci -v will show it. like this:

$ sudo lspci -v 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. . Kernel driver in use: radeon Kernel modules: radeon 

You can also combine it with grep like this:

$ sudo lspci -v | grep -A 20 VGA 

For USB based devices you can see the driver name by using the lsusb command:

And/or you use lshw which enumerates the devices on all buses including USB, PCI, etc so you can see which driver it uses:

FTR: the driver is shown at line titled configuration , for example: configuration: driver=btusb maxpower=100mA speed=12Mbit/s

If you just want to plainly use sysfs and doesn’t want to deal with all these commands which eventually looks inside sysfs anyways, here’s how:

say, what is the module/driver for eth6? «sfc» it is

# ls -l /sys/class/net/eth6/device/driver lrwxrwxrwx 1 root root 0 Jan 22 12:30 /sys/class/net/eth6/device/driver -> ../../../../bus/pci/drivers/sfc 

or better yet.. let readlink resolve the path for you.

# readlink -f /sys/class/net/eth6/device/driver /sys/bus/pci/drivers/sfc 

so. to figure out what are the drivers for all of your network interfaces:

# ls -1 /sys/class/net/ | grep -v lo | xargs -n1 -I<> bash -c 'echo -n <> :" " ; basename `readlink -f /sys/class/net/<>/device/driver`' eth0 : tg3 eth1 : tg3 eth10 : mlx4_core eth11 : mlx4_core eth2 : tg3 eth3 : tg3 eth4 : mlx4_core eth5 : mlx4_core eth6 : sfc eth7 : sfc eth8 : sfc eth9 : sfc 

Источник

Оцените статью
Adblock
detector