Add Vulkan Support to RetroPie for Pi 4?
-
@bluestang said in Add Vulkan Support to RetroPie for Pi 4?:
I was thinking about submitting my specific issue to Mesa with the caveat that I don't get the same graphical glitches using the Vulkan driver or just provide more info to the existing issue.
it is already confirmed as not happening in the vulkan (v3dv) driver: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3758#note_701947
I already have an issue opened on Mesa with lr-flycast using the Vulkan driver.
you may want to try and get a backtrace with a debug build of flycast.
DEBUG=1
buildflag, typically. that should make the trace a bit more useful. -
@dankcushions said in Add Vulkan Support to RetroPie for Pi 4?:
it is already confirmed as not happening in the vulkan (v3dv) driver: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3758#note_701947
I added some screenshots to the issue thread for visual references.
you may want to try and get a backtrace with a debug build of flycast.
DEBUG=1
buildflag, typically. that should make the trace a bit more useful.Thanks for the tip! I updated my issue with the new backtrace report. Seems like the issue appears to be in the GetPhysicalDeviceProperties2 struct returning a bunch of zeros where it should be returning the device limits in v3dv_device.c
-
@dankcushions
I finally got lr-flycast working on the Pi4 Vulkan driver. The debug tips from you and Alejandro were extremely helpful.- Comment out lines 184-193 in vulkan_context.cpp and it should work now.
- I did see performance gains in Vulkan vs GLES but I would like to see more feedback on this. I only tested a few games.
-
@bluestang nice work! i guess the issue is if that the line being commented out is important for flycast, as is presumably the case, but I guess flycast upstream would be able to confirm.
-
@bluestang I've recompiled mesa using latest trunk , i've recompiled retroarch master with vulkan and flycast with that workaround, but every game i've tried crashes always in this way:
what am i missing ?
-
@myzar You forgot to include the drivers for the RPI GPU, your Vulkan implementation is software only:
WARNING: lavapipe is not a conformant vulkan implementation, testing use only. [INFO] [Vulkan]: Found GPU at index 0: llvmpipe (LLVM 7.0.1, 128 bits) [INFO] [Vulkan]: Found GPU at index 1: V3D 4.2
-
@myzar build the v3dv driver with following:
meson --prefix /usr -Dplatforms=x11 -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=kmsro,v3d,vc4 -Dbuildtype=release build ninja -C build -j4 sudo ninja -C build install
There is a patch in the works to get the necessary extensions working to make lr-flycast work without changing the current source.
I will update this thread when it’s merged.
-
@bluestang wait do you need x running or xinit ? it works for me if i start retroarch from x
it doesn't from framebuffer , i seem to understand that it should now using mesa master.
I've tried my two favorite games doa2 and soul calibur , no gfx glitches but both run alot slower for sure
my mesa build options https://pastebin.com/0aM0Dwvf
-
@myzar said in Add Vulkan Support to RetroPie for Pi 4?:
@bluestang wait do you need x running or xinit ? it works for me if i start retroarch from x
it doesn't from framebuffer , i seem to understand that it should now using mesa master.
I've tried my two favorite games doa2 and soul calibur , no gfx glitches but both run alot slower for sure
my mesa build options https://pastebin.com/0aM0Dwvfs far
Yes build from Mesa “master” - https://gitlab.freedesktop.org/mesa/mesa
It can be run from X11 or without. My tests have been without X11 thus far.
I’m not sure what your build settings are but your build is using the software driver
llvmpipe
so something is not right. The Vulkan driver has quite a few dependencies prior to building and install.You need satisfy those dependencies and relook at your build settings.
-
@bluestang sorry for having wasted your time , i had some leftover of an old vulkan pkg and it was using that not the new one, purged and removed it and wow flycast is indeed faster , i'm testing daytona and i can see the difference
-
@myzar are you comparing performance against the older packaged mesa driver? There are performance improvements with GLES in the latest mesa drivers so you should check with that also.
-
@buzz i'm switching live between the gles and vulkan driver with the fps counter enabled , in daytona is 6/7 fps higher and never dips below 30fps like the gles does, overall is a better experience. Yeah the gles driver is faster than it used to be for sure, daytona used to run like crap. Now it's okish with the gles driver and verygood with vulkan
-
@myzar sounds good.
-
@myzar I'm glad you got it sorted. As development progresses, things should get better under Vulkan for the Pi 4.
-
@bluestang yeah i'm impressed that it works with flycast , it's an early not optimized driver , the future looks bright , i wonder if we can get ppsspp to work too with the same speedup
-
@bluestang do you think the dolphin emulator can be compiled in the near future to run the Vulkan driver on the Pi 4 or will depend on the dolphin developers to make it happen?
-
@rubencg said in Add Vulkan Support to RetroPie for Pi 4?:
@bluestang do you think the dolphin emulator can be compiled in the near future to run the Vulkan driver on the Pi 4 or will depend on the dolphin developers to make it happen?
Sorry for the delayed reply, but dolphin has to be compiled on 64-bit AFAIK.
The libretro one fails for me, and standalone worked but it was slow.
The Vulkan driver will help with some emulators but not all. The truth of the matter is that the limitation is in the hardware and the software can only do so much to overcome that.
-
Friends how is Flycast doing with Vulkan? My Christmas present is a pi 4 with aluminum case to run Dreamcast games so I am anxious to get my hands into it and play right away
-
@sergioad said in Add Vulkan Support to RetroPie for Pi 4?:
Friends how is Flycast doing with Vulkan? My Christmas present is a pi 4 with aluminum case to run Dreamcast games so I am anxious to get my hands into it and play right away
Flycast runs with the current RPi4 driver but it does have some quirks. There have been performance gains seen by those that have tested it out.
The Vulkan code in Libretro Flycast needs some chgs, because it mixes Vulkan 1.0 and 1.1 features but doesn’t do proper checks to sort it out, but rather makes assumptions based on extensions used in both versions of the Vulkan API. It doesn’t account for the RPi4 v3dv state where it is 1.0 conformant but also has 1.1 features but is not 1.1 conformant...yet. Other devices would be in the same boat too if their use case was the same.
For FWIW, upstream Flycast integrated the proper checks, which is checking the driver’s instance version vs extension checks. I’ve been working on this in my spare time to mirror what is being done in upstream but I don’t have any timeline as to when I will submit PR(s). The Vulkan backend was completely revamped in upstream, and it is not an easy backport for me since I’m also learning the Vulkan API too.
-
@bluestang Ok, thank you very much
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.