Lime-3DS-Emulator icon indicating copy to clipboard operation
Lime-3DS-Emulator copied to clipboard

Vulkan renderer refuses to work on Android 9

Open Raypuia opened this issue 1 year ago • 30 comments
trafficstars

Is there an existing issue for this?

  • [ ] I have searched the existing issues

Affected Build(s)

2110

Description of Issue

Just before launching any game the app suddenly crashes. I don't understand why this happens. I have both Dolphin and Vita3K on the same device, and the Vulkan renderer worked just fine on those.

Expected Behavior

Vulkan rendering working for Adreno GPUs without adrenotools support.

Reproduction Steps

  1. Go to settings
  2. Go to Graphics
  3. Change OpenGLES to Vulkan
  4. Return to main menu
  5. Select any game
  6. crashes

Log File

citra_log.txt Screenshot_2024-04-22-13-41-53-633_com miui bugreport

System Configuration

CPU: Qualcomm Snapdragon 665 (Redmi Note 8) GPU/Driver: Adreno 610 / Default System Driver RAM: 4GB OS: Android 9 Vulkan: 1.1.87

Raypuia avatar Apr 22 '24 17:04 Raypuia

Did it ever work under older Lime3DS releases? How about the last Citra nightly? Or even PabloMK7's fork?

rtiangha avatar Apr 24 '24 13:04 rtiangha

Did it ever work under older Lime3DS releases? How about the last Citra nightly? Or even PabloMK7's fork?

None of them. Is there some requirement on the Vulkan renderer i ain't aware off?

Raypuia avatar Apr 24 '24 20:04 Raypuia

If it doesn't work with the last Citra Nightly, then I'm not sure what more can easily be done.

The only thing I can suggest is to see if maybe an older version works. See if you can download something newer than Nightly-1995 from the Wayback Machine; Vulkan support was officially introduced after September 15, 2023 and they originally claimed that it supported Vulkan 1.1. Because if it doesn't work with one of the first builds to support Vulkan, then you'll probably need to stick with OpenGL. If it does work, then keep trying newer versions until it stops working and report back and maybe we can figure out what changed.

https://web.archive.org/web/20231002001630/github.com/citra-emu/citra-nightly/releases

rtiangha avatar Apr 24 '24 20:04 rtiangha

Also, someone suggested trying this driver for adreno, assuming you can install it: https://github.com/K11MCH1/AdrenoToolsDrivers/releases/tag/A7xx_R4

As anything newer didn't work. So maybe try that too if you can (I don't know much about this hardware).

rtiangha avatar Apr 24 '24 20:04 rtiangha

Also, someone suggested trying this driver for adreno, assuming you can install it: https://github.com/K11MCH1/AdrenoToolsDrivers/releases/tag/A7xx_R4

As anything newer didn't work. So maybe try that too if you can (I don't know much about this hardware).

Adrenotools doesn't work on Android 9 and below

Raypuia avatar Apr 24 '24 20:04 Raypuia

Ah. Well, try an older version of Citra; if it doesn't work there, then not much more can probably be done (other than use OpenGL).

rtiangha avatar Apr 24 '24 20:04 rtiangha

If it doesn't work with the last Citra Nightly, then I'm not sure what more can easily be done.

The only thing I can suggest is to see if maybe an older version works. See if you can download something newer than Nightly-1995 from the Wayback Machine; Vulkan support was officially introduced after September 15, 2023 and they originally claimed that it supported Vulkan 1.1. Because if it doesn't work with one of the first builds to support Vulkan, then you'll probably need to stick with OpenGL. If it does work, then keep trying newer versions until it stops working and report back and maybe we can figure out what changed.

https://web.archive.org/web/20231002001630/github.com/citra-emu/citra-nightly/releases

Vulkan on nightly-2000 works. Later builds seems weren't archived...

Raypuia avatar Apr 24 '24 20:04 Raypuia

Hit the forward arrow on the top right to see a later snapshot and keep going.

Example: https://web.archive.org/web/20231006075554/https://github.com/citra-emu/citra-nightly/releases

Edit: Or use the calendar: https://web.archive.org/web/20240000000000*/https://github.com/citra-emu/citra-nightly/releases

rtiangha avatar Apr 24 '24 20:04 rtiangha

Already did, nightly-2000 was the last archived build of 2023. The rest are just gone. IMG_20240424_170639

Raypuia avatar Apr 24 '24 21:04 Raypuia

Try this one, although they're not in numerical order:

https://web.archive.org/web//https://github.com/citra-emu/citra-nightly/releases/download

rtiangha avatar Apr 24 '24 21:04 rtiangha

Done, same thing. nightly-2098 doesn't even download (possibly an expired amazonaws link) And nightly-2104 was the build before Citra was axed IMG_20240424_175404

Raypuia avatar Apr 24 '24 21:04 Raypuia

Well, that sucks. That's a pretty big range to try and figure out what changed such that it made it not work anymore on your hardware. It's probably a safe bet though that if it didn't work on the final Nightly, then it'll be tough for someone to figure out how to make it work on current Lime3DS since it forked the Nightly branch. Certainly outside of my skill set. I don't suppose OpenGL works on your device? If not, you might be stuck with build 2000 for the foreseeable future.

rtiangha avatar Apr 24 '24 22:04 rtiangha

Well, that sucks. That's a pretty big range to try and figure out what changed such that it made it not work anymore on your hardware. It's probably a safe bet though that if it didn't work on the final Nightly, then it'll be tough for someone to figure out how to make it work on current Lime3DS since it forked the Nightly branch. Certainly outside of my skill set. I don't suppose OpenGL works on your device? If not, you might be stuck with build 2000 for the foreseeable future.

GLES does work, but it's painfully slow because of the shader compilation. (Only Citra MMJ solves this problem)

Raypuia avatar Apr 24 '24 23:04 Raypuia

Hmm, looks like slim pickings for Android, but here's the list of Canaries, for completeness sake (filter by apk; should return about 5 hits, no idea how many links are actually working): https://web.archive.org/web//https://github.com/citra-emu/citra-canary/releases/download

rtiangha avatar Apr 25 '24 16:04 rtiangha

Hmm, looks like slim pickings for Android, but here's the list of Canaries, for completeness sake (filter by apk; should return about 5 hits, no idea how many links are actually working): https://web.archive.org/web//https://github.com/citra-emu/citra-canary/releases/download

Vulkan still works on canary-2618, but the others weren't archived (except for some Win and Linux x86_64 builds)

Raypuia avatar Apr 25 '24 22:04 Raypuia

I think I've found a page with some builds. https://citra-emulator-3ds-emulator.uptodown.com/android/versions

Raypuia avatar Apr 25 '24 22:04 Raypuia

Nice! If you can find the latest build that still works with your device, that'll at least give a date to work with to start looking at the code. Hopefully whatever changed will be obvious (and reversible; would suck if the requirements changed to Vulkan 1.3 somewhere along the line).

rtiangha avatar Apr 26 '24 00:04 rtiangha

Nice! If you can find the latest build that still works with your device, that'll at least give a date to work with to start looking at the code. Hopefully whatever changed will be obvious (and reversible; would suck if the requirements changed to Vulkan 1.3 somewhere along the line).

I've found it! nightly-2030 is the last build were Vulkan worked on my device. Anything onwards just crashes right when preloading the game having Vulkan enabled

Raypuia avatar Apr 26 '24 02:04 Raypuia

Good News: I found it. It was commit fa08df21a50f7de06f39333bd441d2f44c9f7ed8 Bad News: Looks like it was intentional. 🙁

* vk_platform: Hardcode apiVersion to VK_API_VERSION_1_3

So there you go. Minimal requirement as of Nov 10, 2023 is Vulkan 1.3. Up until then, it was Vulkan 1.1.

I would suggest the documentation be updated and an FAQ be made for the Lime3DS project, if only to reduce the support burden. Heck, add it in big bold letters to the Issues template if someone is filing a Vulkan issue (i.e. Note: Vulkan support requires Vulkan 1.3 or newer) CC: @OpenSauce04

rtiangha avatar Apr 26 '24 12:04 rtiangha

I will update the minimum specs on the website accordingly

Despite the fact that this was kind of our bad due to incorrect documentation, I am going to close this under user error as there is technically nothing wrong here on the emulator's end

OpenSauce04 avatar Apr 26 '24 13:04 OpenSauce04

Edit: Maybe I spoke too soon? Two months ago, aa6809e2a8f8264f6c5ed359a0fc458c66368856 reset things back to 1.1 (I think; if I'm understanding the code correctly) and that was the last change to the api requirements. So I don't know anymore. My guess is 1.3 will definitely work; anything older is a crap shoot, probably because they tested on 1.3 for months but didn't really test on older after Feb.

rtiangha avatar Apr 26 '24 13:04 rtiangha

I'll hold off then until we find out what's really going on

OpenSauce04 avatar Apr 26 '24 13:04 OpenSauce04

I'll go ask over at PabloMK7's fork about some api clarification. Hopefully GPUCode/raphaelthegreat chimes in since he made the changes, but I don't know what the status is of his involvement in the project these days due to all the scene drama recently.

rtiangha avatar Apr 26 '24 13:04 rtiangha

In the meantime, maybe changing the Issue template to explicitly ask what Vulkan version their video card driver supports would be helpful in trying to find patterns. If they really intended to bring back support to Vulkan 1.0 or 1.1 back in mid-Feb after having it at 1.3 for 3-4 months, perhaps they just didn't have enough time to iron out the regression bugs with older cards through user testing before the project shutdown just a few weeks later.

rtiangha avatar Apr 26 '24 13:04 rtiangha

Edit: Maybe I spoke too soon? Two months ago, aa6809e reset things back to 1.1 (I think; if I'm understanding the code correctly) and that was the last change to the api requirements. So I don't know anymore. My guess is 1.3 will definitely work; anything older is a crap shoot, probably because they tested on 1.3 for months but didn't really test on older after Feb.

Probably, Vita3K allows the renderer to work on Vulkan 1.1 despite recommending 1.2 for optimal usage.

Enforcing Vulkan 1.3 on mobile is pretty exaggerated, knowing most phones only have either 1.1 or 1.2

EDIT: I added the Vulkan version of my device to the OP to clarify

Raypuia avatar Apr 26 '24 18:04 Raypuia

@Raypuia Hey, this might be a long shot, but can you try this custom version of PabloMK7's Citra fork that I made and see if it solves your issue? I was looking around for something unrelated and stumbled upon some Android shader options that were never set in the past. I wonder if that'll fix things.

https://github.com/rtiangha/bravely-offline-citra/actions/runs/9046314371/artifacts/1493978721

Edit: Or maybe it won't if the issue really is adrenotools. Still though, it should work on Android 9. The documentation says Android 9+ so I assume it's Android 9 inclusive. Have you tried that driver update above? Maybe it'll work.

rtiangha avatar May 11 '24 20:05 rtiangha

@Raypuia Hey, this might be a long shot, but can you try this custom version of PabloMK7's Citra fork that I made and see if it solves your issue? I was looking around for something unrelated and stumbled upon some Android shader options that were never set in the past. I wonder if that'll fix things.

https://github.com/rtiangha/bravely-offline-citra/actions/runs/9046314371/artifacts/1493978721

Edit: Or maybe it won't if the issue really is adrenotools. Still though, it should work on Android 9. The documentation says Android 9+ so I assume it's Android 9 inclusive. Have you tried that driver update above? Maybe it'll work.

I've tried the build and the issue still persists. And about Adrenotools, it actually requires Android +10. Because that version implemented custom drivers through APKs, which Skyline took advantage from to get extra Vulkan extensions on mobile

Raypuia avatar May 13 '24 15:05 Raypuia

This issue has been marked as stale. If there is no activity within the next 10 days, this issue will be closed.

github-actions[bot] avatar Aug 12 '24 01:08 github-actions[bot]

Just bumping this in case there's a solution for the Vulkan renderer. GLES shader compilation is annoyingly slow.

Raypuia avatar Aug 17 '24 15:08 Raypuia

This issue has been marked as stale. If there is no activity within the next 10 days, this issue will be closed.

github-actions[bot] avatar Nov 16 '24 01:11 github-actions[bot]