stereolabs / zed-UE5

ZED plugin and examples for Unreal Engine 5 (Standard Engine)
MIT License
63 stars 15 forks source link

Unreal crashes when i press "play level" #35

Closed Instant-Sage closed 10 months ago

Instant-Sage commented 12 months ago

Preliminary Checks

Description

ive done all the steps successfully including building in visual studio and loading the project up in unreal engine. But when i press play on any of the levels provided, ureal crashes straight away.

Steps to Reproduce

1.Unzip 2.Genereate visual studio files 3.Rebuild on ZEDSamples in viual studio 4.Launch zedsamples.uproject - (unreal 5.1.1)

  1. Press play button inside unreal engine. ...

Expected Result

Level plays, camera loads and starts tracking.

Actual Result

unreal crashes - Crash report below.

LoginId:abf2da2840833c5a30f902bba2297cd6 EpicAccountId:fc9f86e4226e4ac4adea77b7d5badba4

Unhandled Exception: 0xc06d007e

KERNELBASE UnrealEditor_Stereolabs!delayLoadHelper2() [D:\a_work\1\s\src\vctools\delayimp\delayhlp.cpp:312] UnrealEditor_Stereolabs!_tailMerge_sl_zed_c_dll() UnrealEditor_Stereolabs!USlCameraProxy::OpenCamera() [C:\Work\zed-UE5-main\Plugins\Stereolabs\Source\Stereolabs\Private\Core\StereolabsCameraProxy.cpp:223] UnrealEditor_ZED!AZEDPlayerController::ZedReady() [C:\Work\zed-UE5-main\Plugins\Stereolabs\Source\ZED\Private\Core\ZEDPlayerController.cpp:432] UnrealEditor_ZED!AZEDPlayerController::Internal_OpenZedCamera() [C:\Work\zed-UE5-main\Plugins\Stereolabs\Source\ZED\Private\Core\ZEDPlayerController.cpp:423] UnrealEditor_ZED!TBaseUObjectMethodDelegateInstance<0,AZEDPlayerController,void cdecl(void),FDefaultDelegateUserPolicy>::Execute() [C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:601] UnrealEditor_Engine UnrealEditor_Engine UnrealEditor_Engine UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor kernel32 ntdll

ZED Camera model

ZED2i

Environment

Processor   13th Gen Intel(R) Core(TM) i9-13900K   3.00 GHz
Installed RAM   64.0 GB (63.7 GB usable)
System type 64-bit operating system, x64-based processor
GFX             Nvidia 4090 (desktop)

Anything else?

Ive run the Zed diagnostics several times with all green ticks.

BanTheRewind commented 12 months ago

I have the same issue with the ZED-M. I have a RTX 3080, but everything else (even CPU) matches this issue. I'm using VS2022, but left the compiler at v142. ZED SDK version is 4.0.7 with CUDA 12.1. Windows 11. My camera works fine in any other app which uses it, and it passes all diagnostics. I know that the neural features don't work in debug mode from when I develop outside of the framework (where I use release w/ debug info). Possibly related here?

ZED_Diagnostic_Results.json

SLJLMacarit commented 12 months ago

@Instant-Sage @BanTheRewind Please try using Unreal 5.2. The repo was just updated to reflect this compatibility issue, sorry for the inconvenience.

Instant-Sage commented 12 months ago

Hi, @SLJLMacarit , thank you for the reply and update.

Ive downloaded latest repo, Built it with visual studio 2019. Run it with unreal 5.2.1 - and now i get the following error when i press play inside unreal: GPU Crashed or D3D Device Removed.

Use -d3ddebug to enable the D3D debug device. Check log for GPU state information.

Unreal crash report: LoginId:abf2da2840833c5a30f902bba2297cd6 EpicAccountId:fc9f86e4226e4ac4adea77b7d5badba4

Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 873] CurrentQueue.Fence.D3DFence->GetCompletedValue() failed at D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Submission.cpp:939 with error DXGI_ERROR_DEVICE_REMOVED with Reason: DXGI_ERROR_DEVICE_REMOVED

UnrealEditor_D3D12RHI UnrealEditor_D3D12RHI UnrealEditor_D3D12RHI UnrealEditor_D3D12RHI UnrealEditor_D3D12RHI UnrealEditor_Core UnrealEditor_Core kernel32 ntdll

SLJLMacarit commented 12 months ago

@Instant-Sage That's a Dx12 issue, please switch to Dx11 for the time being. I'm actively working on the release notes and troubleshooting mentioning this, and on the temporary fix. There will be a release soon with all this mentioned.

Going back on my word for 5.2 (didn't think you'd be this fast haha), we'll migrate to 5.3 soon, for the sake of not downloading UE5 every couple of days, please try using 5.3, it should work with some slight changes. You can find them on the ue5.3 branch.

Instant-Sage commented 12 months ago

Hi, thank you or the quick comment. I was just coming back to say that i found this thread - https://community.stereolabs.com/t/crash-when-using-unreal-engine-zedsamples/2651/8

And changed the project setting from DX12 to DX11 and its now working fine. - Ill try the 5.3 and let you know how that works. Thank you.

BanTheRewind commented 12 months ago

On the ue5.3 branch, I needed to add "HeadMountedDisplay" to PrivateDependencyModuleNames in "zed-UE5\Plugins\Stereolabs\Source\Stereolabs\Stereolabs.Build.cs" to fix a missing header error. Now I'm puppeting a robot with my ZED-M in UE 5.3.1. Thank you!

Instant-Sage commented 12 months ago

Hi @SLJLMacarit. I cant generate visual studio files for the 5.3 version as i get this error below:

Generating VisualStudio2019 project files: Discovering modules, targets and source code for project... Visual Studio 2019 does not support .NET 6.0 C# projects, these projects will not be added to the generated solution. Please generate the Visual Studio 2022 solution if .NET 6.0 C# project support is required. Microsoft platform targets must be compiled with Visual Studio 2022 17.4 (MSVC 14.34.x) or later for the installed engine. Please update Visual Studio 2022 and ensure no configuration is forcing WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30152

When i switch to unreal v 5.2 - it succesfully geerates visual studio files which i can then build.

BanTheRewind commented 12 months ago

@Instant-Sage In the ue5.3 branch, DefaultEngine.ini:124 declares Compiler=VisualStudio2022. You'll need the v143 compiler to build this, so VS2019 won't work.

Instant-Sage commented 12 months ago

Ok so the project file kept trying to generate files with VS2019 - even though i had it uninstalled. The fix that worked for me is to add this line:

`

VisualStudio2022

`

Into the Buildconfiguration.xml file which lives here: C:\Users\Admin\AppData\Roaming\Unreal Engine\UnrealBuildTool

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days