Linux/显卡:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
(未显示同一用户的9个中间版本)
第1行: 第1行:
[[Linux|返回上一级]]
[[Linux|返回上一级]]
== 检查 ==
== 检查 ==
=== glxinfo ===
确定显卡程序已经安装。
{{shc_out|<syntaxhighlight lang="bash">
glxinfo | grep rendering</syntaxhighlight>|<syntaxhighlight lang="javascript">
direct rendering: Yes
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
{{shc_out|<syntaxhighlight lang="bash">
glxinfo | grep -i rend</syntaxhighlight>|<syntaxhighlight lang="javascript">
direct rendering: Yes
    GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer,
    Renderbuffer free memory - total: 7686 MB, largest block: 6083 MB
    Renderbuffer free aux. memory - total: 56154 MB, largest block: 42137 MB
OpenGL renderer string: Radeon RX 5500 XT
    GL_ARB_compute_shader, GL_ARB_conditional_render_inverted,
    GL_NV_conditional_render, GL_NV_copy_depth_to_color, GL_NV_copy_image,
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NV_conditional_render, GL_NV_copy_depth_to_color, GL_NV_copy_image,
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NV_conditional_render, GL_NV_copy_depth_to_color, GL_NV_copy_image,
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
=== lspci ===
检测显卡驱动版本
检测显卡驱动版本
<syntaxhighlight lang="bash">
 
lspci | grep VGA</syntaxhighlight>
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
lspci | grep -i VGA</syntaxhighlight>|<syntaxhighlight lang="javascript">
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev c7)</pre></blockquote>
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] (rev c5)
<syntaxhighlight lang="bash">
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
lspci | egrep 'VGA|3D'</syntaxhighlight>
 
<blockquote><pre>
 
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev c7)</pre></blockquote>
{{shc_out|<syntaxhighlight lang="bash">
lspci | grep -i VGA</syntaxhighlight>|<syntaxhighlight lang="javascript">
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] (rev c5)
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
 
获取系统上显卡的信息
获取系统上显卡的信息
<syntaxhighlight lang="bash">
 
lspci -vnn | grep VGA -A 12</syntaxhighlight>
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
lspci -vnn | grep VGA -A 12</syntaxhighlight>|<syntaxhighlight lang="javascript">
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev c7) (prog-if 00 [VGA controller])
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] [1002:7340] (rev c5) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. Radeon RX 480 [1043:04fb]
Subsystem: Gigabyte Technology Co., Ltd Navi 14 [Radeon RX 5500/5500M / Pro 5500M] [1458:2319]
Flags: bus master, fast devsel, latency 0, IRQ 153
Flags: bus master, fast devsel, latency 0, IRQ 165
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=2M]
Memory at f0000000 (64-bit, prefetchable) [size=2M]
I/O ports at e000 [size=256]
I/O ports at e000 [size=256]
Memory at f7e00000 (32-bit, non-prefetchable) [size=256K]
Memory at f7a00000 (32-bit, non-prefetchable) [size=512K]
Expansion ROM at 000c0000 [disabled] [size=128K]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: <access denied>
Capabilities: <access denied>
第26行: 第54行:
Kernel modules: amdgpu
Kernel modules: amdgpu


01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0]
03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio [1002:ab38]
</pre></blockquote>
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
 
当前驱动
当前驱动
<syntaxhighlight lang="bash">
 
sudo lshw -c video | grep configuration</syntaxhighlight>
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
lshw -c video | grep configuration</syntaxhighlight>|<syntaxhighlight lang="javascript">
WARNING: you should run this program as super-user.
       configuration: driver=amdgpu latency=0
       configuration: driver=amdgpu latency=0
</pre></blockquote>
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
 
{{shc|<syntaxhighlight lang="bash">
moreinfo amdgpu
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
 
 
=== nvidia GPU ===
=== nvidia GPU ===
查看GPU型号
查看GPU型号
第48行: 第85行:
=== amd GPU ===
=== amd GPU ===
查看GPU型号
查看GPU型号
<syntaxhighlight lang="bash">
 
lspci | grep -i amd</syntaxhighlight>
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
lspci | grep -i amd
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev c7)
</syntaxhighlight>|<syntaxhighlight lang="javascript">
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
01:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c5)
</pre></blockquote>
02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] (rev c5)
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}


查看驱动版本
查看驱动版本
<syntaxhighlight lang="bash">
 
sudo dpkg --list | grep amd-*</syntaxhighlight>
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
sudo dpkg --list | grep amd-*
ii  accountsservice                            0.6.55-0ubuntu10                      amd64        query and manipulate user account information
</syntaxhighlight>|<syntaxhighlight lang="javascript">
ii  acl                                        2.2.53-4                              amd64        access control list - utilities
ii  accountsservice                            0.6.55-0ubuntu11                      amd64        query and manipulate user account information
...
ii  amd64-microcode                            3.20191218.1ubuntu1                  amd64        Processor microcode firmware for AMD CPUs
ii  amdgpu                                    20.20-1089974                        amd64        Meta package to install amdgpu components.
ii  amdgpu-core                                20.20-1089974                        all          Core meta package for unified amdgpu driver.
ii  amdgpu-dkms                                1:5.6.0.13-1089974                    all          amdgpu driver in DKMS format.
...
...
ii  zlib1g:amd64                              1:1.2.11.dfsg-1ubuntu3                amd64        compression library - runtime
ii  zip                                        3.0-11build1                          amd64        Archiver for .zip files
ii  zlib1g-dev:amd64                           1:1.2.11.dfsg-1ubuntu3                amd64        compression library - development
ii  zlib1g:amd64                               1:1.2.11.dfsg-2ubuntu1                amd64        compression library - runtime
</pre></blockquote>
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
 
==== 风扇控制 ====
==== 风扇控制 ====
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
第94行: 第140行:
echo "2" > pwm1_enable</syntaxhighlight>|$}}
echo "2" > pwm1_enable</syntaxhighlight>|$}}
* Warning: Resetting fan speed to auto may not work due to a driver bug and instead a restart of the driver may be required as a workaround.
* Warning: Resetting fan speed to auto may not work due to a driver bug and instead a restart of the driver may be required as a workaround.
== OpenGL ==
检查硬件加速。
{{shc_out|<syntaxhighlight lang="bash">
glxinfo | grep OpenGL</syntaxhighlight>|<syntaxhighlight lang="javascript">
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: Radeon RX 5500 XT
OpenGL core profile version string: 4.6.14736 Core Profile Context 20.20
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.14736 Compatibility Profile Context 20.20
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: 4.6.14736 Compatibility Profile Context 20.20
OpenGL ES profile shading language version string: 4.60
OpenGL ES profile extensions:
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}


== AMD ==
== AMD ==
第108行: 第175行:
sudo apt install radeontop</syntaxhighlight>|$}}
sudo apt install radeontop</syntaxhighlight>|$}}


{{shc|<syntaxhighlight lang="bash">
{| class="wikitable"
|-
|{{shc|<syntaxhighlight lang="bash">
sudo radeontop</syntaxhighlight>|$}}
sudo radeontop</syntaxhighlight>|$}}
|[[文件:Linux 显卡 amd GPU radeontop 1.png|500px|左|Linux 显卡 amd GPU radeontop 1]]
|}
这里可以看到显卡有些不正常,目前还不知道解决办法。


== Nvidia ==
== Nvidia ==
第339行: 第412行:
=== lm-sensors ===
=== lm-sensors ===
<blockquote>
<blockquote>
<syntaxhighlight lang="shell">
<syntaxhighlight lang="as3">
sudo apt-get install lm-sensors</syntaxhighlight></blockquote>
sudo apt-get install lm-sensors</syntaxhighlight></blockquote>
{{shc_out|<syntaxhighlight lang="bash">
{{shc_out|<syntaxhighlight lang="bash">
第370行: 第443行:
power1:      16.00 W  (cap = 125.00 W)
power1:      16.00 W  (cap = 125.00 W)
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
</syntaxhighlight>|kangjian@kangjian:~/桌面$}}
==== watch ====
配合 watch命令,可以每秒执行一次。
{{shc|<syntaxhighlight lang="bash">
watch -n 1 sensors</syntaxhighlight>|kangjian@kangjian:~/桌面$}}


=== psensor ===
=== psensor ===