Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs #71841

Open
Tracked by #71929
frtp2612 opened this issue Jan 22, 2023 · 18 comments
Open
Tracked by #71929

Comments

@frtp2612
Copy link

Godot version

v4.0.beta14.official.28a24639c

System information

Windows10, Vulkan, RX5700XT, latest drivers(31.0.12029.10015)

Issue description

Whenver I use triplanar UVs in a material godot either freezes istantaneously or takes some time to freeze.
In either case it freezes after showing this message in the console:(sometimes it spams a bunch of them)

ERROR: Condition "err" is true. Returning: ERR_CANT_CREATE
at: swap_buffers (drivers/vulkan/vulkan_context.cpp:2299)

I tried my project on a macbook pro M1 and it never freezes.
I also tried it on my brother PC, which also has a RX5700xt and has the exact same issue. Sadly I could not try with a Nvidia graphics card.

Steps to reproduce

Open the MRP(better with console to eventually kill the window if it freezes) and stay in the godot 3D view in the main scene.
Godot might freeze istantaneously, usually resulting in a graphics drivers crash, requiring a reboot of the OS.
In the best case, Godot will simply hang forever and you have to kill it by closing the console.

I tried with no other windows open except for godot and the crash still happens

Minimal reproduction project

TriplanarUVCrash.zip

@Calinou
Copy link
Member

Calinou commented Jan 22, 2023

I can't reproduce this on 4.0.beta 621e329 (Linux, GeForce RTX 4090 with NVIDIA 525.60.11). This is likely a driver bug caused by an infinite loop in the shader (or similar).

Can you reproduce this in 3.5.1 when using a triplanar material there?

@frtp2612
Copy link
Author

frtp2612 commented Jan 22, 2023

I tried on 3.5.1 but the crash never happens there.

The crashes on godot 4 happened since the early alphas all the way to now to beta 14

@clayjohn
Copy link
Member

This sounds like it may be a duplicate of #69156 which will be fixed by #71581

Could you confirm whether #71581 fixes this issue as well?

@frtp2612
Copy link
Author

Thanks clayjohn. I compiled godot on #71581 with your fix and tried working with triplanar materials but sadly it did not solve the issue.

I guess it might really be a driver issue like calinou pointed out since no one else reported similar crashes with triplanar materials.

@Akira1San
Copy link

Tested the example and no crash so far. Using AMD Radeon RX 480.

@clayjohn
Copy link
Member

I also can't reproduce the crash on Windows 10 RX 6900 XT.

Is anything printed to the console when it freezes/crashes?

@frtp2612
Copy link
Author

Nope. Other than what I wrote in the issue description there is nothing more.
Here is a capture of the screen and the console.

crash

@Calinou Calinou changed the title Godot randomly freezes when using triplanar UVs in material Vulkan: Godot randomly freezes when using triplanar UVs in material Jan 29, 2023
@rbarongr
Copy link

rbarongr commented Feb 5, 2023

I'm using triplanar UVs in another project and it's freezing randomly too. I guess is the same problem.

This is the project: https://github.com/rbarongr/GodotFirstPersonController

Using:

  • v4.0.beta17.official [c400205]
  • Vulkan API 1.3.217 - Using Vulkan Device #0: AMD - AMD Radeon RX 5600 XT
  • Windows 10

@Calinou
Copy link
Member

Calinou commented Feb 5, 2023

Can you reproduce this in any of the old 4.0 betas to determine when the regression started?

@Calinou Calinou changed the title Vulkan: Godot randomly freezes when using triplanar UVs in material Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs Feb 5, 2023
@Withaust
Copy link
Contributor

Withaust commented Feb 7, 2023

beta15 - no crash
beta16 - starts crashing

Seems to me that this issue might be caused by #71581 since that is the only pull request that touched general texture/render pipeline handling in any generalized way.

@akien-mga akien-mga changed the title Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs (regression in 4.0 beta 16) Feb 7, 2023
@clayjohn
Copy link
Member

clayjohn commented Feb 7, 2023

I am skeptical that #71581 caused this issue as the original report was from beta 14 and the user says they have been facing the crash since the early alphas. Needless to say, the bug has been around long before #71581 was merged

@Withaust
Copy link
Contributor

Withaust commented Feb 8, 2023

After extensive testing it turns out that beta 15 crashes completely unpredictably as well. Not sure about which version this problem started on, seems to be persistent for most of the betas...

@Zireael07
Copy link
Contributor

It would be nice if someone who has the issue tried to go back to beta 1 to see if it happens on it. (I fully understand that the testing will take some time)

@akien-mga akien-mga changed the title Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs (regression in 4.0 beta 16) Vulkan: Godot randomly freezes when using triplanar UVs in material on AMD RDNA1 GPUs Feb 8, 2023
@Jaqueta
Copy link

Jaqueta commented Feb 8, 2023

Alpha 5 - No Crash so far.
Alpha 10 - Crashed after 40 minutes.
Alpha 11 - Crashed twice, but seems like these older versions took longer for it to happen for some reason? Still the same error however. Could be a fluke.

These versions also Crashed multiple times:
Alpha 12, Beta 1, Beta 3, Beta 4, Beta 7, Beta 15
These versions crashed within the first 10 minutes, again, could just a fluke too.

The problem is that the error is random and inconsistent. Sometimes it crashes as soon as I press play, sometimes it takes several minutes. AFAIK Alpha 5 COULD have the issue too and it just didn't crashed because of its random nature?

It will be hard to pinpoint until we find a way to trigger the error consistently. But I'll keep testing it in the meantime.

Btw all of the crashes gave the same error mentioned by the op.

@Jaqueta
Copy link

Jaqueta commented Feb 8, 2023

Update: After some testing, both Alpha 5, and Alpha 1 crashed too with the same error + driver timeout. Had to run the game for about an hour on each.

These are my specs as mentioned before on the other thread:
Windows 11 | R5 3600 | RX 5600 XT
Driver Version: 22.40.01.10-221213a-386778E-ISV-NDA-AMD-Software-Adrenalin-Edition

@Calinou
Copy link
Member

Calinou commented Feb 11, 2023

It may be worth using Shader Playground, reconstructing the triplanar sampling shader code from scene/resources/material.cpp then looking at the generated assembly using those options:

image

gfx1010, gfx1011 and gfx1012 are internal names for RDNA1 GPUs. For example, gfx1012 is a RX 5500 XT – I believe lower numbers are higher-end variants (similar to "Navi 10" being higher-end than "Navi 11"). You can find a more complete list of internal names here (press Escape before the page is done loading to avoid being redirected to docs.amd.com).

@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 23, 2023
@Withaust
Copy link
Contributor

Problem seems to be gone in 4.1 dev 2

@Jaqueta
Copy link

Jaqueta commented May 21, 2023

Problem seems to be gone in 4.1 dev 2

Tested for about 90 minutes here, no crashes yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants