Aruco Marker Sample seems broken after update

Hello - we’ve just updated from 5.2.0 to 5.4.1 and have noticed that the aruco detection in our project has stopped working.
We also updated the “OpenCV ArUco Detection” sample and it doesn’t work in there either.
The issue specifically seems to be this -

[ZEDToOpenCV] RetrieveImage failed.
View: LEFT_GREY
Mat Type: MAT_8U_C1
Error: CUDA_ERROR
UnityEngine.Debug:LogError (object)
ZEDToOpenCVRetriever:DeployGrabbedEvent (UnityEngine.Camera,sl.ZEDMat&,sl.VIEW,sl.ZEDMat/MAT_TYPE,OpenCVForUnity.CoreModule.Mat&,ZEDToOpenCVRetriever/ImageUpdatedEvent,ZEDToOpenCVRetriever/OpenCVConversion) (at Assets/Samples/ZED SDK/5.4.0/OpenCV ArUco Detection/Scripts/Core/ZEDToOpenCVRetriever.cs:246)
ZEDToOpenCVRetriever:OnZEDGrabbed () (at Assets/Samples/ZED SDK/5.4.0/OpenCV ArUco Detection/Scripts/Core/ZEDToOpenCVRetriever.cs:186)
ZEDManager:UpdateImages () (at ./Packages/com.stereolabs.zed/SDK/Helpers/Scripts/ZEDManager.cs:2793)
ZEDManager:Update () (at ./Packages/com.stereolabs.zed/SDK/Helpers/Scripts/ZEDManager.cs:2910)

Hi @Rosss,
welcome to the StereoLabs community, and thank you for the detailed log.

This is a known issue in the ZED Unity plugin v5.4.x, and it’s not caused by your project or by the ArUco sample code. The C API function sl_retrieve_image takes a final CUDA stream argument, but the plugin’s binding was missing it. The native side then read an uninitialized value and tried to use it as a CUDA stream, which caused the CUDA_ERROR. sl_retrieve_measure had the same problem.

The fix is in the ZED Unity plugin v5.5.0 (see commit ad37d2f). That commit also fixes a few other binding mismatches with the C API.

To fix it:

  1. Install the ZED SDK v5.5. The plugin needs the same major and minor version as the ZED SDK, so plugin v5.5.0 requires SDK 5.5.x.
  2. Update the com.stereolabs.zed package in your project to v5.5.0.
  3. Remove the old Assets/Samples/ZED SDK/5.4.0/OpenCV ArUco Detection folder and re-import the sample from the Package Manager.

One note on v5.5.0: InitParameters.enableImageValidityCheck is now an int instead of a bool. If your project sets it, assign 1 or 0 instead of true or false.

You can find more information in the ZED Unity documentation.

Please let us know if the ArUco detection works again after the update.

Best,
Myzhar