[Feature request] Better performance on eGPUs
System information
Asus TUF F15 FX516PM
- GPU: ASRock AMD Radeon RX 7800 XT 16GB
- Driver: Mesa RADV 23.3-oibaf PPA
- Wine version: 8.16
- DXVK version: 2.3
- eGPU: Razer Core X
- Distribution and kernels: Ubuntu 23.04 23.10, Arch Linux, Linux-Next kernel
Vulkan Drivers tested
- AMDVLK
- Mesa RADV
- AMDGPU PRO
Workarounds tested
RADV_PERFTEST=dmashaders RADV_PERFTEST=nosam DXVK_ASYNC=1 (no changes)
Summary
Its pretty much known for a fact eGPUs on Linux are a total nightmare, especially with newer cards, looks like it was not noticeable enough on older ones like the RX 550 I also tested with an NVIDIA card (RTX 3060) and the issues are pretty much the same.
The most noticeable thing about this, other than the really bad fps and low GPU usage, is the single core CPU usage spiking at 100% (not always the same core) when DXVK is used.
However, I'm sure DXVK on Windows with the same setup doesn't seem to affect performance that much in such games.
Slightly OT, there is something fishy also on vulkan only games as well as they seem to have performance issues even when DXVK is not used (ex. Baldurs Gate 3 on VK, performs decently on Windows even with the eGPU, or the integrated discrete NVIDIA even on Linux ) so I am tracking this issue even on mesa and the kernel driver where it has to be confirmed there may be some problems regarding the actual pcie speed detection, at least for AMD cards However, its not always the case since some games perform good as Windows, taking for example DOOM Eternal, which works very very nicely.
I must also say making the eGPU running at apparently full PCIe 3.0 4x speed, a kernel parameter must be added options amdgpu pcie_gen_cap=0x40000
Forcing the limit to 1.0 x4 speeds doesn't seem to change that much in my case.
In the following
Comparison of Cyberpunk 2077 between forcing PCIe 1.0 4x speeds vs. 3.0 4x
https://gitlab.freedesktop.org/mesa/mesa/uploads/a431d19be845fd639f7a5989578e2aa0/immagine.png
Using an OpenCL Benchmarking tool, I have apparently confirmed at least with compute workloads, the PCIe bandwidth is correct and changes accordingly to that kernel parameter.
Speaking back to Linux, the issue is very much present in the case even on older games like Half-Life 2, Far Cry 5, Killing Floor 2 No matter the distribution, kernel, mesa drivers, dxvk version, etc...
The only thing that helped was using WINED3D instead of DXVK when OpenGL was used. WineD3D Vulkan backend has the same impact.
Software information
Half Life 2: No more than 130-140~ fps, even on low settings, low resolution, without frame limiter Killing Floor 2: 35 fps when things are busy on screen, even on low resolution, low settings Far Cry 5: 40 fps, even on low resolution and low settings. Cyberpunk 2077: builtin benchmark does not' show more than 39-40 fps, no matter the video settings.
Ramping up the setting on such games, do not change the results at all. CPU usage was also overall higher even on Vulkan Only games.
Apitrace file(s)
Just in case I made one for HL2, but doesn't make sense to post it.
Source: doitsujin/dxvk