runemu: set VK_ICD_FILENAMES to match active GPU driver#2378
runemu: set VK_ICD_FILENAMES to match active GPU driver#2378aenertia wants to merge 1 commit intoROCKNIX:nextfrom
Conversation
On devices with both Mali and Panfrost Vulkan ICDs installed (RK3566, RK3326), the Vulkan loader enumerates both but only one has a working kernel driver at any time. Emulators attempting Vulkan initialization fail silently and fall back to OpenGL. Set VK_ICD_FILENAMES in runemu.sh based on the active GPU driver reported by gpudriver. This is inherited by all emulator subprocesses and fixes Vulkan for PPSSPP, Dolphin, AetherSX2, Duckstation, Flycast, RetroArch Vulkan cores, and all other Vulkan-capable emulators without requiring per-emulator launch script changes.
|
I understand this doesn't affect systems like H700, or are they affected in any way? |
No ICD's so not affected. If at some point a working implementation of mali_kbase appears for them with a working vulkan icd. And therefore a gpudriver bin likewise; then this would 'just work' for them likewise. Currently this is only really rk3566 useful ; although rk3588 may benefit eventually too. |
S922X too, if we installed the panvk lib and ICD: |
Oh cool is that something that you are looking into ? |
I've played with it a little, but panvk doesn't really run anything much G52. Edit: not a surprise, given low version compatibility and non-conformance: https://docs.mesa3d.org/drivers/panfrost.html |
|
Do you mean that PanVK is broken in the current setup? Libmali vulkan seems to work fine for me |
|
It depends on the emu/core - some find the ICD just fine by themselves this is really just setting an environment hint. The same issue exists on desktop OS's with multiple ICD profiles which is why I've hit it before. It's best to set the ICD environment on a per-run basis IME as there are time where you might want to point it elsewhere for a specific app. This seems like the right place for handling that. |
|
We shouldn't pollute runemu, it seems to me that this might as well can be in gpudriver, app related hacks can be put in their respected start scripts |
|
Ok; I guess the consideration is really about standardizing how VK_ICD_FILENAMES get's set in the environment more generally. Putting some logic to gpudriver to check/set it in the general environment makes sense for systems with it. But I wonder for the more general/future proofing case where you might have multiple ICD's for a system without gpudriver this is the right approach? |
|
Does any non-gpudriver platform have to set this at moment? Is it no being set causing any issues? |
|
Not on rocknix but in general yes ; not having this set basically means you have non-deterministic behavior per emu/core/app into how they decide what to use. I'd have to look through the sm8250 tree to check if it gets explicit set by the build somewhere. Generally if there is just one ICD it's fine; but some processes will just flat up decide if there isn't an ICD then it's opengl time. |
|
No issues with vulkan on non- Agree that the |
|
Maybe add a file to That is consistent with the way we set other env vars. |
Until someone tries to EGPU their handheld ... considering the prevalence of this in the x86_64 handheld space i'm surprised at the lack of community attempts at this so far. ;) |
|
Ok I think this is enough to revise this - will do a push on this shortly. |
On devices with both Mali and Panfrost Vulkan ICDs installed (RK3566, RK3326), the Vulkan loader enumerates both but only one has a working kernel driver at any time. Emulators attempting Vulkan initialization fail silently and fall back to OpenGL.
Set VK_ICD_FILENAMES in runemu.sh based on the active GPU driver reported by gpudriver. This is inherited by all emulator subprocesses and fixes Vulkan for PPSSPP, Dolphin, AetherSX2, Duckstation, Flycast, RetroArch Vulkan cores, and all other Vulkan-capable emulators without requiring per-emulator launch script changes.