- How to get the nvidia driver version from the command line?
- 11 Answers 11
- How to inspect the currently used Nvidia driver version and switch it to another alternative?
- Re: additional-drivers
- (Off-topic explanation of my reason to want to inspect and switch the nvidia 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.
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 inspect the currently used Nvidia driver version and switch it to another alternative?
I’m trying to find out which Nvidia driver is being used currently in the system (and how to perhaps switch it to another version or the open-source nouveau driver). modinfo knows about several nvidia drivers installed in the system ( nvidia_173 and nvidia_331 ), but lsmod just calls it nvidia (and modinfo nvidia fails):
$ modinfo nv nvidia_173 nvidia_331 nvidiafb nvme nvram nv_tco marsmorgana@marsmorgana:~$ modinfo nvidia_331 filename: /lib/modules/3.11.0-26-generic/updates/dkms/nvidia_331.ko alias: char-major-195-* version: 331.113 supported: external license: NVIDIA alias: pci:v000010DEd00000E00sv*sd*bc04sc80i00* alias: pci:v000010DEd00000AA3sv*sd*bc0Bsc40i00* alias: pci:v000010DEd*sv*sd*bc03sc02i00* alias: pci:v000010DEd*sv*sd*bc03sc00i00* depends: drm vermagic: 3.11.0-26-generic SMP mod_unload modversions 686 parm: NVreg_Mobile:int parm: NVreg_ResmanDebugLevel:int parm: NVreg_RmLogonRC:int parm: NVreg_ModifyDeviceFiles:int parm: NVreg_DeviceFileUID:int parm: NVreg_DeviceFileGID:int parm: NVreg_DeviceFileMode:int parm: NVreg_RemapLimit:int parm: NVreg_UpdateMemoryTypes:int parm: NVreg_InitializeSystemMemoryAllocations:int parm: NVreg_UsePageAttributeTable:int parm: NVreg_MapRegistersEarly:int parm: NVreg_RegisterForACPIEvents:int parm: NVreg_CheckPCIConfigSpace:int parm: NVreg_EnablePCIeGen3:int parm: NVreg_EnableMSI:int parm: NVreg_MemoryPoolSize:int parm: NVreg_RegistryDwords:charp parm: NVreg_RmMsg:charp parm: NVreg_AssignGpus:charp marsmorgana@marsmorgana:~$ lsmod | fgrep nv nvidia 9704581 42 drm 247722 2 nvidia marsmorgana@marsmorgana:~$ modinfo nvidia ERROR: modinfo: could not find module nvidia marsmorgana@marsmorgana:~$
Re: additional-drivers
In 12.04, I have neither an additional-drivers tab in update-manager : nor an additional-drivers app in the menu, nor such a program (checked by locate ), nor such an installable package (checked by apt-cache search ).
(Off-topic explanation of my reason to want to inspect and switch the nvidia driver)
Because I might be experiencing problems with running SketchUp under wine because of the nvidia driver, as reported there. An off-topic UPDATE: actually, it turned out later that this is another known nvidia-unrelated problem (see under «Tips») (found via «Sketchup not responding»), which must be fixed in wine-1.7.31; this version or later is available in the Ubuntu Wine repository for Trusty or later, so I’d need to upgrade from my 12.04 (Precise) to Trusty to use those packages. Nevertheless, my question here makes sense independently of the real solution in my situation.
Как узнать какие драйвера сейчас стоят на видеокарте в линукс?
устанавливал пропиретарные драйвера для Nvidia Geforce 920m как узнать, правильно ли они поставились?
OC: Endeavour OS (Arch Linux)
Видеокарта: NVIDIA Geforce 920m
ЦП: Intel core i3-4005u
Простой 7 комментариев
я для этих целей запускаю nvidia-settings — если она видит оборудование (карту, мониторы) — значит все ок
04:00.0 3D controller: NVIDIA Corporation GK208BM [GeForce 920M] (rev a1) Subsystem: ASUSTeK Computer Inc. Device 1a6d Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Kernel modules: nouveau
R4mBLe, я понятия не имею что за дистр Endeavour.
В Убунте ставится просто из реп. Посмотри есть ли в репах пакет nvidia-driver-5 или просто nvidia-5
Например nvidia-driver-515 (у меня выше не работает и я не разбирался почему) или nvidia-driver-525.
В крайнем случае можно поставить прямо с сайта nvidia.
Если lsmod показывает подгруженный модуль nvidia, то драйвера поставились нормально
Но geforce карта скорее всего не используется, а используется встроенный intel
xibir, не знаю что я делаю не так, но у меня никакого оптимуса нет (даже пакет не стоит) и карточка работает вполне себе.
xibir, я просто вижу что есть в репах два пакета — mate-optimus и чтото там еще (для кед кажется). Они не стоят.
Карточка работает отлично.
Правда сейчас глянул — на новом ноуте даже нет выбиралки в настройках какую карту использовать. Может быть тут одна Quadro M2200 (или я выключил интеграшку в Bios)
Но на старом ноуте с M500 точно был какой-то интел и там даже можно было в Nvidia Settings выбирать что будет работать при следующей загрукзке
На лету конечно не переключалось.