Linux show version driver

How to get the nvidia driver version from the command line?

For debugging CUDA code and checking compatibilities I need to find out what nvidia driver version for the GPU I have installed. I found How to get the cuda version? but that does not help me here.

11 Answers 11

Using nvidia-smi should tell you that:

bwood@mybox:~$ nvidia-smi Mon Oct 29 12:30:02 2012 +------------------------------------------------------+ | NVIDIA-SMI 3.295.41 Driver Version: 295.41 | |-------------------------------+----------------------+----------------------+ | Nb. Name | Bus Id Disp. | Volatile ECC SB / DB | | Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. | |===============================+======================+======================| | 0. GeForce GTX 580 | 0000:25:00.0 N/A | N/A N/A | | 54% 70 C N/A N/A / N/A | 25% 383MB / 1535MB | N/A Default | |-------------------------------+----------------------+----------------------| | Compute processes: GPU Memory | | GPU PID Process name Usage | |=============================================================================| | 0. Not Supported | +-----------------------------------------------------------------------------+ 

In my centos 6.4 system, it gives me error as «-bash: nvidia-smi: command not found». What might be the problem ?

@Shyamkkhadka Likely something wrong with your PATH. You could try to find nvidia-smi like so: locate nvidia-smi

@BrendanWood, with locate command it shows blank output. I suspect if it has no gpu hardware either. Because it is HPC. And I am accessing it from remote, with ssh.

@Shyamkkhadka Yes, that’s probably it. HPC generally don’t have GPUs unless they are supposed to be a GPU cluster. You can check available hardware with lspci . For example: stackoverflow.com/questions/10310250/…

@BrendanWood, As suggested in your link, when I did «lspci | grep VGA». It shows output as «lspci | grep VGA 01:03.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] ES1000 (rev 02)». So I think it has GPU hardware.

On any linux system with the NVIDIA driver installed and loaded into the kernel, you can execute:

cat /proc/driver/nvidia/version 

to get the version of the currently loaded NVIDIA kernel module, for example:

$ cat /proc/driver/nvidia/version NVRM version: NVIDIA UNIX x86_64 Kernel Module 304.54 Sat Sep 29 00:05:49 PDT 2012 GCC version: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

Or if you have Bumblebee installed (due to NVIDIA Optimus dual GPU), then run this instead: «optirun cat /proc/driver/nvidia/version»

This is especially useful when the output of nvidia-smi is: Failed to initialize NVML: GPU access blocked by the operating system

In my centos 6.4 system, I don’t have directory nvidia inside /proc/driver. What might be the problem ? Due to this, I am not able to see my nvidia driver version.

Also useful when you get the output Failed to initialize NVML: Driver/library version mismatch from nvidia-smi .

root@nyx:/usr/src# modinfo nvidia|grep version: version: 331.113 

On my system the module was named nvidia_XXX corresponding to the major driver series I had installed, and since modinfo doesn’t support wildcards or partial name matches I had to do this modinfo $(find /lib/modules/$(uname -r) -iname nvidia_*.ko | head -1) | grep ^version: which returns the correct major and minor driver version.

Читайте также:  Редактирование пользователей в linux

On ubuntu 18.04 my version of modinfo has a —field command line option. So you can skip the grep: modinfo nvidia —field version . Also, in ubuntu 16.04 this doesn’t seem to work. I always get ERROR: Module nvidia not found .

modinfo shows a different version from the /proc/driver/nvidia/version file. I suppose it reads the version from the module file, not from the one actually in use. I just installed the new driver and I still have to reboot.

cd \Program Files\NVIDIA Corporation\NVSMI

nvidia-smi

nvidia-smi --query-gpu=driver_version --format=csv,noheader --id=0 

returns result as a string that doesn’t require further parsing like: 470.82.00

In case nvidia-smi is not available for some reason, information can be obtained by calling into driver APIs. Driver libraries can be loaded using Python ctypes library.

[NOTE: I am not deleting my answer on purpose, so people see how not to do it]

me@over_there:~$ dpkg --status nvidia-current | grep Version | cut -f 1 -d '-' | sed 's/[^.,0-9]//g' 260.19.06 

you will get the version of the nVIDIA driver package installed through your distribution’s packaging mechanism. But this may not be the version that is actually running as part of your kernel right now.

That doesn’t tell you what version of the driver is actually installed and in use by the kernel. Use the proc file system to see that. Also this only works in debian style distributions.

@Framester: You totally gamed the system! I just gave you another +1 on a useful wrong answer. you cunning devil 🙂

To expand on ccc’s answer, if you want to incorporate querying the card with a script, here is information on Nvidia site on how to do so:

Also, I found this thread researching powershell. Here is an example command that runs the utility to get the true memory available on the GPU to get you started.

# get gpu metrics $cmd = "& 'C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi' --query-gpu=name,utilization.memory,driver_version --format=csv" $gpuinfo = invoke-expression $cmd | ConvertFrom-CSV $gpuname = $gpuinfo.name $gpuutil = $gpuinfo.'utilization.memory [%]'.Split(' ')[0] $gpuDriver = $gpuinfo.driver_version 

Источник

How to check the HBA name, make, model, firmware, driver version in Linux

NOTE: The commands to validate this may vary based on the type of HBA being used so I will show some commands and examples for Emulex HBA card where these commands can be used. I cannot assure if the same would work for a Linux machine with Qlogic card.

Читайте также:  Архитектура ядра ос линукс

Below command will give you the connected HBA detail

# lspci -nn | grep -i Fibre
04:00.2 Fibre Channel [0c04]: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) [19a2:0714] (rev 01)
04:00.3 Fibre Channel [0c04]: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) [19a2:0714] (rev 01)

With this we know we have a Emulex HBA

Next install sysfsutils rpm if not installed already.

Now use the below command. This will give you a bunch of information regarding your HBA card.

# systool -a -v -c scsi_host | egrep «Class Device|model|version|proc_name|info|fwrev»
Class Device = «host0»
Class Device path = «/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.2/host0/scsi_host/host0»
bg_info = «BlockGuard Disabled»
fwrev = «11.1.183.23, sli-4:0:1»
info = «HP FlexFabric 10Gb 2-port 554FLB Adapter on PCI bus 04 device 02 irq 36 port 1 Logical Link Speed: 8000 Mbps»
lpfc_drvr_version = «Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6»
modeldesc = «HP FlexFabric 10Gb 2-port 554FLB Adapter»
modelname = «554FLB»
npiv_info = «NPIV Physical»
option_rom_version = «11.1.183.23»
proc_name = «lpfc»
Class Device = «host1»
Class Device path = «/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.3/host1/scsi_host/host1»
bg_info = «BlockGuard Disabled»
fwrev = «11.1.183.23, sli-4:0:1»
info = «HP FlexFabric 10Gb 2-port 554FLB Adapter on PCI bus 04 device 03 irq 41 port 2 Logical Link Speed: 8000 Mbps»
lpfc_drvr_version = «Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6»
modeldesc = «HP FlexFabric 10Gb 2-port 554FLB Adapter»
modelname = «554FLB»
npiv_info = «NPIV Physical»
option_rom_version = «11.1.183.23»
proc_name = «lpfc»

These fields are populated from below location so if you wish to get any more information then navigate around all the files from this location

# grep -v «zZzZ» /sys/class/scsi_host/host*/model*
/sys/class/scsi_host/host0/modeldesc: HP FlexFabric 10Gb 2-port 554FLB Adapter
/sys/class/scsi_host/host0/modelname:554FLB
/sys/class/scsi_host/host1/modeldesc: HP FlexFabric 10Gb 2-port 554FLB Adapter
/sys/class/scsi_host/host1/modelname:554FLB

# grep -v «zZzZ» /sys/class/scsi_host/host*/proc_name
/sys/class/scsi_host/host0/proc_name: lpfc
/sys/class/scsi_host/host1/proc_name: lpfc

Now since we know the driver name, we can get more information for our driver

# modinfo lpfc
filename: /lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko.xz
version: 0:11.2.0.6
author: Emulex Corporation — tech.support@emulex.com
description: Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6
license: GPL
retpoline: Y
rhelversion: 7.4
srcversion: 61B09422B7415BF170E0D67

NOTE: Although most Fibre Channel drivers register a model name and description within sysfs, not all scsi drivers will. For example, the Smart Array, SIL2424 and ATA HBA, as shown in the above configuration, do not supply that information. For those types of cards you must use lspci -k to retrieve the information.

I hope the article was useful.

Источник

How do I find out which version of a driver is included in a kernel?

I need to find out which driver/module version is contained in a kernel which isn’t installed. Is there a document in the source that contains this or something listed online that haven’t been able to find?

You’re going at this the wrong way. Read this. Use the tools I listed in the troubleshooting section, then from the output tell us what isn’t working.

@eyoung100 It isn’t a matter of troubleshooting. I was asked by one of our dedicated Red Hat resources which driver version is provided by the latest kernel found at kernel.org. Again, this isn’t for running kernels. I know how to obtain that information. I need to know how to determine what a kernel will provide prior to installation. Release notes that list driver versions or similar documentation.

Читайте также:  Check if find linux

@michas the fnic driver. I was asked to determine which driver version is provided in the source downloaded from kernel.org.

2 Answers 2

You can use the modinfo command to give you all kind of information about a given module.

$ modinfo bluetooth filename: /lib/modules/3.17.4-1-ARCH/kernel/net/bluetooth/bluetooth.ko.gz alias: net-pf-31 license: GPL version: 2.19 description: Bluetooth Core ver 2.19 author: Marcel Holtmann srcversion: 4D63C2C41C55E984E7057A5 depends: rfkill,crc16 intree: Y vermagic: 3.17.4-1-ARCH SMP preempt mod_unload modversions parm: disable_esco:Disable eSCO connection creation (bool) parm: disable_ertm:Disable enhanced retransmission mode (bool) 

However most of the time you will not find any explicit version, because the module is simply the one contained in your kernel source tree.

Источник

How to check a driver version in linux kernel update

# uname -r 2.6.32-279.2.1.el6.x86_64 
# ethtool -i eth0 driver: e1000e version: 1.9.5-k firmware-version: 2.1-2 bus-info: 0000:02:00.0 
# yum check-update kernel Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirror.for.me.uk * epel: mirrors.coreix.net * extras: centos.mirroring.pulsant.co.uk * updates: mirror.for.me.uk kernel.x86_64 2.6.32-279.19.1.el6 

How to determine what is the actual version of this driver — is there any other command for this purpose?

# rpm -q --changelog kernel.x86_64 0:2.6.32-279.19.1.el6 | egrep -i 'e1000' | grep -i 'version' - [netdrv] e1000e: update to upstream version 1.4.4 (Andy Gospodarek) [730607] - [netdrv] e1000e: update to upstream version 1.3.16-k (Andy Gospodarek) [694223 698291] - [netdrv] e1000e: upstream to upstream version 1.2.20 (Andy Gospodarek) [636325] - [netdrv] e1000e: update driver version number (Andy Gospodarek) [582803] - [netdrv] e1000: update DRV_VERSION to match upstream (Dean Nelson) [737719] - [netdrv] e1000: remove not used fw_version from .get_drvinfo (Dean Nelson) [737719] - [netdrv] e1000e: increase version number (Dean Nelson) [737713] - [netdrv] e1000e: cleanup strlcpy conversion of .get_drvinfo routines (Dean Nelson) [737713] - [netdrv] e1000e: update to upstream version 1.4.4 (Andy Gospodarek) [730607] - [netdrv] e1000e: update to upstream version 1.3.16-k (Andy Gospodarek) [694223 698291] - [netdrv] e1000e: upstream to upstream version 1.2.20 (Andy Gospodarek) [636325] - [netdrv] e1000e: update driver version number (Andy Gospodarek) [582803] - [netdrv] e1000: update DRV_VERSION to match upstream (Dean Nelson) [737719] - [netdrv] e1000: remove not used fw_version from .get_drvinfo (Dean Nelson) [737719] - [netdrv] e1000e: increase version number (Dean Nelson) [737713] - [netdrv] e1000e: cleanup strlcpy conversion of .get_drvinfo routines (Dean Nelson) [737713] - [netdrv] e1000e: update to upstream version 1.4.4 (Andy Gospodarek) [730607] - [netdrv] e1000e: update to upstream version 1.3.16-k (Andy Gospodarek) [694223 698291] - [netdrv] e1000e: upstream to upstream version 1.2.20 (Andy Gospodarek) [636325] - [netdrv] e1000e: update driver version number (Andy Gospodarek) [582803] 

Источник

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