ec- / Quake3e

Improved Quake III Arena engine
GNU General Public License v2.0
1.15k stars 148 forks source link

Linux: abnormally high GPU usage on Vulkan with r_fbo 1 #257

Open Aciz opened 6 months ago

Aciz commented 6 months ago

When running with Vulkan renderer, specifically on Linux (Windows seems to work fine), effects that require r_fbo 1 seem to cause abnormally high GPU load. OpenGL renderer can achieve same FPS with much less GPU usage, and when running timedemos, the performance on Vulkan is significantly worse. I am running with GTX 1080 Ti, I don't unfortunately know anyone with AMD GPU who runs Linux to verify if they experience the same issue. @ensiform confirmed he experiences this as well, though he's on Nvidia GPU as well.

Notable settings in these comparisons:

r_fbo "1"
r_ext_multisample "4"
r_hdr "1"
r_vbo "1"

Vulkan: image

OpenGL: image

I went back to the earliest version available on releases (2021-03-28), and the issue persisted there too. When turning off FBO, Vulkan performs better compared to OpenGL, as one might expect.

ec- commented 6 months ago

Try to disable r_ext_multisample or r_hdr to see what option actually causes significant performance drop

Aciz commented 6 months ago

Try to disable r_ext_multisample or r_hdr to see what option actually causes significant performance drop

r_ext_multisample is definitely heavier. But that's not the point I'm making here, neither of these cvars cause as much load on OpenGL as they do on Vulkan, resulting in lower performance overall on Vulkan compared to OpenGL.

r_ext_multisample 0
r_hdr 0

~27% usage, 70W power
r_ext_multisample 4
r_hdr 0

~38% usage, 115W power
r_ext_multisample 0
r_hdr 1

~31% usage, 75W power
r_ext_multisample 4
r_hdr 1

~55% usage, 125W power

Timedemoing four.dm_68, both with r_ext_multisample 4 and r_hdr 1 Vulkan: 1260 frames, 2.56 seconds: 491.8 fps OpenGL: 1260 frames, 0.93 seconds: 1357.8 fps

Aciz commented 6 months ago

Timedemoing four.dm_68, both with r_ext_multisample 4 and r_hdr 1 Vulkan: 1260 frames, 2.56 seconds: 491.8 fps OpenGL: 1260 frames, 0.93 seconds: 1357.8 fps

And for reference, same system but on Windows: Vulkan: 1260 frames, 0.91 seconds: 1384.6 fps OpenGL: 1260 frames, 1.12 seconds: 1127.0 fps

ec- commented 6 months ago

Well, there is no platform-specific code in Vulkan/OpenGL renderers so it all depends from driver optimizations for a specific platform

Aciz commented 6 months ago

Well, there is no platform-specific code in Vulkan/OpenGL renderers so it all depends from driver optimizations for a specific platform

Right, so this issue is likely in Nvidia linux vulkan drivers then. Would be nice to have someone with AMD or Intel to do a similar test, just to confirm.