Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  (7.0) Compute backend seems to freeze the whole Unity editor occassionally
#1
I tried to Compute backend, and my Unity editor started freezing occasionally when I got into Play mode. When it happens the GPU usage is at 100% and there is no way to unfreeze it except killing the whole process.

Switching back to Burst seems to fix it.

It's quite hard to provide a set of steps to reproduce, since it only happens occasionally, but it's a bad enough to make Compute completely unusable for me.

It happens even with a minimum project:

https://drive.google.com/file/d/1o9kf_fv...sp=sharing
Reply
#2
(11-04-2024, 02:26 PM)kodra Wrote: I tried to Compute backend, and my Unity editor started freezing occasionally when I got into Play mode. When it happens the GPU usage is at 100% and there is no way to unfreeze it except killing the whole process.

Switching back to Burst seems to fix it.

It's quite hard to provide a set of steps to reproduce, since it only happens occasionally, but it's a bad enough to make Compute completely unusable for me.

It happens even with a minimum project:

https://drive.google.com/file/d/1o9kf_fv...sp=sharing

Hi,

I’m unable to reproduce this, unfortunately. I’ve tried both Mac and Windows machines to no avail.

Keep in mind that it is typically not possible to hang a GPU. If any “hang” takes more than a couple seconds - or the timeout interval specified in your machine - Unity will crash you’ll see a message similar to this:

“Failed to present D3D11 swapchain due to device
reset/removed.This error can happen if you draw or dispatch
ver expensive workloads to the 6PU. which can cause
Windows to detect a GPU Timeout and reset the device.”

Also note that Unity will sometimes take quite some time to compile compute shaders (often up to a minute) and there’s no feedback during this time, so it may look like the editor has frozen.

Make sure this is not your case. Otherwise, it would be useful if you could share the Editor log with us to see what happened that lead to this issue.

Kind regards,
Reply
#3
(11-04-2024, 03:40 PM)josemendez Wrote: Hi,

I’m unable to reproduce this, unfortunately. I’ve tried both Mac and Windows machines to no avail.

Also note that Unity will sometimes take quite some time to compile compute shaders (often up to a minute) and there’s no feedback during this time, so it may look like the editor has frozen.

Make sure this is not your case. Otherwise, it would be useful if you could share the Editor log with us to see what happened that lead to this issue.

Kind regards,

"Also note that Unity will sometimes take quite some time to compile compute shaders (often up to a minute) and there’s no feedback during this time, so it may look like the editor has frozen."


I'm quite sure it's not the case, cause this simple project runs instantly for me when it doesn't freeze. Also the shader compiler is using 0% of CPU when the editor is freezing (see below).

Quote:Keep in mind that it is typically not possible to hang a GPU. If any “hang” takes more than a couple seconds - or the timeout interval specified in your machine - Unity will crash you’ll see a message similar to this:


Well I guess Obi is truly magically powerful since it does hang my GPU constantly...  Lengua I just reproduced it with the project attached above. There aren't specific steps: I just keep enter/exit play mode until it happens.

The task manager looks like this:

   

The log files (right after the hanging happens) are attached.


Attached Files
.zip   Logs.zip (Size: 1.07 KB / Downloads: 1)
Reply
#4
I've upgraded to the latest LTS Unity (2022.3.24f1) and Nvidia driver (552.12). Also rebooted my PC.

Unfortunately neither helps.

This is a video recording of what's happening:



It only happens with Compute backend and never happens with Burst backend. It's quite a bummer... Compute is so performant for fluid, but it's just impossible to develop with it when the editor freezes every several minutes.
Reply
#5
(11-04-2024, 11:19 PM)kodra Wrote: Well I guess Obi is truly magically powerful since it does hang my GPU constantly...  Lengua I just reproduced it with the project attached above. There aren't specific steps: I just keep enter/exit play mode until it happens.

Are you using DX11, or some other API? (DX12, Vulkan?)

(11-04-2024, 11:19 PM)kodra Wrote: The log files (right after the hanging happens) are attached.

These are not the editor log files. Just an empty shader compiler log and a packages update list, neither are of any use. The log I'm interested in should be at %LOCALAPPDATA%\Unity\Editor\Editor.log. See:
https://docs.unity3d.com/Manual/LogFiles.html
Reply
#6
(12-04-2024, 08:13 AM)josemendez Wrote: Are you using DX11, or some other API? (DX12, Vulkan?)


These are not the editor log files. Just an empty shader compiler log and a packages update list, neither are of any use. The log I'm interested in should be at %LOCALAPPDATA%\Unity\Editor\Editor.log. See:
https://docs.unity3d.com/Manual/LogFiles.html

Unfortunately, it happens with both DX11 and Vulkan.

I've attached the Editor.log after the hanging happens (with DX11).

As crazy as it sounds, it seems to happen with both DX11 and Vulkan, but not with DX12. It might just be luck, but I've entered/exited play mode 50 times with DX12 and the editor didn't hang. With DX11 it always happens in less than 10 times.

Well... never mind. Unfortunately it happens with DX12 as well. Just much less often. It's a bit mysterious tho... cause it works differently with DX11 and DX12. With DX11 it freezes immediately upon entering play mode. With DX12 it seems to only happen after the game is running for a while. Perhaps there are two different bugs? I'm not sure. The only thing I'm sure about is that it hangs very often and constantly with DX11 and Vulkan on my machine.

It also doesn't hang the built game even with DX11 (so far?). Only Unity editor.


Attached Files
.zip   Editor.zip (Size: 12.74 KB / Downloads: 1)
Reply
#7
(12-04-2024, 12:11 PM)kodra Wrote: Unfortunately, it happens with both DX11 and Vulkan.

I've attached the Editor.log after the hanging happens (with DX11).

As crazy as it sounds, it seems to happen with both DX11 and Vulkan, but not with DX12. It might just be luck, but I've entered/exited play mode 50 times with DX12 and the editor didn't hang. With DX11 it always happens in less than 10 times.

Well... never mind. Unfortunately it happens with DX12 as well. Just much less often. It's a bit mysterious tho... cause it works differently with DX11 and DX12. With DX11 it freezes immediately upon entering play mode. With DX12 it seems to only happen after the game is running for a while. Perhaps there are two different bugs? I'm not sure. The only thing I'm sure about is that it hangs very often and constantly with DX11 and Vulkan on my machine.

It also doesn't hang the built game even with DX11 (so far?). Only Unity editor.

Hi,

I could finally reproduce this. I'm working on a fix, will get back to you once I'm reasonably sure it has been fixed.
Reply
#8
(18-04-2024, 08:47 AM)josemendez Wrote: Hi,

I could finally reproduce this. I'm working on a fix, will get back to you once I'm reasonably sure it has been fixed.

Good to know!
Reply