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

Choosing Vulkan Renderer Crashes the Emulator

Open i0x404 opened this issue 1 year ago • 17 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Affected Build(s)

2117.1

Description of Issue

Hello, I am using Lime 3DS in windows and when I start any game with vulkan renderer the emulator just crashes down, opengl works fine though.

Expected Behavior

The emulator starts

Reproduction Steps

Starting a game with the Vulkan Renderer in place of OpenGL

Log File

System Configuration

CPU: I5-5200U GPU/Driver: NVIDIA 920M RAM: 8GB OS: Windows 10

i0x404 avatar Aug 18 '24 15:08 i0x404

Please attach the log as a file and edit out the wall of text

OpenSauce04 avatar Aug 18 '24 16:08 OpenSauce04

lime3ds_log.txt

Here's the log file thanks a lot

i0x404 avatar Aug 18 '24 19:08 i0x404

[ 16.247289] Debug <Critical> video_core\renderer_vulkan\vk_stream_buffer.cpp:Vulkan::`anonymous-namespace'::GetMemoryType::<lambda_1>::operator ():61: Assertion Failed! No suitable memory type found

Hey, I looked at your log file. I've quoted the error reported before crashing above. It seems that it isn't able to detect the GPU memory? I may be wrong so I'm open to second opinions.

BlurrySquire avatar Aug 18 '24 20:08 BlurrySquire

I have the same problem. If I select Vulkan and open a game it crashes

Papermanzero avatar Aug 19 '24 07:08 Papermanzero

I have the same problem. If I select Vulkan and open a game it crashes

What are your specs? I'm wondering if we can find a link between certain hardware.

BlurrySquire avatar Aug 19 '24 09:08 BlurrySquire

It is a GTX760 Phantom and it should support vulkan 1.3

Papermanzero avatar Aug 19 '24 10:08 Papermanzero

It is a GTX760 Phantom and it should support vulkan 1.3

This is very old hardware which is likely under-qualified for running a 3DS emulator. I would be surprised if you can get it working well.

OpenSauce04 avatar Aug 19 '24 12:08 OpenSauce04

It's also worth mentioning that according to Wikipedia the GTX760 has Vukan 1.2 support and the GTX920M has either Vulkan 1.1 support or no Vulkan support at all depending on the model

OpenSauce04 avatar Aug 19 '24 12:08 OpenSauce04

It is a GTX760 Phantom and it should support vulkan 1.3

This is very old hardware which is likely under-qualified for running a 3DS emulator. I would be surprised if you can get it working well.

I used to run citra on a gtx 550 ti. It actually ran pretty well even with some 3d games like mario 3d land, but yeah it probably isn't the best hardware.

BlurrySquire avatar Aug 19 '24 12:08 BlurrySquire

Indeed it runs pretty well and Vulkan support is also there. Working with Dolphin and all other emulators except of Lime

Papermanzero avatar Aug 19 '24 14:08 Papermanzero

It's also worth mentioning that according to Wikipedia the GTX760 has Vukan 1.2 support and the GTX920M has either Vulkan 1.1 support or no Vulkan support at all depending on the model

GeForce 920M actually supports vulkan v1.2.175 :

00:00:04.674 |N| GUI.RenderThread Gpu PrintGpuInformation: NVIDIA NVIDIA GeForce 920M (Vulkan v1.2.175, Driver v475.14.0.0) This log is extracted from Ryujinx

And online it shows that it supports v1.2.133 See Here, But I have newer driver version than the one declared there.

i0x404 avatar Aug 20 '24 00:08 i0x404

Hey, I did some looking and have a custom build I would like you to try. I have downgraded the vulkan-headers submodule down to version 1.1.130 (aka Vulkan 1.1).

Builds are linked here. If possible would you be able to test it and see if Vulkan crashes for your or not?

I tested in Mario & Luigi Superstar Saga and Mario & Luigi Bowser's Inside Story on Vulkan without an issue, but my GPU supports the latest Vulkan. So I need people to test it whose GPU does not support Vulkan 1.3.

BlurrySquire avatar Aug 20 '24 12:08 BlurrySquire

Hey, I did some looking and have a custom build I would like you to try. I have downgraded the vulkan-headers submodule down to version 1.1.130 (aka Vulkan 1.1).

Builds are linked here. If possible would you be able to test it and see if Vulkan crashes for your or not?

I tested in Mario & Luigi Superstar Saga and Mario & Luigi Bowser's Inside Story on Vulkan without an issue, but my GPU supports the latest Vulkan. So I need people to test it whose GPU does not support Vulkan 1.3.

Hi. Thanks for looking into it. Still crashing here with a GTX 765M. OpenGL works fine.

From the log, this part might be the relevant one:

[ 5.195206] Render.Vulkan <Info> video_core/renderer_vulkan/vk_instance.cpp:operator():433: Enabling extension: VK_KHR_swapchain [ 5.195210] Render.Vulkan <Info> video_core/renderer_vulkan/vk_instance.cpp:operator():433: Enabling extension: VK_KHR_image_format_list [ 5.195211] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_EXT_shader_stencil_export unavailable. [ 5.195212] Render.Vulkan <Info> video_core/renderer_vulkan/vk_instance.cpp:operator():433: Enabling extension: VK_EXT_external_memory_host [ 5.195213] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_EXT_tooling_info unavailable. [ 5.195214] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_KHR_timeline_semaphore unavailable. [ 5.195215] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_KHR_portability_subset unavailable. [ 5.195216] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_EXT_extended_dynamic_state unavailable. [ 5.195217] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_EXT_custom_border_color unavailable. [ 5.195218] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_EXT_index_type_uint8 unavailable. [ 5.195219] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():438: Extension VK_EXT_fragment_shader_interlock has been blacklisted because it is broken on Nvidia drivers [ 5.195221] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():438: Extension VK_EXT_pipeline_creation_cache_control has been blacklisted because it is broken on Nvidia drivers [ 5.195221] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:operator():442: Extension VK_KHR_fragment_shader_barycentric unavailable. [ 5.234908] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:CreateFormatTable:303: Format B8G8R8Unorm unsupported, falling back unconditionally to R8G8B8A8Unorm [ 5.234913] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:CreateFormatTable:303: Format R5G5B5A1UnormPack16 unsupported, falling back unconditionally to R8G8B8A8Unorm [ 5.234915] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:CreateFormatTable:303: Format R4G4B4A4UnormPack16 unsupported, falling back unconditionally to R8G8B8A8Unorm [ 5.234915] Render.Vulkan <Warning> video_core/renderer_vulkan/vk_instance.cpp:CreateFormatTable:303: Format R4G4B4A4UnormPack16 unsupported, falling back unconditionally to R8G8B8A8Unorm [ 5.237504] Debug <Critical> video_core/renderer_vulkan/vk_stream_buffer.cpp:operator():61: Assertion Failed! No suitable memory type found

Enkak avatar Aug 20 '24 13:08 Enkak

Hi. Thanks for looking into it. Still crashing here with a GTX 765M. OpenGL works fine.

Thanks for testing it. The error you provided is the same error logged before my attempted fix. We will have to take a dig at the Vulkan backend code for Lime3DS to see what is causing the error at the bottom.

[   5.237504] Debug <Critical> video_core/renderer_vulkan/vk_stream_buffer.cpp:operator():61: Assertion Failed! No suitable memory type found

BlurrySquire avatar Aug 20 '24 13:08 BlurrySquire

GeForce 920M actually supports vulkan v1.2.175

I see. The Wikipedia article must be incorrect. Thanks for the clarification

OpenSauce04 avatar Aug 20 '24 16:08 OpenSauce04

Hi. Thanks for looking into it. Still crashing here with a GTX 765M. OpenGL works fine.

Thanks for testing it. The error you provided is the same error logged before my attempted fix. We will have to take a dig at the Vulkan backend code for Lime3DS to see what is causing the error at the bottom.

[   5.237504] Debug <Critical> video_core/renderer_vulkan/vk_stream_buffer.cpp:operator():61: Assertion Failed! No suitable memory type found

Just to let you know that the same issue also happens on final Citra Nightly release (2104) so the problem might come from Citra originally and not specifically from Lime3DS.

Enkak avatar Aug 20 '24 21:08 Enkak

I can confirm. It is a bug which citra introduced

Papermanzero avatar Aug 20 '24 22:08 Papermanzero

Thanks. When taking a look at the vulkan backend I can't notice anything wrong with GetMemoryType of line 48 of vk_stream_buffer.cpp which is where the assert takes place. The only other function I suspect is FindMemoryType of line 9 of vk_memory_util.cpp. I will take a further look tomorrow as it is getting late in the UK.

BlurrySquire avatar Aug 20 '24 23:08 BlurrySquire

I think I found the issue, tested Inazuma Eleven Shadow and it worked, I'll make a commit now PS: I'm not the best at C++ so I hope someone will help Edit : Commit is #384

image

i0x404 avatar Aug 21 '24 18:08 i0x404

I can test as well if you have a build

Papermanzero avatar Aug 21 '24 19:08 Papermanzero

@Papermanzero here is the build release (windows)

i0x404 avatar Aug 21 '24 20:08 i0x404

Can confirm that the vulkan fix is working here for the moment with the GTX 765M.

Testing here with the windows-msys2 artifact from: https://github.com/Lime3DS/Lime3DS/actions/runs/10496559569

Enkak avatar Aug 21 '24 20:08 Enkak

yes @OpenSauce04 just created actions artifact, the commit is still not merged until more people test it

i0x404 avatar Aug 21 '24 20:08 i0x404

Also working here. Tested some games and the framerate is much higher than opengl

Papermanzero avatar Aug 21 '24 22:08 Papermanzero

Fixed by #384

OpenSauce04 avatar Aug 21 '24 22:08 OpenSauce04

same issue with a 7900 xtx amd

Enterprise12nx01 avatar Jan 26 '25 10:01 Enterprise12nx01

I'm using a RTX 4060 Ti and vulkan crashes lime 3ds 2119.1

Relbo10000 avatar Feb 17 '25 20:02 Relbo10000