melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.27k stars 542 forks source link

melonDS crashes on Raspberry Pi 5 when switching to OpenGL renderer #2027

Open commandcontrolQ opened 6 months ago

commandcontrolQ commented 6 months ago

Self-explanatory.

Running melonDS through the terminal before switching renderers shows the following:

EGL Version: 1.4
EGL Extensions: EGL_ANDROID_blob_cache EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import .....
Trying version 4.3 (Core)
eglCreateContext() failed: 12297
Trying version 3.2 (Core)
eglCreateContext() failed: 12297
Segmentation fault (core dumped)

This implies that the error is due to the fact that the emulator requires at least OpenGL version 3.2, which is a problem because the Raspberry Pi's GPU drivers only expose OpenGL ES 3.1. Is there anything that can be done to fix this, or will I be stuck with the software renderer? I am fine with recompiling melonDS if it is required.

RSDuck commented 6 months ago

melonDS at the moment doesn't support OGL ES.

commandcontrolQ commented 6 months ago

Does OpenGL ES support seem likely, or is it too different from normal OpenGL to be suitable in the near future?

nadiaholmquist commented 6 months ago

Apparently the Pi 5's GPU supports Vulkan, so you could try using zink, assuming Raspberry Pi OS ships it.

Like MESA_LOADER_DRIVER_OVERRIDE=zink melonDS

commandcontrolQ commented 6 months ago

Yes, the Raspberry Pi 5's GPU reports Vulkan 1.2 support, so I will have to test out whether zink will work or not when I have the time.

commandcontrolQ commented 6 months ago

Even though I am running Ubuntu 23.10 instead of Raspberry Pi OS, running the command MESA_LOADER_DRIVER_OVERRIDE=zink ./melonDS seems to have made no difference at all.

RayyanAnsari commented 6 months ago

You might need some extra flags as in this post. If that doesn't work you might want to check if the vulkan drivers are actually installed - you can probably test with vulkaninfo or similar.

commandcontrolQ commented 6 months ago
  1. The vulkan drivers are installed, as calling vulkaninfo | grep "version" returns 1.3.211.
  2. I have already read that post and have tried the extra flags, but to no avail. I might need some different flags, however the exact flags I need to get zink working might not be the same as what was found in the post, as the OP in the post had a NVIDIA GPU, while my Raspberry Pi 5 has a VideoCore VII GPU.