I get less framerate on Vulkan than OpenGL4 with NVIDIA hardware and drivers

I’ve been developing in UE4/C++ on Funtoo (a variant of Gentoo Linux) using OpenGL 4 without any issues for a few years. On the Minimal_Default map I always get 120 FPS even on lower spec graphics cards with -opengl4. Since 4.21 switched to Vulkan as the default graphics API I decided to give it a shot. When I run the engine with Vulkan I’ll get 75 FPS on the Minimal_Default map which is a bit unexpected.

Is this because Vulkan layer in UE4 not optimized or it’s happening due to something else?

As a side note, I am running UE4 under X/i3wm/Compton, nvidia drivers version 415.25, vulkan loader version 1.1.77.0, and vulkan headers version 1.1.82.0.

OK! for anyone coming across this issue: I solved the issue by adding NVPTX to LLVM_TARGETS Extended USE flag inside /etc/portage/make.conf.

On my previous installation, I had this Extended USE flag enabled. But, I thought it was unnecessary. OK, what does it do?

It is being used by Mesa for I guess building shaders or something like that, though I am not sure what’s the exact usage; so I had to:

Change:

 LLVM_TARGETS="BPF X86"

To:

LLVM_TARGETS="BPF NVPTX X86"

And:

 $ emerge -a --oneshot `equery depends llvm|awk '{print " ="$1}'`

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/llvm-7.0.0-r1 
[ebuild   R    ] sys-devel/llvmgold-7 
[ebuild   R    ] sys-libs/libcxxabi-7.0.0 
[ebuild   R    ] sys-devel/lld-7.0.0 
[ebuild   R    ] sys-libs/libcxx-7.0.0 
[ebuild   R    ] sys-devel/clang-7.0.0 
[ebuild   R    ] media-libs/mesa-18.2.4 
[ebuild   R    ] sys-libs/compiler-rt-7.0.0 
[ebuild   R    ] dev-util/lldb-7.0.0 
[ebuild   R    ] sys-libs/compiler-rt-sanitizers-7.0.0 
[ebuild   R    ] www-client/firefox-64.0 

Would you like to merge these packages? [Yes/No] 

Did a reboot and now I’m getting 120 FPS on -vulkan :slight_smile: