RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

Vulkan has been broken with the Flycast core since version 1.19.0

Open PoloniumRain opened this issue 1 year ago • 24 comments

Description

When using Vulkan with the Flycast core, there is significant graphical corruption in all Dreamcast games in the form of many small flickering blocks, as shown in the videos below. At first i thought this was a Flycast problem so i posted about it on the Flycast GitHub. But after much more testing i've now narrowed this issue down to a change that was introduce with RA version 1.19.0, and it still persists in version 1.19.1. All older versions like 1.17 do not have this problem, at least going back to 1.14, which is the oldest that i've tested.

Some things of note:

  • I can't test the latest RA nightly (7th August) because it crashes immediately after running any game with Flycast + Vulkan.
  • The graphics corruption happens with several Nvidia driver versions, going back ~7 months (haven't tried any older than this).
  • The standalone Flycast emulator works completely fine with Vulkan.
  • Default settings were used for RA and the Flycast core.
  • I don't have anything running in the background that could be causing this.
  • It's not just games, corruption also happens on the Dreamcast menu that appears when a disc isn't inserted in the console.
  • The type of graphical corruption looks similar to when VRAM on a graphics card has been overclocked too high. So i must stress that my card isn't overclocked and i've done many stress tests to make sure it's not a GPU related problem.

Steps to reproduce the bug

  1. Set the video driver in RetroArch to Vulkan
  2. Go to Online Updater > Core Downloader and get the latest Flycast core
  3. Run any DC game and you should now see the same issue as shown in the videos below.

Version/Commit

RetroArch stable 1.19.0 and 1.19.1 are both affected.

Environment information

  • Windows 11 version 23H2
  • RTX 3080 with several different Nvidia drivers
  • 4K desktop resolution @ 120Hz refresh

https://github.com/user-attachments/assets/6939e144-5cd7-45d6-a77d-e3ee96b9e287

https://github.com/user-attachments/assets/866d1c79-c77f-41af-b80d-cd1bd714d51c

https://github.com/user-attachments/assets/da6b4ccd-6d17-43ca-9350-3cbbb2485e17

PoloniumRain avatar Sep 07 '24 14:09 PoloniumRain

These seem to be the only major changes made to the Vulkan code in 1.19.0 -

VIDEO/VULKAN: Add support for A2R10G10B10 HDR format VIDEO/VULKAN: Implement HDR readback - screenshot support

Do you have HDR support enabled in RetroArch? Can you try disabling it in RetroArch and then seeing what happens?

LibretroAdmin avatar Sep 07 '24 14:09 LibretroAdmin

No such issues here with fresh versions, and also no HDR. Windows 10, GTX 970 + 536.23.

sonninnos avatar Sep 07 '24 14:09 sonninnos

I do have an HDR display but i don't have HDR enabled in both Windows and RetroArch. All the RA versions i've tested with have used default settings, so HDR was disabled (i just doubled checked to make sure).

PoloniumRain avatar Sep 07 '24 14:09 PoloniumRain

@sonninnos List your Nvidia driver version and OS.

@PoloniumRain Same as well. Also maybe post your retroarch.cfg file. Maybe you have some setting/feature enabled which is causing this.

LibretroAdmin avatar Sep 07 '24 14:09 LibretroAdmin

Windows 11 version 23H2, OS build 22631.3447 Nvidia 560.94 drivers.

But as mentioned, i've also tried several older Nvidia drivers. I don't remember what versions, but they were all released within the past 7-ish months.

Here's the config files for 1.19.0 (corruption) and also the config for 1.17 (working fine), which are both clean installs so they should be using default settings: config.zip

PoloniumRain avatar Sep 07 '24 14:09 PoloniumRain

Yep same issue here. I found per-pixel helps but doesn't solve the issue. Crazy Taxi is almost unplayable because it fills the screen. Funny thing is Naomi 2 works fine as well as Dreamcast. It's a Vulkin issue. Switching to Open GL fixes the problem.

Boomerps2 avatar Sep 09 '24 16:09 Boomerps2

@Boomerps2 What OS and GPU drivers are you using? For me everything has it - DC, Naomi and Naomi 2. The cores Per-pixel option can reduce the problem in a game area or menu screen, but then in another area or menu it can make it worse. Enabling/disabling RA shaders also has the same effect... Weird.

PoloniumRain avatar Sep 09 '24 17:09 PoloniumRain

I can't reproduce it here unfortunately.

LibretroAdmin avatar Sep 09 '24 18:09 LibretroAdmin

Window 11 with latest Nvidia drivers with the latest Retroarch 1.19

Yahoo Mail: Search, Organize, Conquer

On Mon, Sep 9, 2024 at 10:10 AM, @.***> wrote:

@Boomerps2 What OS and GPU drivers are you using? For me everything has it - DC, Naomi and Naomi 2. The cores Per-pixel option can reduce the problem in a game area or menu screen, but then in another area or menu it can make it worse. Enabling/disabling RA shaders also has the same effect... Weird.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Boomerps2 avatar Sep 09 '24 22:09 Boomerps2

@flyinghead can't seem to reproduce it either.

LibretroAdmin avatar Sep 10 '24 01:09 LibretroAdmin

@PoloniumRain May you provide some log also ? Thank you.

gouchi avatar Sep 10 '24 09:09 gouchi

@gouchi log.zip

Btw the latest nightly is no longer crashing with Vulkan, but it still has this problem.

PoloniumRain avatar Sep 10 '24 12:09 PoloniumRain

I can't reproduce the issue with latest, and also no HDR. Windows 10, GTX 1060 and Nvidia driver version 560.94.

gouchi avatar Sep 10 '24 17:09 gouchi

Maybe you can try this pr based build https://github.com/libretro/RetroArch/pull/16984

Maybe it's because the RA vulkan head version is too old, and Flycast updated the vulkan version sdk to 1.3.261 last year https://github.com/flyinghead/flycast/commit/10b13dfe9c9b4dcbb421c210704603c9c2a100c8

crashGG avatar Sep 12 '24 09:09 crashGG

@crashGG Sadly that didn't help.

I tried copying the working 1.17 retroarch.exe into a 1.19.0 folder, so that it's using retroarch.cfg from 1.19.0 and all the other associated files, and the 1.17 .exe still works fine without any problems. Then i did the same with a nightly build, and the 1.17 .exe also works there.

Is it possible to download nightly builds between 1.17 - 1.19.0? I can't find any that old on https://buildbot.libretro.com/nightly

But then i could narrow down this problem to an exact date.

PoloniumRain avatar Sep 12 '24 10:09 PoloniumRain

RA_vulkan13.zip try this build ,copy it to nighty RA build folder

crashGG avatar Sep 12 '24 10:09 crashGG

Still has the same problem.

PoloniumRain avatar Sep 12 '24 12:09 PoloniumRain

Can reproduce this.

Fresh Win 11 23H2 Build 22631.4169 RTX 3070 with 32.0.15.6109 Ryzen5 1600AF RA 1.19.1 Flycast Core 915532f Connected to LG OLED CX 65" 4k@120Hz GSYNC

BUT when activating shaders the issue is gone!

Screenshot 2024-09-21 025341 Screenshot 2024-09-21 025731

faxesystem avatar Sep 21 '24 01:09 faxesystem

@PoloniumRain @faxesystem So this issue only happens in Windows 11 with Nvidia ? If it is the case, the issue title should be renamed with this information. Thank you.

gouchi avatar Sep 23 '24 18:09 gouchi

I use the Vulkan renderer and I am also having issues trying to run games under the Flycast core on the latest versions of RetroArch, and I am actually using the 64-bit version already. I've been getting the following error: Exception Processing Message 0xc0000005 - Unexpected parameters. The error disappears and the game launches if I have my renderer set to something other than Vulkan, but Vulkan is the only one that doesn't mess with my Windows HDR mode.

JomSpoons avatar Oct 13 '24 16:10 JomSpoons

Hi, exactly the same as above.

jeremy27041980 avatar Oct 14 '24 17:10 jeremy27041980

I can confirm that this is happening to me as well with Vulkan. I have resorted to just setting a core override to switch the driver to "glcore" and it works fine that way. I remember a while back with Flycast that Vulkan performed better with some blur or framebuffer effects with Flycast than glcore. I have not noticed any issues so far with performance. This is likely due to my system being more powerful than back then or also updaters to Flycast that may have resolved that issue.

For now I will have to just resort to the core override for the display driver to glcore to fix the issue until it is resolved.

efrainm23 avatar Feb 16 '25 00:02 efrainm23

Issue declared upstream.

gouchi avatar Feb 17 '25 17:02 gouchi

Enabling "Threaded Video" works, may be considered a temporary workaround.

MedAdh42 avatar Jun 20 '25 21:06 MedAdh42

Bisected to fed2e10d9712d6e2082c99420fe0b7b483379c1a, no black squares with the previous commit (ae84c590de01561ece9c1e9cbcdfdf9f3cd16bf9):

https://github.com/user-attachments/assets/4119bc0d-926e-476a-a764-df5137567f4c

Windows 11 / RTX 3060 Ti

bslenul avatar Sep 06 '25 09:09 bslenul

Should be fixed ~~on Flycast dev branch, not yet available on the Online Updater but if anyone wants to try: flycast_libretro.zip~~

Works great for me! 👍

edit: It is now available from the Online Updater.

bslenul avatar Oct 12 '25 12:10 bslenul