linux如何查看 GPU的信息
原文:https://www.binarytides.com/linux-get-gpu-information/
譯文:
您需要找到正確的型號和供應商的圖形卡在您的系統上,能夠安裝適當的驅動程序,并使硬件功能正常。大多數現代linux發行版可以檢測各種顯卡,但并不總是有最佳的驅動程序。
?
因此,如果您擁有像Nvidia或Ati這樣的外部顯卡,那么您需要查找模型名稱/編號,然后在線查找進一步的詳細信息。當然,如果你有購買電腦時附帶的硬件手冊,就會容易得多。但是這里我們將使用命令來找出相同的信息。
硬件細節
這只是一些需要學習的命令。第一個是lscpi,下面是一個快速示例,展示如何獲取圖形單元(也稱為vga卡或視頻卡)的詳細信息。
$ lspci -vnn | grep VGA -A 12 00:02.0 VGA compatible controller [0300]: Intel Corporation 82G35 Express Integrated Graphics Controller [8086:2982] (rev 03) (prog-if 00 [VGA controller])Subsystem: Intel Corporation Device [8086:d701]Flags: bus master, fast devsel, latency 0, IRQ 44Memory at e0200000 (32-bit, non-prefetchable) [size=1M]Memory at d0000000 (64-bit, prefetchable) [size=256M]I/O ports at 2440 [size=8]Expansion ROM at <unassigned> [disabled]Capabilities: <access denied>Kernel driver in use: i915第一行包含供應商的nae、模型名稱/系列和pci id。
VGA compatible controller [0300]: Intel Corporation 82G35 Express Integrated Graphics Controller [8086:2982]注意括號內的數字- 8086:2982。這樣的數字幾乎出現在所有顯卡上。第一部分(8086)表示供應商id(這里是Intel),第二部分(2982)表示pci id,它表示圖形單元的模型。
?
現在,您可以使用供應商名稱和pci id搜索谷歌以獲得更多詳細信息。
?
lshw命令還可以用來獲取上述信息。
$ lshw -numeric -C display WARNING: you should run this program as super-user.*-display:0 description: VGA compatible controllerproduct: 82G35 Express Integrated Graphics Controller [8086:2982]vendor: Intel Corporation [8086]physical id: 2bus info: pci@0000:00:02.0version: 03width: 64 bitsclock: 33MHzcapabilities: vga_controller bus_master cap_list romconfiguration: driver=i915 latency=0resources: irq:44 memory:e0200000-e02fffff memory:d0000000-dfffffff ioport:2440(size=8)pci詳細信息以相同的方式表示。活動設備驅動程序也列在“配置”行中。
?
下面是一個具有nvidia geforce 210顯卡的系統的示例輸出。
$ lspci -vnn | grep VGA -A 12 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT218 [GeForce 210] [10de:0a65] (rev a2) (prog-if 00 [VGA controller]) .....集成芯片組vs專用gpu
對于像nvidia或ati這樣的專用設備,您可以很容易地在線搜索型號或pci id。規范和其他細節可以在供應商的網站上找到。
?
但是,對于像Intel GMA這樣的集成圖形芯片組,僅通過搜索系列名稱(這里是82G35)或pci id可能無法獲得足夠的詳細信息。
?
在這種情況下,查找主板模型并找到它的規范。廠商為他們生產的每一個主板模型發布產品規格文件。這些包含有關硬件的技術細節。
?
要找到您的主板模型,請使用dmidecode或inxi命令。
?
?
Dmidecode
$ sudo dmidecode -t baseboard | grep -i 'Product'Product Name: DG35ECInxi
$ inxi -M Machine: Mobo: Intel model: DG35EC version: AAE29266-210Bios: Intel version: ECG3510M.86A.0112.2009.0203.1136 date: 02/03/2009以上輸出顯示其為“Intel DG35EC”主板。查找該模型的產品說明文檔,并在其中查找視頻/圖形信息。
?
檢查硬件加速
使用基于硬件的3d加速,需要繪制3d圖形的應用程序可以直接使用硬件處理和生成圖形,顯著加快3d渲染。為此,顯卡必須支持硬件加速,并且必須在系統上安裝正確的驅動程序才能使用此功能。
?
硬件提供的3d處理功能符合OpenGL規范,有了合適的硬件,應用程序可以通過OpenGL api訪問它們。OpenGL只定義了函數,而實現是在硬件內部完成的,這使得它非常快。
?
然而,也有像MESA這樣的庫完全在軟件中實現opengl功能。因此,可以使用opengl渲染圖形,而不需要一個與opengl兼容的gpu。因此,通過檢查opengl呈現庫,我們可以發現是否存在硬件加速。
?
檢查glxinfo命令輸出以獲得OpenGL的詳細信息
$ glxinfo | grep OpenGL OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) 965G OpenGL version string: 2.1 Mesa 10.1.0 OpenGL shading language version string: 1.20 OpenGL extensions:“OpenGL渲染器字符串”指向MESA庫,這意味著3d渲染完全在軟件中處理。這將是一個緩慢的過程,游戲也不會運行得很好。
?
使用專用nvidia geforce 200顯卡的機器上的輸出看起來是這樣的
$ glxinfo | grep OpenGL OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce 210/PCIe/SSE2 OpenGL core profile version string: 3.3.0 NVIDIA 331.20 OpenGL core profile shading language version string: 3.30 NVIDIA via Cg compiler OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.3.0 NVIDIA 331.20 OpenGL shading language version string: 3.30 NVIDIA via Cg compilerNote the line
OpenGL renderer string: GeForce 210/PCIe/SSE2So the OpenGL renderer is GeForce, which is the nvidia proprietory driver. This indicates the hardware based 3d acceleration is available. So graphics performance would be good.
總結
以上是生活随笔為你收集整理的linux如何查看 GPU的信息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SMO算法精解
- 下一篇: linux -- Linux diff与