Project

General

Profile

Actions

Emulator Issues #13064

closed

Full Screen - Vulkan - Graphical Glitching - Mario Golf: Toadstool Tour

Added by ForkWNY about 2 years ago. Updated about 2 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

Mario Golf: Toadstool Tour

Game ID? (right click the game in the game list, Properties, Info tab)

GFTE01

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

5fd9909e73df7fb704d2e443e17346b5

What's the problem? Describe what went wrong.

After 5 or 6 minutes of gameplay, notably within regular golf or slots golf mode, graphical corruption and artifacting occurs with the Vulkan back-end. The corruption prevents game play, but Alt + Enter to get out of fullscreen mode will TEMPORARILY fix the problem. It will return seconds or minutes later however. This was never an issue prior to Dev version 5.0-17499, and the issue has carried over into all Dolphin Dev versions beyond that one. This issue does not occur when using D3D11 or D3D12 graphics back-ends, ONLY Vulkan.

What steps will reproduce the problem?

Use Vulkan back-end, Force 16:9, hybrid ubershaders, launch the game title and play the slots mode golf game for 5-10 minutes, graphical corruption will surface. More details of this issue can be found in the following thread: https://forums.dolphin-emu.org/Thread-full-screen-vulkan-graphical-glitching

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes, present in latest dev version, 5.0-17540

Is the issue present in the latest stable version?

No

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

5.0-17499

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

[Attach any fifologs if possible, write a description of fifologs and screenshots here to assist people unfamiliar with the game.]

What are your PC specifications? (CPU, GPU, Operating System, more)

CPU: AMD Ryzen 9 5900X
GPU: AMD Radeon Rx 6700 XT
RAM: 64GB DDR4
OS: Windows 11 x64
Radeon Driver version: 22.10.1

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

Thid issue is rather random in nature but is reproduceable after playing the game title for several minutes. From my own troubleshooting, this problem occurs in portable standalone Dolphin dev versions at or above version 17499, when the Vulkan graphics back-end is used.


Files

Actions #1

Updated by K0bin about 2 years ago

I wrote the patch that seemed to break it for you but I simply cannot reproduce the problem.

I played a couple of holes on my PC (5900X + RTX 3090) and another 18 holes on my phone (SD 865).
Both of which were perfectly fine. I've also taken another good look at the code and I don't see any issues with it.

Any chance you could bisect it down to the exact commit that broke it for you?

Actions #2

Updated by ForkWNY about 2 years ago

I will double-check to find out if it was an earlier build that had the graphical glitching issue. It's not an easy one to pin down based on the amount of time it takes before the glitching occurs. I will say however that the glitch takes longer than a couple of holes to reproduce (usually it crops up by the 5th or 6th hole, but sometimes takes longer) - I believe this issue is likely isolated to Windows, I'm not sure whether mobile devices are affected.

Actions #3

Updated by Snowblind about 2 years ago

Hi KObin, I'm facing the same issue but in a different game. After playing Alien Hominid for a few minutes, several graphic glitches appear under Vulkan. I can confirm that this issue started right after I updated Dolphin for 5.0-17499-x64. The previous version worked perfectly (5.0-17493-x64). I'm using Windows 11 build 22H2, NVidia Geforce MX150, Driver 517.48, Intel Core i7-8565U.

Actions #4

Updated by ForkWNY about 2 years ago

After re-testing I can confirm that 5.0-17499 is the first version that has the graphical glitches in Vulkan. I re-tested with 5.0-17493 and it's rock solid after an hour of game play. 5.0-17499 glitches within about 10 minutes or so.

Thanks Snowblind for the additional confirmation.

Actions #5

Updated by AdmiralCurtiss about 2 years ago

Actions #6

Updated by ForkWNY about 2 years ago

AdmiralCurtiss wrote:

Please test if this build fixes the issue: https://dl.dolphin-emu.org/prs/f3/d6/pr-11122-dolphin-latest-x64.7z

Glitched 5 holes in, but this build runs butter smooth compared to other recent builds I've used. I wasn't able to grab a screenshot with F9 as the app hung and crashed as soon as I hit F9.

Actions #7

Updated by K0bin about 2 years ago

I've played around 40 holes on both my phone and my PC. I simply cannot reproduce the issue.

Actions #8

Updated by JMC4789 about 2 years ago

On a NVIDIA here, still haven't produced the issue.

Actions #9

Updated by ForkWNY about 2 years ago

Makes no sense, I can reproduce the issue 100% just playing the game for 5 minutes and can say with 100% certainty this issue never occurs on 5.0-17493 and earlier Dev versions of Dolphin.

Actions #10

Updated by Snowblind about 2 years ago

AdmiralCurtiss wrote:

Please test if this build fixes the issue: https://dl.dolphin-emu.org/prs/f3/d6/pr-11122-dolphin-latest-x64.7z

Glitches still happen on Alien Hominid. I think this is a Win 11 related issue.

Actions #11

Updated by JMC4789 about 2 years ago

Are you guys by chance both using HD texture packs for the games?

Actions #12

Updated by ForkWNY about 2 years ago

JMC4789 wrote:

Are you guys by chance both using HD texture packs for the games?

Yes, I do have the custom textures option ticked off (however, I did test using a portable dolphin where i did NOT check this option), but I am not using HD textures for this particular game. I use them on other titles though. I would not be surprised if Windows 11 may be at fault here.

Actions #13

Updated by JMC4789 about 2 years ago

And there's nothing in the logs at all when this is happening?

Actions #14

Updated by ForkWNY about 2 years ago

JMC4789 wrote:

And there's nothing in the logs at all when this is happening?

No because the game still runs as if nothing is wrong. Nothing gets logged. The graphics display gets all corrupted but there's no crash or anything of that nature. Sound and everything else works fine, game continues to function. Hitting Alt + Enter to get out of full screen instantly fixes the graphical glitching, then the graphical corruption returns fairly soon after going back it full screen.

If I run in D3D there's never any graphical glitching but performance isn't as good as Vulkan.

Actions #15

Updated by JMC4789 about 2 years ago

does the issue happen if you enable API validation Layer in Graphics Settings -> Advanced? It'll hurt performance but I'm curious.

Actions #16

Updated by ForkWNY about 2 years ago

JMC4789 wrote:

does the issue happen if you enable API validation Layer in Graphics Settings -> Advanced? It'll hurt performance but I'm curious.

Give me 10 mins and I'll let you know shortly.

Actions #17

Updated by ForkWNY about 2 years ago

Glitched out on hole #5 with API validation layer on. Attaching file.

Actions #18

Updated by ForkWNY about 2 years ago

If it would help speed troubleshooting, I do use Parsec and you could potentially see the problem for yourselves first-hand. 1 Gbps up/down so plenty of bandwidth available.

Actions #19

Updated by JMC4789 about 2 years ago

I don't think that'd help unfortunately. If Dolphin isn't reporting anything wrong, there's nothing for me to see other than it having the issue.

Actions #20

Updated by iwubcode about 2 years ago

Just to be clear, when "API validation layer" is on, it shouldn't impact how the software will run. The point of the "API validation layer" is that when the API does something wrong, it should report that to the log.

Do you see anything in the log after you have that turned on? Make sure you have "Video backend" checked in the logging categories and that you have "Info" (or at least "Warning") selected.

Actions #21

Updated by ForkWNY about 2 years ago

Will run that test shortly...I will post the log (if there's anything potentially useful in there afterward)...

Actions #22

Updated by Snowblind about 2 years ago

JMC4789 wrote:

Are you guys by chance both using HD texture packs for the games?

You are right. After disabling the HD texture pack, the glitches are gone for me. Apart from involving Vulkan and a specific commit, it seems my issue is different from what we have been discussing here.

Actions #23

Updated by ForkWNY about 2 years ago

That is correct...in my particular case, I'm not using an HD texture pack with the game title that is having problems, though the texture pack option is checked (for other titles that use this feature). I have encountered the graphical glitch bug however with a portable Dolphin, latest version, with custom textures completely unchecked.

Actions #24

Updated by ForkWNY about 2 years ago

Ran another test run per iwubcode's recommendations. API Validation layer "on", log set to "warning" and the "video backend" was checked for logging. The graphical glitching occurred 5 holes in - this seems pretty consistent, 5th hole always seems to trip off the issue.

I'm seeing a lot of this in the log:

19:12:916 VideoCommon\TextureCacheBase.cpp:2553 W[Video]: Failed to allocate a 320x17x1 texture
19:12:916 VideoBackends\Vulkan\VulkanLoader.cpp:218 E[Video]: (Create) vkAllocateMemory failed: (-10: VK_ERROR_TOO_MANY_OBJECTS)

I can't upload the whole log as it's 29MB.

Actions #25

Updated by JMC4789 about 2 years ago

Do you have a widescreen hack on?

Actions #26

Updated by ForkWNY about 2 years ago

Force 16:9 is on for Aspect Ratio, but the widescreen hack is unchecked.

Actions #27

Updated by ForkWNY about 2 years ago

Ran game at Auto instead of Force 16:9, log is still filled with this:

54:07:558 VideoBackends\Vulkan\VulkanLoader.cpp:218 E[Video]: (Create) vkAllocateMemory failed: (-10: VK_ERROR_TOO_MANY_OBJECTS)
54:07:558 VideoCommon\TextureCacheBase.cpp:2553 W[Video]: Failed to allocate a 128x128x1 texture
54:07:558 VideoBackends\Vulkan\VulkanLoader.cpp:218 E[Video]: (Create) vkAllocateMemory failed: (-10: VK_ERROR_TOO_MANY_OBJECTS)
54:07:558 VideoCommon\TextureCacheBase.cpp:2553 W[Video]: Failed to allocate a 128x16x1 texture
54:07:558 VideoBackends\Vulkan\VulkanLoader.cpp:218 E[Video]: (Create) vkAllocateMemory failed: (-10: VK_ERROR_TOO_MANY_OBJECTS)
54:07:558 VideoCommon\TextureCacheBase.cpp:2553 W[Video]: Failed to allocate a 512x512x1 texture

Also graphically glitched on hole #5, image attached.

Actions #28

Updated by Snowblind about 2 years ago

JMC4789 wrote:

Do you have a widescreen hack on?

I'm using a 16:9 widescreen gecko code. When disabled, the glitches are gone in the Vulkan.

Actions #29

Updated by ForkWNY about 2 years ago

I tried changing the aspect ratio to "stretch to window" as well as "auto", same behavior in Vulkan. Also noticed that if API Validation is checked and D3D12 is used as the back-end, Dolphin crashes w/o generating any logs, once the game is launched. Unchecked API Validation allows D3D12 to run just fine.

Actions #30

Updated by K0bin about 2 years ago

It's hitting the Vulkan allocation limit. Weird that my changes caused that but I guess there could be a timing element to it.

That (and the 16:9 gecko code) also explains why I cannot reproduce it on Linux.

I'll fix it using VMA.

Actions #31

Updated by ForkWNY about 2 years ago

K0bin wrote:

It's hitting the Vulkan allocation limit. Weird that my changes caused that but I guess there could be a timing element to it.

That (and the 16:9 gecko code) also explains why I cannot reproduce it on Linux.

I'll fix it using VMA.

Great news. Overall it was a fairly minor issue, especially since we're talking about a golf game which is slower paced. It didn't appear that Wii titles (such as Mario Galaxy) were affected for whatever reason, but I don't play them as frequently.

Actions #33

Updated by ForkWNY about 2 years ago

K0bin wrote:

https://github.com/dolphin-emu/dolphin/pull/11132

This should fix the issue.

Here's a build: https://dl.dolphin-emu.org/prs/53/9f/pr-11132-dolphin-latest-x64.7z

Thank you - I will test and let you know shortly.

Actions #34

Updated by ForkWNY about 2 years ago

That build did the trick. No more graphical corruption in Vulkan. Thanks for the fix and thanks for continuing to evolve and improve this amazing emulator!

Actions #35

Updated by iwubcode about 2 years ago

While that PR can be merged if desired, I don't think it's going to resolve the memory concerns. I see the same issue posted by ForkWNY on Opoona in the opening scenes. My gpu has ~8gb of memory and it hits that limit. This seems to be a Vulkan issue, other backends have around a little over a gb of usage.

Actions #36

Updated by K0bin about 2 years ago

@iwibcode

It's not about how much memory is allocated but rather how many unique allocations are done. Because of that it has nothing to do with how much VRAM you have. The limit is 4096 on Windows and pretty much infinite on Linux.

The PR does absolutely fix it because it will make fewer VkDeviceMemory allocations and suballocate from those.

Actions #37

Updated by Snowblind about 2 years ago

K0bin wrote:

https://github.com/dolphin-emu/dolphin/pull/11132

This should fix the issue.

Here's a build: https://dl.dolphin-emu.org/prs/53/9f/pr-11132-dolphin-latest-x64.7z

It worked like a charm. Thank you K0bin and everyone for all your support on that! You guys are absolutely amazing.

Actions #38

Updated by ForkWNY about 2 years ago

iwubcode wrote:

While that PR can be merged if desired, I don't think it's going to resolve the memory concerns. I see the same issue posted by ForkWNY on Opoona in the opening scenes. My gpu has ~8gb of memory and it hits that limit. This seems to be a Vulkan issue, other backends have around a little over a gb of usage.

I have noticed that Vulkan uses about 3x as much VRAM as D3D11/12. I have not seen my VRAM usage go up beyond 3.8GB when running Dolphin (Vulkan back-end), and 1.7GB with D3D (GPU has 12GB of VRAM).

Actions #39

Updated by iwubcode about 2 years ago

K0bin wrote:

@iwibcode

It's not about how much memory is allocated but rather how many unique allocations are done. Because of that it has nothing to do with how much VRAM you have. The limit is 4096 on Windows and pretty much infinite on Linux.

The PR does absolutely fix it because it will make fewer VkDeviceMemory allocations and suballocate from those.

Possibly a different issue then but both of these issues stem from the same root cause (your command buffer PR). I run out of memory now, whereas before the command buffer PR I sat at a nice 1gb of memory for Vulkan. None of your PRs fix this issue. I tried playing around with the code but wasn't able to come to a solution.

If this fixes the number of allocations for these users that's fine but there is some other bug.

Actions #40

Updated by iwubcode about 2 years ago

Opened issue 13067 for the memory growth issue. Sorry to derail this thread!

Actions #41

Updated by JMC4789 about 2 years ago

  • Status changed from New to Fixed

This appears to all be fixed now.

Actions

Also available in: Atom PDF