flycast icon indicating copy to clipboard operation
flycast copied to clipboard

RetroArch crash using Flycast libretro core with Vulkan driver

Open Aethyrion opened this issue 1 month ago • 10 comments

Platform / OS / Hardware: Retroid Flip 2 (Android)

Flycast version: 1666eb0

Description of the Issue

RetroArch instantly crashes when attempting to load the Flycast core with the Vulkan video driver, regardless of whether a game is launched.

  • The issue appeared suddenly (was working the previous day).
  • No obvious configuration changes were made.
  • The crash occurs both with and without a game loaded.

Debugging Steps Tested

Tested with RetroArch versions 1.21.0 and 1.22.2 (aarch64).

  • Reset configuration to minimal defaults, only changing the video driver to Vulkan.
  • Confirmed that the GL driver works perfectly under the same conditions.
  • Confirmed that Flycast standalone works perfectly with Vulkan driver on the same device.
  • Verified that the exact same configuration with Vulkan driver works on an Android phone using the same SoC.

Logs Gathered Unable to copy/paste full logs at this time. Crash results in: SIGSEGV invalid access

Aethyrion avatar Dec 03 '25 20:12 Aethyrion

The issue appeared suddenly (was working the previous day).

You mean nothing was updated on the device, neither RetroArch, Flycast or any OS update?

flyinghead avatar Dec 03 '25 20:12 flyinghead

Sorry, I meant that I haven’t noticed any change. I haven’t accepted any OS update. RetroArch is auto‑updated through Obtainium, which is why I tested with a previous stable version. I hadn’t updated the core initially, but I did update it afterwards in an attempt to fix the problem.

I hope the issue isn’t on my side, as I don’t want to waste your time. My testing capability is limited at the moment to just my phone and my Retroid Flip 2. I could try forcing an older core to pinpoint the issue, but I don’t recall where the buildbot cores archive is located.

Aethyrion avatar Dec 03 '25 20:12 Aethyrion

[Content] Updating firmware status for: "/data/user/0/com.retroarch.aarch64/cores/flycast_libretro_android.so" on "/storage/emulated/0/RetroArch/system". [Core] No content, starting dummy core. [Core] Unloading core... [Core] Unloading core symbols... RetroArch 1.22.2 (Git 69a4f0e) === Build ======================================= Capabilities: ASIMD [INFO] Version: 1.22.2 [INFO] Git: 69a4f0e [INFO] Built: Nov 20 2025 [INFO] ================================================= [Input] Found input driver: "android". [Core] Loading dynamic libretro core from: "/data/user/0/com.retroarch.aarch64/cores/flycast_libretro_android.so". [Override] Redirecting save file to "/storage/emulated/0/RetroArch/saves/Flycast/Flycast.srm". [Override] Redirecting save state to "/storage/emulated/0/RetroArch/states/Flycast/Flycast.state". [Environ] GET_CORE_OPTIONS_VERSION. [Environ] GET_LANGUAGE: "0". [Environ] SET_CORE_OPTIONS_V2_INTL. [Environ] SET_CONTROLLER_INFO. [Environ] SET_SUPPORT_NO_GAME: yes. [Environ] GET_LOG_INTERFACE. shell/libretro/libretro.cpp:330 N[BOOT]: retro_init [Environ] GET_PERF_INTERFACE. [Environ] SET_PIXEL_FORMAT: XRGB8888. [Environ] SET_KEYBOARD_CALLBACK. [Environ] GET_DISK_CONTROL_INTERFACE_VERSION. [Environ] SET_DISK_CONTROL_EXT_INTERFACE. core/hw/mem/addrspace.cpp:425 N[VMEM]: Info: nvmem is enabled core/hw/mem/addrspace.cpp:461 N[VMEM]: BASE 0x6ecb840000 RAM(16 MB) 0x6ed7840000 VRAM64(8 MB) 0x6ecf840000 ARAM(2 MB) 0x6eeb840000 shell/libretro/libretro.cpp:2146 N[BOOT]: retro_load_game: (no content) [Environ] GET_RUMBLE_INTERFACE. [Environ] GET_SYSTEM_DIRECTORY: "/storage/emulated/0/RetroArch/system". [Environ] GET_SAVE_DIRECTORY: "/storage/emulated/0/RetroArch/saves/Flycast". [Environ] GET_VARIABLE: reicast_texupscale - Invalid value. [Environ] GET_VARIABLE: reicast_texupscale_max_filtered_texture_size - Invalid value. [Environ] SET_SAVE_STATE_IN_BACKGROUND: no. [Environ] GET_PREFERRED_HW_RENDER, video driver: "vulkan"... [Environ] GET_PREFERRED_HW_RENDER: RETRO_HW_CONTEXT_VULKAN. [Environ] SET_HW_RENDER, context type: vulkan. [HW] Requesting Vulkan context. [Environ] SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE. core/hw/mem/addrspace.cpp:425 N[VMEM]: Info: nvmem is enabled core/hw/mem/addrspace.cpp:461 N[VMEM]: BASE 0x6ecb840000 RAM(16 MB) 0x6ed7840000 VRAM64(8 MB) 0x6ecf840000 ARAM(2 MB) 0x6eeb840000 [Environ] GET_VARIABLE: reicast_texupscale - Invalid value. [Environ] GET_VARIABLE: reicast_texupscale_max_filtered_texture_size - Invalid value. [Environ] SET_ROTATION: "0" (0 deg). [SRAM] Skipping SRAM load. [Core] Version of libretro API: 1, Compiled against API: 1 shell/libretro/libretro.cpp:2485 N[RENDERER]: retro_get_system_av_info: Res=480 [Core] Geometry: 640x480, Aspect: 1.333, FPS: 59.94, Sample rate: 44100.00 Hz. [Video] Set video size to: 1440x1080. [Video] Using HW render, vulkan driver forced. [Vulkan] Vulkan dynamic library loaded. [Vulkan] Setting swap interval: 1. [Vulkan] Created Android surface: 479411074272. [Vulkan] Got HW context negotiation interface 1. [Vulkan] Found GPU at index 0: "Adreno (TM) 650". [Vulkan] Using GPU index 0. core/rend/vulkan/vk_context_lr.cpp:148 N[RENDERER]: Device extension enabled: VK_KHR_swapchain core/rend/vulkan/vk_context_lr.cpp:148 N[RENDERER]: Device extension enabled: VK_EXT_provoking_vertex [Vulkan] Using semaphores for WSI acquire. [Vulkan] Using GPU: "Adreno (TM) 650". [Vulkan] Got 3 swapchain images. [Vulkan] Native window size: 1920x1080. [Vulkan] Using resolution 1920x1080. [Vulkan] Using BGRA8888 format. [Vulkan] Loading stock shader. [Input] Found joypad driver: "android". [Video] Found display server: "android". shell/libretro/libretro.cpp:1939 N[RENDERER]: retro_vk_context_reset core/rend/vulkan/vk_context_lr.cpp:265 N[RENDERER]: GPU Supports Vulkan API: 1.1.128 core/rend/vulkan/vk_context_lr.cpp:268 N[RENDERER]: GPU Supports vkGetPhysicalDeviceProperties2 core/linux/common.cpp:68 E[COMMON]: SIGSEGV @ 0x7280df7154 invalid access to 0x6f6555a000

Aethyrion avatar Dec 03 '25 22:12 Aethyrion

Anything else I can do to investigate further?

Aethyrion avatar Dec 04 '25 12:12 Aethyrion

It really looks like a crash when the core is initializing Vulkan. But I have no idea what could be the root cause. If it was working before I would try to look for what has changed. The Vulkan initialization code hasn't changed recently in the core. You could try Flycast standalone to check if it crashes too.

flyinghead avatar Dec 04 '25 13:12 flyinghead

Flycast standalone works fine with Vulkan. Other cores are also working fine in RetroArch with Vulkan.

Aethyrion avatar Dec 04 '25 19:12 Aethyrion

I finally tracked down the issue! There was a Vulkan cache file (I don’t recall the exact filename) located in the system/dc folder. Deleting it resolved the problem. I’m not sure whether it’s expected for this file to be present there, or if a safeguard should handle this situation. The file was clearly being read and used, so if it become corrupted, perhaps the code could detect that, log a warning, and/or automatically delete the file.

Aethyrion avatar Dec 04 '25 20:12 Aethyrion

Wow! Good catch. I already had a similar issue way back, and it's incredibly hard to guard against. It's 100% handled by the GPU driver, so if the driver crashes it brings the app down with it before it can do anything.

When nothing else works, the only way out is to uninstall and reinstall the app.

flyinghead avatar Dec 04 '25 20:12 flyinghead

The issue was that simply uninstalling the app wasn’t enough. The corrupted file was located in the user’s RetroArch/system/dc folder, which persists across uninstall/reinstall cycles on Android.
For testing, I had actually deleted the entire RetroArch folder, but I had to copy the dc folder back each time since the BIOS files are required.
Would it be possible for the code to automatically delete this file if it’s found there?

Aethyrion avatar Dec 04 '25 20:12 Aethyrion

That's where it's supposed to be so what you're asking is to disable the VK pipeline cache completely.

flyinghead avatar Dec 05 '25 08:12 flyinghead