rx 比 Fedora 28 上的集成 vega gpu 慢 560 倍

rx 比 Fedora 28 上的集成 vega gpu 慢 560 倍

我使用的是 fedora 28,因为它似乎是唯一可以正确检测 rx560x 的发行版。尽管如此,我注意到使用独立 GPU 时的性能明显比使用集成 GPU 差。

我的机器配置是:ACER 硝基 5 an515-42、8GB 内存、APU ryzen 2500u 搭配 vega 8 集成显卡、RX 560X AMD 独立显卡。

lspci这是命令的输出

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15d0
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Device 15d1
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h 
(Models 00h-0fh) PCIe Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.6 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.7 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h 
(Models 00h-0fh) PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15db
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15dc
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller 
(rev 61)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge 
(rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15e8
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15e9
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ea
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15eb
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ec
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ed
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ee
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ef
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] 
Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] (rev 
c0)
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. 
RTL8411B PCI Express Card Reader (rev 01)
02:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. 
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
03:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless 
Network Adapter (rev 32)
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. 
[AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 
(rev c4)
04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 
15de
04:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] 
Device 15df
04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15e0
04:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15e1
04:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Device 15e3
05:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA 
Controller [AHCI mode] (rev 61)

通过命令可以看到xrandr --listdevices两张卡都被识别了

Providers: number : 2
Provider 0: id: 0x7a cap: 0xf, Source Output, Sink Output, Source 
Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 
name:modesetting
Provider 1: id: 0x44 cap: 0x5, Source Output, Source Offload crtcs: 5 
outputs: 0 associated providers: 1 name:modesetting

但是,当使用独立 GPU 运行应用程序时,性能会变慢。一个例子正在运行

DRI_PRIME=0 glmark2

那一个使用集成 GPU,我获得了大约 2000 fps 的性能,但运行:

DRI_PRIME=1 glmark2

给我的性能约为 500 fps,但事实并非如此,因为它是独立 GPU。

这可以通过以下输出来确认:

$ DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD RAVEN (DRM 3.26.0 / 4.18.7- 
200.fc28.x86_64, LLVM 6.0.1)
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon (TM) RX Graphics (POLARIS11 / DRM 
3.26.0 / 4.18.7-200.fc28.x86_64, LLVM 6.0.1)

我还附上了命令的输出dmesg | grep amdgpu

[    2.967193] [drm] amdgpu kernel modesetting enabled.
[    2.983335] amdgpu 0000:01:00.0: enabling device (0002 -> 0003)
[    3.049189] amdgpu 0000:01:00.0: VRAM: 4096M 0x000000F400000000 - 
0x000000F4FFFFFFFF (4096M used)
[    3.049190] amdgpu 0000:01:00.0: GTT: 256M 0x0000000000000000 - 
 0x000000000FFFFFFF
 [    3.049332] [drm] amdgpu: 4096M of VRAM memory ready
 [    3.049333] [drm] amdgpu: 4096M of GTT memory ready.
 [    3.140025] [drm:dc_create [amdgpu]] *ERROR* DC: Number of 
 connectors is zero!
 [    3.277785] [drm] Initialized amdgpu 3.26.0 20150101 for 
 0000:01:00.0 on minor 0
 [    3.278060] fb: switching to amdgpudrmfb from EFI VGA
 [    3.278487] amdgpu 0000:04:00.0: VRAM: 1024M 0x000000F400000000 - 
 0x000000F43FFFFFFF (1024M used)
 [    3.278489] amdgpu 0000:04:00.0: GTT: 1024M 0x000000F500000000 - 
 0x000000F53FFFFFFF
 [    3.278533] [drm] amdgpu: 1024M of VRAM memory ready
 [    3.278534] [drm] amdgpu: 3072M of GTT memory ready.
 [    3.468197] amdgpu: [powerplay] dpm has been enabled
 [    3.468480] [drm:construct [amdgpu]] *ERROR* construct: Invalid 
 Connector ObjectID from Adapter Service for connector index:2! type 0 
 expected 3
 [    3.468545] [drm:construct [amdgpu]] *ERROR* construct: Invalid 
 Connector ObjectID from Adapter Service for connector index:3! type 0 
 expected 3
 [    3.525127] fbcon: amdgpudrmfb (fb0) is primary device
 [    3.566614] amdgpu 0000:04:00.0: fb0: amdgpudrmfb frame buffer 
 device
 [    3.572124] amdgpu 0000:04:00.0: ring 0(gfx) uses VM inv eng 4 on 
 hub 0
 [    3.572125] amdgpu 0000:04:00.0: ring 1(comp_1.0.0) uses VM inv 
 eng 5 on hub 0
 [    3.572127] amdgpu 0000:04:00.0: ring 2(comp_1.1.0) uses VM inv 
 eng 6 on hub 0
 [    3.572128] amdgpu 0000:04:00.0: ring 3(comp_1.2.0) uses VM inv 
 eng 7 on hub 0
 [    3.572129] amdgpu 0000:04:00.0: ring 4(comp_1.3.0) uses VM inv 
 eng 8 on hub 0
 [    3.572131] amdgpu 0000:04:00.0: ring 5(comp_1.0.1) uses VM inv 
 eng 9 on hub 0
 [    3.572132] amdgpu 0000:04:00.0: ring 6(comp_1.1.1) uses VM inv 
 eng 10 on hub 0
 [    3.572133] amdgpu 0000:04:00.0: ring 7(comp_1.2.1) uses VM inv 
 eng 11 on hub 0
 [    3.572134] amdgpu 0000:04:00.0: ring 8(comp_1.3.1) uses VM inv 
 eng 12 on hub 0
 [    3.572136] amdgpu 0000:04:00.0: ring 9(kiq_2.1.0) uses VM inv eng 
 13 on hub 0
 [    3.572137] amdgpu 0000:04:00.0: ring 10(sdma0) uses VM inv eng 4 
 on hub 1
 [    3.572138] amdgpu 0000:04:00.0: ring 11(vcn_dec) uses VM inv eng 5 on hub 1
 [    3.572140] amdgpu 0000:04:00.0: ring 12(vcn_enc0) uses VM inv eng 6 on 
hub 1
 [    3.572141] amdgpu 0000:04:00.0: ring 13(vcn_enc1) uses VM inv eng 7 on 
hub 1
[    3.579107] [drm] Initialized amdgpu 3.26.0 20150101 for 0000:04:00.0 
on minor 1
[    5.202665] audit: type=1130 audit(1537458205.475:67): pid=1 uid=0 
auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 
msg='unit=systemd-backlight@backlight:amdgpu_bl1 comm="systemd" 
exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   15.013231] amdgpu 0000:01:00.0: GPU pci config reset
[   19.678936] amdgpu: [powerplay] dpm has been enabled
[   26.341565] amdgpu 0000:01:00.0: GPU pci config reset
[   59.533544] amdgpu: [powerplay] dpm has been enabled
[   65.786402] amdgpu 0000:01:00.0: GPU pci config reset
[  167.130594] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 
1us * 10 tries - optc1_lock line:628
[  167.130677] WARNING: CPU: 3 PID: 1899 at 
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:254 
generic_reg_wait+0xe7/0x160 [amdgpu]
[  167.130704]  snd_hda_codec irqbypass videobuf2_memops crct10dif_pclmul 
btusb videobuf2_v4l2 snd_hda_core btrtl crc32_pclmul btbcm 
videobuf2_common btintel ath snd_hwdep bluetooth snd_seq videodev 
ghash_clmulni_intel snd_seq_device cfg80211 joydev snd_pcm media 
ecdh_generic sp5100_tco snd_timer k10temp i2c_piix4 rtsx_pci_ms rfkill 
snd 
memstick soundcore wmi video pinctrl_amd acer_wireless pcc_cpufreq 
acpi_cpufreq amdkfd amd_iommu_v2 amdgpu chash i2c_algo_bit gpu_sched 
drm_kms_helper rtsx_pci_sdmmc mmc_core ttm crc32c_intel serio_raw drm 
r8169 rtsx_pci mii i2c_hid
[  167.130774] RIP: 0010:generic_reg_wait+0xe7/0x160 [amdgpu]
[  167.130850]  optc1_lock+0xa0/0xb0 [amdgpu]
[  167.130897]  dcn10_pipe_control_lock.part.28+0x4a/0x70 [amdgpu]
[  167.130944]  dcn10_apply_ctx_for_surface+0xee/0x1210 [amdgpu]
[  167.130994]  ? hubbub1_verify_allow_pstate_change_high+0xdd/0x180 
[amdgpu]
[  167.131040]  ? dcn10_verify_allow_pstate_change_high+0x1d/0x240 
[amdgpu]
[  167.131085]  ? dcn10_set_bandwidth+0x275/0x2d0 [amdgpu]
[  167.131129]  dc_commit_state+0x269/0x580 [amdgpu]
[  167.131171]  ? set_freesync_on_streams.part.6+0x4d/0x250 [amdgpu]
[  167.131213]  ? mod_freesync_set_user_enable+0x11f/0x150 [amdgpu]
[  167.131260]  amdgpu_dm_atomic_commit_tail+0x37c/0xd70 [amdgpu]
[  167.131298]  ? amdgpu_bo_pin_restricted+0xd6/0x300 [amdgpu]
[  167.131441]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
[  167.493997] [drm:hwss_edp_wait_for_hpd_ready [amdgpu]] *ERROR* 
hwss_edp_wait_for_hpd_ready: wait timed out!
[  992.949753] amdgpu: [powerplay] dpm has been enabled
[  999.815690] amdgpu 0000:01:00.0: GPU pci config reset
[ 1097.603835] amdgpu: [powerplay] dpm has been enabled
[ 1105.675220] amdgpu 0000:01:00.0: GPU pci config reset
[ 1138.629401] amdgpu: [powerplay] dpm has been enabled
[ 1157.490886] amdgpu 0000:01:00.0: GPU pci config reset
[ 1167.629670] amdgpu: [powerplay] dpm has been enabled
[ 1188.641935] amdgpu 0000:01:00.0: GPU pci config reset
[ 1237.003085] amdgpu: [powerplay] dpm has been enabled
[ 1243.811986] amdgpu 0000:01:00.0: GPU pci config reset
[ 1287.684082] amdgpu: [powerplay] dpm has been enabled
[ 1332.291087] amdgpu 0000:01:00.0: GPU pci config reset
[ 1511.066683] amdgpu: [powerplay] dpm has been enabled
[ 1520.167710] amdgpu 0000:01:00.0: GPU pci config reset
[ 1605.023196] amdgpu: [powerplay] dpm has been enabled
[ 1611.134239] amdgpu 0000:01:00.0: GPU pci config reset
[ 1930.739920] amdgpu: [powerplay] dpm has been enabled
[ 2105.711880] amdgpu 0000:01:00.0: GPU pci config reset
[ 2440.536121] amdgpu: [powerplay] dpm has been enabled
[ 2447.470108] amdgpu 0000:01:00.0: GPU pci config reset
[ 2453.329765] amdgpu: [powerplay] dpm has been enabled
[ 2489.324912] amdgpu 0000:01:00.0: GPU pci config reset
[ 3732.604342] amdgpu: [powerplay] dpm has been enabled
[ 3744.199117] amdgpu 0000:01:00.0: GPU pci config reset
[ 3747.717927] amdgpu: [powerplay] dpm has been enabled
[ 3900.960469] amdgpu 0000:01:00.0: GPU pci config reset
[ 4876.333471] amdgpu: [powerplay] dpm has been enabled
[ 4883.356467] amdgpu 0000:01:00.0: GPU pci config reset
[ 5597.531838] amdgpu: [powerplay] dpm has been enabled
[ 5604.423794] amdgpu 0000:01:00.0: GPU pci config reset
[ 5606.860546] amdgpu: [powerplay] dpm has been enabled
[ 5613.824859] amdgpu 0000:01:00.0: GPU pci config reset
[ 5619.323471] amdgpu: [powerplay] dpm has been enabled
[ 5625.588060] amdgpu 0000:01:00.0: GPU pci config reset

任何有关此问题的帮助将不胜感激!

编辑:在任何具有 5.0 及以上内核版本的新发行版中,它都可以正常工作,但需要进行一些调整。

例如,如果我想启动 DOOM 2016 并使用 rx560x 卡,我需要通过以下方式从控制台启动 Steam:

DRI_PRIME=1 steam

DRI_PRIME=1命令告诉 steam 使用独立 GPU,因此当我运行 DOOM 时它会使用它!

答案1

我在 Arch Linux 上也遇到了与您相同的问题(mesa-git、llvm-svn、linux 4.18.12(甚至运行 4.19.x 或主线 4.20rcx))。我想说,稳定的 Linux 内核还没有针对我们的 GPU 进行优化。幸运的是,有一个临时解决方案。我试过linux-amd-wip-gitdrm-next-4.21-wip)它有最新的 amd 补丁(还有其他内核有它们,比如linux-drm-修复-gitdrm 修复),取决于你的选择)。正如您所说,许多游戏在稳定内核上无法玩,并且大多数游戏在集成 GPU 上运行得比在独立 GPU 上运行得更好。 linux-amd-wip-git 使离散 GPU 的性能优于集成 GPU,我还通过 wine 和 gallium nine/dxvk 在《魔兽世界》中获得了约 30 fps 的增益。有些游戏的表现甚至更好,我尝试过的每一款游戏都表现得更好。我们只需要等待这些补丁合并到稳定的 Linux 中即可。最后,至少我们知道它会被修复。

编辑:我刚刚测试了最新的 5.0rc7,它的工作原理与上述内核类似。看来5.0会修复这个问题

答案2

@Haxk20,这些我还没有测试过,但我已经测试过,每个都按其应有的方式运行,至少是我期望它们如何运行。这些都是通过 Wine 通过 Gallium 9 和 DXVK 实现的,对我来说,它们在 RX560X 上的表现总是比在 Vega 8 上更好(在原生 Linux 游戏中,我只测试了 CS:GO,它在 RX560X 上的表现也更好)。可能是 Windows 性能的 70-80%。 《Skyrim》可能不像 Windows 上那样运行得那么好,但我认为这是可以理解的,因为它不是原生 Linux 游戏。另外,奇怪的是 glxgears,因为它对我来说与游戏中的情况不同。我得到的结果和你一样,可以确认。虽然还是有一些问题,但至少,随着更新,它正在变得更好。

答案3

我尝试了发送到主线内核存储库甚至 linux-amd-wip-git 的 Linux 4.21 补丁,但遗憾的是,我的 VEGA 8 仍然比 RX560X 表现更好。与您拥有的同一台笔记本电脑,Terraria 在 VEGA 8 上运行得比 RX560X 在 4.21 上运行得好得多,在 linux-amd-wip-git 上也是如此。 RX560X 应该以最大 60 fps 的速度运行《Skyrim》,但即使在 linux-amd-wip-git 上我也无法在 Ultra 上玩,我必须以高速运行它,但仍然无法达到 60 fps。

glxgears 报告称,VEGA8 的帧速率约为 7000 fps,RX560X 的帧速率约为 3500 fps。

@Martin Otto rx560x 确实在更密集的游戏中表现得更好,但那些不难运行的游戏在 vega8 上运行得更好,而且实际上运行得更好。但我认为这是由于单通道 RAM

相关内容