linux如何查看 GPU的信息
原文:https://www.binarytides.com/linux-get-gpu-information/
譯文:
您需要找到正確的型號(hào)和供應(yīng)商的圖形卡在您的系統(tǒng)上,能夠安裝適當(dāng)?shù)尿?qū)動(dòng)程序,并使硬件功能正常。大多數(shù)現(xiàn)代linux發(fā)行版可以檢測(cè)各種顯卡,但并不總是有最佳的驅(qū)動(dòng)程序。
?
因此,如果您擁有像Nvidia或Ati這樣的外部顯卡,那么您需要查找模型名稱/編號(hào),然后在線查找進(jìn)一步的詳細(xì)信息。當(dāng)然,如果你有購(gòu)買電腦時(shí)附帶的硬件手冊(cè),就會(huì)容易得多。但是這里我們將使用命令來(lái)找出相同的信息。
硬件細(xì)節(jié)
這只是一些需要學(xué)習(xí)的命令。第一個(gè)是lscpi,下面是一個(gè)快速示例,展示如何獲取圖形單元(也稱為vga卡或視頻卡)的詳細(xì)信息。
$ 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第一行包含供應(yīng)商的nae、模型名稱/系列和pci id。
VGA compatible controller [0300]: Intel Corporation 82G35 Express Integrated Graphics Controller [8086:2982]注意括號(hào)內(nèi)的數(shù)字- 8086:2982。這樣的數(shù)字幾乎出現(xiàn)在所有顯卡上。第一部分(8086)表示供應(yīng)商id(這里是Intel),第二部分(2982)表示pci id,它表示圖形單元的模型。
?
現(xiàn)在,您可以使用供應(yīng)商名稱和pci id搜索谷歌以獲得更多詳細(xì)信息。
?
lshw命令還可以用來(lái)獲取上述信息。
$ 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詳細(xì)信息以相同的方式表示。活動(dòng)設(shè)備驅(qū)動(dòng)程序也列在“配置”行中。
?
下面是一個(gè)具有nvidia geforce 210顯卡的系統(tǒng)的示例輸出。
$ 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
對(duì)于像nvidia或ati這樣的專用設(shè)備,您可以很容易地在線搜索型號(hào)或pci id。規(guī)范和其他細(xì)節(jié)可以在供應(yīng)商的網(wǎng)站上找到。
?
但是,對(duì)于像Intel GMA這樣的集成圖形芯片組,僅通過搜索系列名稱(這里是82G35)或pci id可能無(wú)法獲得足夠的詳細(xì)信息。
?
在這種情況下,查找主板模型并找到它的規(guī)范。廠商為他們生產(chǎn)的每一個(gè)主板模型發(fā)布產(chǎn)品規(guī)格文件。這些包含有關(guān)硬件的技術(shù)細(xì)節(jié)。
?
要找到您的主板模型,請(qǐng)使用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”主板。查找該模型的產(chǎn)品說明文檔,并在其中查找視頻/圖形信息。
?
檢查硬件加速
使用基于硬件的3d加速,需要繪制3d圖形的應(yīng)用程序可以直接使用硬件處理和生成圖形,顯著加快3d渲染。為此,顯卡必須支持硬件加速,并且必須在系統(tǒng)上安裝正確的驅(qū)動(dòng)程序才能使用此功能。
?
硬件提供的3d處理功能符合OpenGL規(guī)范,有了合適的硬件,應(yīng)用程序可以通過OpenGL api訪問它們。OpenGL只定義了函數(shù),而實(shí)現(xiàn)是在硬件內(nèi)部完成的,這使得它非常快。
?
然而,也有像MESA這樣的庫(kù)完全在軟件中實(shí)現(xiàn)opengl功能。因此,可以使用opengl渲染圖形,而不需要一個(gè)與opengl兼容的gpu。因此,通過檢查opengl呈現(xiàn)庫(kù),我們可以發(fā)現(xiàn)是否存在硬件加速。
?
檢查glxinfo命令輸出以獲得OpenGL的詳細(xì)信息
$ 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庫(kù),這意味著3d渲染完全在軟件中處理。這將是一個(gè)緩慢的過程,游戲也不會(huì)運(yùn)行得很好。
?
使用專用nvidia geforce 200顯卡的機(jī)器上的輸出看起來(lái)是這樣的
$ 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.
總結(jié)
以上是生活随笔為你收集整理的linux如何查看 GPU的信息的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SMO算法精解
- 下一篇: linux -- Linux diff与