linux如何查詢系統驅動是否支持該型號顯卡


    操作系統在做硬件適配時,經常會檢查系統內核是否支持硬件的顯卡;如果不支持,則一般是通過升級內核或者該型號對應品牌的顯卡驅動來解決(開源或者閉源);

操作流程如下

1> 查詢本機的顯卡型號

因顯卡一般是PCI接口,可以通過lspci查詢顯卡相關信息,下圖可以看出有兩張顯卡,

集成顯卡 硬件廠商 Intel      名稱型號: Xeon E3-1200 v3/4th Gen Core Processor  PCI ID: 8086:0412

獨立顯卡 硬件廠商 NAVIDA  名稱型號:GF119(GeForce GT 705)                            PCI ID: 10de:104c

notes:

lspci

-v     Be verbose and display detailed information about all device 顯示所有PCI設備的信息

-nn Show PCI vendor and device codes as both numbers and names. 顯示PCI設備的廠商號和設備碼

 

grep Context Line Control

-A NUM, --after-context=NUM 顯示目標關鍵字之后的Num行,控制顯示段落大小以便閱讀
Print NUM lines of trailing context after matching lines. Places a line containing a group separator (described under --group-separator) between contiguous
groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.

同時可以使用另外一個軟件lshw, 它是一款硬件信息查看的小工具,不僅可以清晰列出硬件設備的具體信息,而且可以將這些輸出信息以json、xml、html形式進行輸出。具體用法:man lshw

使用前要安裝改軟件,以Fedora25安裝方法:  sudo dnf install lshw

EXAMPLES

lshw -short

Lists hardware in a compact format.

lshw -class disk -class storage
Lists all disks and storage controllers in the system.

lshw -html -class network
Lists all network interfaces in HTML.

lshw -disable dmi
Don't use DMI to detect hardware.

 2> 如何確認本機顯卡驅動是否正常加載,同樣可以使用lshw進行查看

注意上圖中的configuration字段,如果driver=“驅動名稱”字段后不為空,說明系統支持改顯卡的驅動;

3> 如何查看顯卡驅動的具體內容,可以利用 modinfo 驅動名稱, 以NAVIDA獨立顯卡為例,顯卡驅動名稱為nouveau

[cxy@localhost-live 桌面]$ modinfo nouveau
filename: /lib/modules/4.11.12-200.fc25.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko.xz
firmware: nvidia/gp100/gr/sw_method_init.bin
firmware: nvidia/gp100/gr/sw_bundle_init.bin
…… 方便瀏覽期間,中間省略多行
firmware: nvidia/gm20b/gr/fecs_sig.bin
firmware: nvidia/gm20b/gr/fecs_data.bin
firmware: nvidia/gm20b/gr/fecs_inst.bin
firmware: nvidia/gm20b/gr/fecs_bl.bin
firmware: nvidia/gm20b/acr/ucode_load.bin
firmware: nvidia/gm20b/acr/bl.bin
license: GPL and additional rights
description: nVidia Riva/TNT/GeForce/Quadro/Tesla
author: Nouveau Project
alias: pci:v000012D2d*sv*sd*bc03sc*i*
alias: pci:v000010DEd*sv*sd*bc03sc*i*
depends: drm,drm_kms_helper,ttm,mxm-wmi,wmi,video,i2c-algo-bit
intree: Y
vermagic: 4.11.12-200.fc25.x86_64 SMP mod_unload
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
parm: tv_norm:Default TV norm.
Supported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,
hd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.
Default: PAL
*NOTE* Ignored for cards with external TV encoders. (charp)
parm: vram_pushbuf:Create DMA push buffers in VRAM (int)
parm: nofbaccel:Disable fbcon acceleration (int)
parm: mst:Enable DisplayPort multi-stream (default: enabled) (int)
parm: atomic:Expose atomic ioctl (default: disabled) (int)
parm: tv_disable:Disable TV-out detection (int)
parm: ignorelid:Ignore ACPI lid status (int)
parm: duallink:Allow dual-link TMDS (default: enabled) (int)
parm: hdmimhz:Force a maximum HDMI pixel clock (in MHz) (int)
parm: config:option string to pass to driver core (charp)
parm: debug:debug string to pass to driver core (charp)
parm: noaccel:disable kernel/abi16 acceleration (int)
parm: modeset:enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)
parm: runpm:disable (0), force enable (1), optimus only default (-1) (int)

 

 4>拓展:如何確定顯卡是否支持硬件加速

可以使用工具gxlinfo查詢,如果可以查到OpenGL信息說明顯卡支持硬件加速且正常加載;

gxlinfo屬於glx-utils包,如果沒有該指令,需要先安裝這個包

[cxy@localhost-live 桌面]$ rpm -qf `which glxinfo`
glx-utils-8.3.0-6.fc25.x86_64

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM