ZED Unity SDK causes crashes

I am using the ZED Mini in Unity 2022.3.13 (BiRP), with the game locked to 30 fps. My laptop has a Ryzen 5800H and RTX 3060, nothing is at 100% usage.
The app has been crashing. Sometimes up to every other time I enter play mode. All stacktraces point to it going wrong somewhere on the ZED side. Has thisbeen reported before?
Is there any code snippets I need to get? (I mostly repurposed the object detection code)
The stacktrace seems to be in native code, so I cannot fully debug it.

Stack trace: ========== OUTPUTTING STACK TRACE ==================

0x00007FFAA1E50014 (sl_ai64) slutils::cv::hal::LU32f
0x00007FFAA1DDB48F (sl_ai64) slutils::cv::hal::LU32f
0x00007FFA61485114 (sl_zed64) slutils::cv::hal::LU32f
0x00007FFA61C4F5A0 (sl_zed64) slutils::cv::hal::LU32f
0x00007FFA61C56C0C (sl_zed64) slutils::cv::hal::LU32f
0x00007FFA61A2AA63 (sl_zed64) slutils::cv::hal::LU32f
0x00007FFB41051BB2 (ucrtbase) configthreadlocale
0x00007FFB424C7344 (KERNEL32) BaseThreadInitThunk
0x00007FFB439426B1 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

P.S. please disable that new users cannot upload files. I wanted to attach the player logs and crash dump

@DevDunk

I just promoted your user rank, you should be able to send files now.

  • Do you reproduce the issue with one of the sample scenes? (object detection 2D or 3D for example, or other scenes?)
    • If you don’t, can you share the steps/code to reproduce the issue?
  • Does the issue happen if you don’t lock the framerate?
  • Can you share the logs from the ZED SDK from a crashing session?

To enable the logs in Unity, you have to manually edit ZEDManager.cs around those lines [Github].
Please add
initParameters.sdkVerbose = 1;
after them.
Then, every time the SDK logs something, it will be into C:\ProgramData\Stereolabs\zed\log on Windows (at the end of the last log file).

zedlog_2024-01-17_2164.log (17.2 KB)
crash.dmp (2.0 MB)
Editor.log (375.7 KB)
ZEDService.cs (3.5 KB)

Here are all the logs I can get. And the script that does most of the ZED work. It does happen with fps unlocked. I did not reproduce it yet in the official scenes. It happens more often when my laptop is on battery, so maybe there is an async readback somewhere causing a race condition if it does not meet performance requirements?

About the initParameters.sdkVerbose = 1:
I highly recommend to add initParameters.sdkVerbose = wrapperVerbose ? 1 : 0;
Currently the wrapperVerbose value is unused, while it does have the description and bool setup. Maybe exposing it by making it public or using [SerializeField] is a good idea as well. If you want I can also PR that on git.

@DevDunk

Thanks for the feedback an logs. (Indeed, that PR would be appreciated)

I only get what looks like an obscure SDK crash from the logs. Would you be able to send us a minimal scene reproducing the issue, either here or on support@stereolabs.com ?

The when laptop is on battery make me think of a power plan issue, maybe it’s worth trying if it happens when you set it to high performance or equivalent? Even tough it also happens when plugged.

Sent an email, let’s continue talking there

1 Like

Sent an email, let’s continue talking there

[Discourse post]